dri: Avoid swapbuffer throttling in glXCopySubBufferMESA
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 3 Oct 2019 16:16:50 +0000 (12:16 -0400)
committerKenneth Graunke <kenneth@whitecape.org>
Sat, 5 Oct 2019 13:19:37 +0000 (13:19 +0000)
We were supplying __DRI2_THROTTLE_SWAPBUFFER, rather than the obvious
choice of __DRI2_THROTTLE_COPYSUBBUFFER.  This meant that we hit the
swap-based frame throttling.  glXCopySubBuffer doesn't seem like it's
intended to be a frame boundary, so we'd like to avoid this throttling.

Tested-by: Michel Dänzer <mdaenzer@redhat.com> # DRI3 only
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
src/glx/dri2_glx.c
src/loader/loader_dri3_helper.c

index d2a9c881357c75b9ab3783ccd2e440a68fe57c0a..9c222d81312ac72c7f6c423048eb5fc549982195 100644 (file)
@@ -599,7 +599,7 @@ __dri2CopySubBuffer(__GLXDRIdrawable *pdraw, int x, int y,
    flags = __DRI2_FLUSH_DRAWABLE;
    if (flush)
       flags |= __DRI2_FLUSH_CONTEXT;
-   dri2Flush(psc, ctx, priv, flags, __DRI2_THROTTLE_SWAPBUFFER);
+   dri2Flush(psc, ctx, priv, flags, __DRI2_THROTTLE_COPYSUBBUFFER);
 
    region = XFixesCreateRegion(psc->base.dpy, &xrect, 1);
    DRI2CopyRegion(psc->base.dpy, pdraw->xDrawable, region,
index 90c55436cf7aa62c2772ab98df8c43a9a8759d67..be33575e1a8f59dcdafdc470590824df33bd4b48 100644 (file)
@@ -763,7 +763,7 @@ loader_dri3_copy_sub_buffer(struct loader_dri3_drawable *draw,
 
    if (flush)
       flags |= __DRI2_FLUSH_CONTEXT;
-   loader_dri3_flush(draw, flags, __DRI2_THROTTLE_SWAPBUFFER);
+   loader_dri3_flush(draw, flags, __DRI2_THROTTLE_COPYSUBBUFFER);
 
    back = dri3_find_back_alloc(draw);
    if (!back)