Emit a flush after the swapbuffers blit, so contents end up on the screen.
authorEric Anholt <eric@anholt.net>
Fri, 23 May 2008 19:18:50 +0000 (12:18 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 23 May 2008 19:18:50 +0000 (12:18 -0700)
Otherwise, since the MI_FLUSH at the end of every batch had been removed,
non-automatic-flushing chips (965) wouldn't get flushed and apps with static
rendering would get partial screen contents until the server's blockhandler
flush kicked in.

src/mesa/drivers/dri/i915/i830_reg.h
src/mesa/drivers/dri/i915/i915_reg.h
src/mesa/drivers/dri/i965/brw_defines.h
src/mesa/drivers/dri/intel/intel_blit.c
src/mesa/drivers/dri/intel/intel_reg.h

index 41280bc..d1084a8 100644 (file)
 #define ENABLE_TEX_STREAM_MAP_IDX      (1<<3)
 #define TEX_STREAM_MAP_IDX(x)          (x)
 
-
-#define MI_FLUSH           ((0<<29)|(4<<23))
-#define FLUSH_MAP_CACHE    (1<<0)
-
 #endif
index b5585e7..b718b86 100644 (file)
 #define _3DSTATE_DEFAULT_DIFFUSE    ((0x3<<29)|(0x1d<<24)|(0x99<<16))
 #define _3DSTATE_DEFAULT_SPECULAR   ((0x3<<29)|(0x1d<<24)|(0x9a<<16))
 
-
-#define MI_FLUSH                   ((0<<29)|(4<<23))
-#define FLUSH_MAP_CACHE            (1<<0)
-#define INHIBIT_FLUSH_RENDER_CACHE (1<<2)
-
-
 #endif
index 3aada8c..0fb531b 100644 (file)
@@ -38,7 +38,6 @@
 #define MI_NOOP                              0x00
 #define MI_USER_INTERRUPT                    0x02
 #define MI_WAIT_FOR_EVENT                    0x03
-#define MI_FLUSH                             0x04
 #define MI_REPORT_HEAD                       0x07
 #define MI_ARB_ON_OFF                        0x08
 #define MI_BATCH_BUFFER_END                  0x0A
index 3d7f64e..a1f4997 100644 (file)
@@ -159,6 +159,14 @@ intelCopyBuffer(const __DRIdrawablePrivate * dPriv,
         ADVANCE_BATCH();
       }
 
+      /* Emit a flush so that, on systems where we don't have automatic flushing
+       * set (such as 965), the results all land on the screen in a timely
+       * fashion.
+       */
+      BEGIN_BATCH(1, IGNORE_CLIPRECTS);
+      OUT_BATCH(MI_FLUSH);
+      ADVANCE_BATCH();
+
       intel_batchbuffer_flush(intel->batch);
    }
 
index 37629c0..c12ccf4 100644 (file)
 
 #define MI_BATCH_BUFFER_END            (CMD_MI | 0xA << 23)
 
+#define MI_FLUSH                       (CMD_MI | (4 << 23))
+#define FLUSH_MAP_CACHE                                (1 << 0)
+#define INHIBIT_FLUSH_RENDER_CACHE             (1 << 2)
+
 /* Stalls command execution waiting for the given events to have occurred. */
 #define MI_WAIT_FOR_EVENT               (CMD_MI | (0x3 << 23))
 #define MI_WAIT_FOR_PLANE_B_FLIP        (1<<6)