i965: Use 64-bit writes for timestamp queries.
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 7 Aug 2012 16:13:04 +0000 (09:13 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 8 Aug 2012 16:24:16 +0000 (09:24 -0700)
The hardware seems to use the length of the PIPE_CONTROL command to
indicate whether the write is 64-bits or 32-bits.  Which makes sense
for immediate writes.

Daniel discovered this by writing a pattern into the query object bo
and noticing that the high 32-bits were left intact, even on those
pipe control writes that seemingly worked.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/brw_queryobj.c

index 229aeb7ce162d1572f5feae4def49da1ab830b92..afa30914f93f59fdee2b824fe531996c3ee1417a 100644 (file)
@@ -49,14 +49,15 @@ static void
 write_timestamp(struct intel_context *intel, drm_intel_bo *query_bo, int idx)
 {
    if (intel->gen >= 6) {
-      BEGIN_BATCH(4);
-      OUT_BATCH(_3DSTATE_PIPE_CONTROL | (4 - 2));
+      BEGIN_BATCH(5);
+      OUT_BATCH(_3DSTATE_PIPE_CONTROL | (5 - 2));
       OUT_BATCH(PIPE_CONTROL_WRITE_TIMESTAMP);
       OUT_RELOC(query_bo,
                 I915_GEM_DOMAIN_INSTRUCTION, I915_GEM_DOMAIN_INSTRUCTION,
                 PIPE_CONTROL_GLOBAL_GTT_WRITE |
                 idx * sizeof(uint64_t));
       OUT_BATCH(0);
+      OUT_BATCH(0);
       ADVANCE_BATCH();
    } else {
       BEGIN_BATCH(4);