intel: Don't do client-side frame throttling with DRI2 SwapBuffers.
authorEric Anholt <eric@anholt.net>
Mon, 25 Jan 2010 22:53:50 +0000 (14:53 -0800)
committerEric Anholt <eric@anholt.net>
Tue, 26 Jan 2010 06:57:33 +0000 (22:57 -0800)
The server side does the throttling on our behalf now by putting the
client to sleep, so we don't need our previous hacks for limiting the
number of outstanding frames.  Same effect as
7d4e674b212c9dc6408c13913a399bd4a2b9a1e3.

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

index cac9b7e56540ab72e3e686371be23005742441a8..3896bfa091e7faf4927c0db7c7600b13f83be05b 100644 (file)
@@ -521,7 +521,8 @@ intel_glFlush(GLcontext *ctx)
     * 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) {
+   if (!intel->using_dri2_swapbuffers &&
+       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;
index 6ba281cc144202dde256cf5c1496ac4c85ec189c..57c3391130c22ba830432c37a467dc18c0b10271 100644 (file)
@@ -186,6 +186,7 @@ struct intel_context
    struct intel_batchbuffer *batch;
    drm_intel_bo *first_post_swapbuffers_batch;
    GLboolean no_batch_wrap;
+   GLboolean using_dri2_swapbuffers;
 
    struct
    {
index a98600b5759ae931a5eda01ada5ce4740119ffc0..b170317699e6b11436ad839731609f4dd05036ea 100644 (file)
@@ -126,6 +126,10 @@ intelDRI2Flush(__DRIdrawable *drawable)
 static void
 intelDRI2FlushInvalidate(__DRIdrawable *drawable)
 {
+   struct intel_context *intel = drawable->driContextPriv->driverPrivate;
+
+   intel->using_dri2_swapbuffers = GL_TRUE;
+
    intelDRI2Flush(drawable);
    drawable->validBuffers = GL_FALSE;
 }