aubinator: add a custom handler for immediate register load

Transforming this :

0x00c77084:  0x11000001:  MI_LOAD_REGISTER_IMM
0x00c77088:  0x0000b020 : Dword 1
    Register Offset: 0x0000b020
    0x00c7708c:  0x00880038 : Dword 2
    Data DWord: 8912952

Into this:

0x007880f0:  0x11000001:  MI_LOAD_REGISTER_IMM
0x007880f4:  0x0000b020 : Dword 1
    Register Offset: 0x0000b020
    0x007880f8:  0x00080040 : Dword 2
    Data DWord: 524352
register L3CNTLREG2 (0xb020) : 0x80040
    SLM Enable: 0
    URB Allocation: 32
    URB Low Bandwidth: 0
    RO Allocation: 32
    RO Low Bandwidth: 0
    DC Allocation: 0
    DC Low Bandwidth: 0

v2: Drop unused arguments (Sirisha)
    Print out register name

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
This commit is contained in:
Lionel Landwerlin
2016-09-09 11:22:59 +01:00
parent 0301858a31
commit 792d77165b
3 changed files with 47 additions and 3 deletions

View File

@@ -616,6 +616,18 @@ handle_3dstate_scissor_state_pointers(struct gen_spec *spec, uint32_t *p)
decode_structure(spec, scissor_rect, gtt + start);
}
static void
handle_load_register_imm(struct gen_spec *spec, uint32_t *p)
{
struct gen_group *reg = gen_spec_find_register(spec, p[1]);
if (reg != NULL) {
printf("register %s (0x%x): 0x%x\n",
reg->name, reg->register_offset, p[2]);
decode_structure(spec, reg, &p[2]);
}
}
#define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0])
#define STATE_BASE_ADDRESS 0x61010000
@@ -654,6 +666,8 @@ handle_3dstate_scissor_state_pointers(struct gen_spec *spec, uint32_t *p)
#define _3DSTATE_CC_STATE_POINTERS 0x780e0000
#define _3DSTATE_SCISSOR_STATE_POINTERS 0x780f0000
#define _MI_LOAD_REGISTER_IMM 0x11000000
struct custom_handler {
uint32_t opcode;
void (*handle)(struct gen_spec *spec, uint32_t *p);
@@ -687,7 +701,8 @@ struct custom_handler {
{ _3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP, handle_3dstate_viewport_state_pointers_sf_clip },
{ _3DSTATE_BLEND_STATE_POINTERS, handle_3dstate_blend_state_pointers },
{ _3DSTATE_CC_STATE_POINTERS, handle_3dstate_cc_state_pointers },
{ _3DSTATE_SCISSOR_STATE_POINTERS, handle_3dstate_scissor_state_pointers }
{ _3DSTATE_SCISSOR_STATE_POINTERS, handle_3dstate_scissor_state_pointers },
{ _MI_LOAD_REGISTER_IMM, handle_load_register_imm }
};
static void