summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/i810_reg.h30
-rw-r--r--src/reg_dumper/idle.c58
-rw-r--r--src/reg_dumper/reg_dumper.h2
3 files changed, 83 insertions, 7 deletions
diff --git a/src/i810_reg.h b/src/i810_reg.h
index cc4620a8..bc42a4fa 100644
--- a/src/i810_reg.h
+++ b/src/i810_reg.h
@@ -353,7 +353,37 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#define IPEIR 0x2088
#define IPEHR 0x208C
+
#define INST_DONE 0x2090
+# define IDCT_DONE (1 << 30)
+# define IQ_DONE (1 << 29)
+# define PR_DONE (1 << 28)
+# define VLD_DONE (1 << 27)
+# define IP_DONE (1 << 26)
+# define FBC_DONE (1 << 25)
+# define BINNER_DONE (1 << 24)
+# define SF_DONE (1 << 23)
+# define SE_DONE (1 << 22)
+# define WM_DONE (1 << 21)
+# define IZ_DONE (1 << 20)
+# define PERSPECTIVE_INTERP_DONE (1 << 19)
+# define DISPATCHER_DONE (1 << 18)
+# define PROJECTION_DONE (1 << 17)
+# define DEPENDENT_ADDRESS_DONE (1 << 16)
+# define QUAD_CACHE_DONE (1 << 15)
+# define TEXTURE_FETCH_DONE (1 << 14)
+# define TEXTURE_DECOMPRESS_DONE (1 << 13)
+# define SAMPLER_CACHE_DONE (1 << 12)
+# define FILTER_DONE (1 << 11)
+# define BYPASS_FIFO_DONE (1 << 10)
+# define PS_DONE (1 << 9)
+# define CC_DONE (1 << 8)
+# define MAP_FILTER_DONE (1 << 7)
+# define MAP_L2_IDLE (1 << 6)
+# define RING_2_ENABLE (1 << 2)
+# define RING_1_ENABLE (1 << 1)
+# define RING_0_ENABLE (1 << 0)
+
#define SCPD0 0x209c /* debug */
#define INST_PS 0x20c4
#define IPEIR_I965 0x2064 /* i965 */
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)))