diff options
author | Eric Anholt <eric@anholt.net> | 2008-05-12 16:48:05 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2008-05-13 11:50:24 -0700 |
commit | 5c1720ecbc5528c40bb48084dc68ef233e9bb43b (patch) | |
tree | 9570142d643e6d0803fee538f07e0342c286b39a /src/reg_dumper | |
parent | 5103e5a39a4869a714b8a59da8bf51ecc8c65e4f (diff) |
Add i915 support to intel_idle.
Diffstat (limited to 'src/reg_dumper')
-rw-r--r-- | src/reg_dumper/idle.c | 58 | ||||
-rw-r--r-- | src/reg_dumper/reg_dumper.h | 2 |
2 files changed, 53 insertions, 7 deletions
diff --git a/src/reg_dumper/idle.c b/src/reg_dumper/idle.c index bc9dbb71..50af9c9c 100644 --- a/src/reg_dumper/idle.c +++ b/src/reg_dumper/idle.c @@ -42,6 +42,36 @@ struct idle_flags { unsigned int count; }; +struct idle_flags i915_idle_flags[] = { + {IDCT_DONE, "IDCT"}, + {IQ_DONE, "IQ"}, + {PR_DONE, "PR"}, + {VLD_DONE, "VLD"}, + {IP_DONE, "IP"}, + {FBC_DONE, "FBc"}, + {BINNER_DONE, "BINNER"}, + {SF_DONE, "SF"}, + {SE_DONE, "SE"}, + {WM_DONE, "WM"}, + {IZ_DONE, "IZ"}, + {PERSPECTIVE_INTERP_DONE, "perspective interpolation"}, + {DISPATCHER_DONE, "dispatcher"}, + {PROJECTION_DONE, "projection and LOD"}, + {DEPENDENT_ADDRESS_DONE, "dependent address calc"}, + {TEXTURE_FETCH_DONE, "texture fetch"}, + {TEXTURE_DECOMPRESS_DONE, "texture decompress"}, + {SAMPLER_CACHE_DONE, "sampler cache"}, + {FILTER_DONE, "filter"}, + {BYPASS_FIFO_DONE, "bypass FIFO"}, + {PS_DONE, "PS"}, + {CC_DONE, "CC"}, + {MAP_FILTER_DONE, "map filter"}, + {MAP_L2_IDLE, "map L2"}, + + {0, "total"}, + {0, "other"}, +}; + struct idle_flags i965_idle_flags[] = { {I965_SF_DONE, "SF"}, {I965_SE_DONE, "SE"}, @@ -60,12 +90,17 @@ struct idle_flags i965_idle_flags[] = { /* Fills in the "other" and "total" fields' idle flags */ static void -setup_other_flags(struct idle_flags *idle_flags, int idle_flag_count) +setup_other_flags(I830Ptr pI830, + struct idle_flags *idle_flags, int idle_flag_count) { uint32_t other_idle_flags, total_idle_flags = 0; int i; - other_idle_flags = ~(I965_RING_0_ENABLE); + if (IS_I965G(pI830)) + other_idle_flags = ~(I965_RING_0_ENABLE); + else + other_idle_flags = ~(RING_0_ENABLE | RING_1_ENABLE | RING_2_ENABLE); + for (i = 0; i < idle_flag_count - 2; i++) { other_idle_flags &= ~idle_flags[i].instdone_flag; total_idle_flags |= idle_flags[i].instdone_flag; @@ -127,17 +162,26 @@ int main(int argc, char **argv) scrn.scrnIndex = 0; scrn.pI830 = &i830; - /* if (IS_I965) { */ - idle_flags = i965_idle_flags; - idle_flag_count = sizeof(i965_idle_flags) / sizeof(i965_idle_flags[0]); + if (IS_I965G(pI830)) { + idle_flags = i965_idle_flags; + idle_flag_count = ARRAY_SIZE(i965_idle_flags); + } else { + idle_flags = i915_idle_flags; + idle_flag_count = ARRAY_SIZE(i915_idle_flags); + } - setup_other_flags(idle_flags, idle_flag_count); + setup_other_flags(pI830, idle_flags, idle_flag_count); for (;;) { int i, j; for (i = 0; i < 100; i++) { - uint32_t instdone = INREG(INST_DONE_I965); + uint32_t instdone; + + if (IS_I965G(pI830)) + instdone = INREG(INST_DONE_I965); + else + instdone = INREG(INST_DONE); for (j = 0; j < idle_flag_count; j++) { if ((instdone & idle_flags[j].instdone_flag) != diff --git a/src/reg_dumper/reg_dumper.h b/src/reg_dumper/reg_dumper.h index 769adb27..9a723b9b 100644 --- a/src/reg_dumper/reg_dumper.h +++ b/src/reg_dumper/reg_dumper.h @@ -69,6 +69,8 @@ typedef struct _scrn { #define I830PTR(pScrn) (pScrn->pI830) +#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) + #define INREG8(reg) (*(volatile uint8_t *)((pI830)->mmio + (reg))) #define INREG16(reg) (*(volatile uint16_t *)((pI830)->mmio + (reg))) #define INREG(reg) (*(volatile uint32_t *)((pI830)->mmio + (reg))) |