Revert "intel: Use the new DRI2 flush invalidate entrypoint to signal frame done."
authorEric Anholt <eric@anholt.net>
Mon, 25 Jan 2010 22:48:57 +0000 (14:48 -0800)
committerEric Anholt <eric@anholt.net>
Tue, 26 Jan 2010 06:57:33 +0000 (22:57 -0800)
This reverts commit 7d4e674b212c9dc6408c13913a399bd4a2b9a1e3.  It broke
throttling in the non-new-DRI2 case.

src/mesa/drivers/dri/intel/intel_context.c
src/mesa/drivers/dri/intel/intel_screen.c

index 5f2a473e22d73a53aaec861cb73e2de7bb6a9f57..cac9b7e56540ab72e3e686371be23005742441a8 100644 (file)
@@ -505,7 +505,27 @@ intelFlush(GLcontext * ctx)
 static void
 intel_glFlush(GLcontext *ctx)
 {
+   struct intel_context *intel = intel_context(ctx);
+
    intel_flush(ctx, GL_TRUE);
+
+   /* We're using glFlush as an indicator that a frame is done, which is
+    * what DRI2 does before calling SwapBuffers (and means we should catch
+    * people doing front-buffer rendering, as well)..
+    *
+    * Wait for the swapbuffers before the one we just emitted, so we don't
+    * get too many swaps outstanding for apps that are GPU-heavy but not
+    * CPU-heavy.
+    *
+    * Unfortunately, we don't have a handle to the batch containing the swap,
+    * and getting our hands on that doesn't seem worth it, so we just us the
+    * first batch we emitted after the last swap.
+    */
+   if (intel->first_post_swapbuffers_batch != NULL) {
+      drm_intel_bo_wait_rendering(intel->first_post_swapbuffers_batch);
+      drm_intel_bo_unreference(intel->first_post_swapbuffers_batch);
+      intel->first_post_swapbuffers_batch = NULL;
+   }
 }
 
 void
index fe504166427bae4b06ae415a375213a9f007d4d1..a98600b5759ae931a5eda01ada5ce4740119ffc0 100644 (file)
@@ -126,29 +126,8 @@ intelDRI2Flush(__DRIdrawable *drawable)
 static void
 intelDRI2FlushInvalidate(__DRIdrawable *drawable)
 {
-   struct intel_context *intel = drawable->driContextPriv->driverPrivate;
-
    intelDRI2Flush(drawable);
    drawable->validBuffers = GL_FALSE;
-
-   /* We're using FlushInvalidate as an indicator that a frame is
-    * done.  It's only called immediately after SwapBuffers, so it
-    * won't affect front-buffer rendering or applications explicitly
-    * managing swap regions using MESA_copy_buffer.
-    *
-    * Wait for the swapbuffers before the one we just emitted, so we don't
-    * get too many swaps outstanding for apps that are GPU-heavy but not
-    * CPU-heavy.
-    *
-    * Unfortunately, we don't have a handle to the batch containing the swap,
-    * and getting our hands on that doesn't seem worth it, so we just use the
-    * first batch we emitted after the last swap.
-    */
-   if (intel->first_post_swapbuffers_batch != NULL) {
-      drm_intel_bo_wait_rendering(intel->first_post_swapbuffers_batch);
-      drm_intel_bo_unreference(intel->first_post_swapbuffers_batch);
-      intel->first_post_swapbuffers_batch = NULL;
-   }
 }
 
 static const struct __DRI2flushExtensionRec intelFlushExtension = {