summaryrefslogtreecommitdiff
path: root/src/gallium/state_trackers/xorg/xorg_dri2.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/state_trackers/xorg/xorg_dri2.c')
-rw-r--r--src/gallium/state_trackers/xorg/xorg_dri2.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/gallium/state_trackers/xorg/xorg_dri2.c b/src/gallium/state_trackers/xorg/xorg_dri2.c
index e719644d34..4e01bd1030 100644
--- a/src/gallium/state_trackers/xorg/xorg_dri2.c
+++ b/src/gallium/state_trackers/xorg/xorg_dri2.c
@@ -299,6 +299,7 @@ dri2_copy_region(DrawablePtr pDraw, RegionPtr pRegion,
GCPtr gc;
RegionPtr copy_clip;
Bool save_accel;
+ CustomizerPtr cust = ms->cust;
/*
* In driCreateBuffers we dewrap windows into the
@@ -352,7 +353,8 @@ dri2_copy_region(DrawablePtr pDraw, RegionPtr pRegion,
ValidateGC(dst_draw, gc);
/* If this is a full buffer swap, throttle on the previous one */
- if (dst_priv->fence && REGION_NUM_RECTS(pRegion) == 1) {
+ if (ms->swapThrottling &&
+ dst_priv->fence && REGION_NUM_RECTS(pRegion) == 1) {
BoxPtr extents = REGION_EXTENTS(pScreen, pRegion);
if (extents->x1 == 0 && extents->y1 == 0 &&
@@ -374,6 +376,9 @@ dri2_copy_region(DrawablePtr pDraw, RegionPtr pRegion,
DamageRegionAppend(src_draw, pRegion);
DamageRegionProcessPending(src_draw);
+ if (cust && cust->winsys_context_throttle)
+ cust->winsys_context_throttle(cust, ms->ctx, THROTTLE_SWAP);
+
(*gc->ops->CopyArea)(src_draw, dst_draw, gc,
0, 0, pDraw->width, pDraw->height, 0, 0);
ms->exa->accel = save_accel;
@@ -381,8 +386,13 @@ dri2_copy_region(DrawablePtr pDraw, RegionPtr pRegion,
FreeScratchGC(gc);
ms->ctx->flush(ms->ctx, PIPE_FLUSH_SWAPBUFFERS,
- pDestBuffer->attachment == DRI2BufferFrontLeft ?
+ (pDestBuffer->attachment == DRI2BufferFrontLeft
+ && ms->swapThrottling) ?
&dst_priv->fence : NULL);
+
+ if (cust && cust->winsys_context_throttle)
+ cust->winsys_context_throttle(cust, ms->ctx, THROTTLE_RENDER);
+
}
Bool