summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <daenzer@vmware.com>2009-08-27 09:52:10 +0200
committerMichel Dänzer <daenzer@vmware.com>2009-08-27 09:52:10 +0200
commit9b5517fcf7f2397a1a814d396fc9dc24769a6d9f (patch)
tree30f71a3181099908019c7a5ac4ce3ca69e5696e7
parent04692f80678ffea15ac33820381ce45865e697b8 (diff)
Throttle DRI2 buffer swaps / frontbuffer flushes.
-rw-r--r--src/radeon_dri2.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/radeon_dri2.c b/src/radeon_dri2.c
index b52f9659..c303f7b6 100644
--- a/src/radeon_dri2.c
+++ b/src/radeon_dri2.c
@@ -275,6 +275,25 @@ radeon_dri2_copy_region(DrawablePtr drawable,
(*gc->funcs->ChangeClip) (gc, CT_REGION, copy_clip, 0);
ValidateGC(&dst_pixmap->drawable, gc);
+ /* If this is a full buffer swap or frontbuffer flush, throttle on the
+ * previous one
+ */
+ if (dst_private->attachment == DRI2BufferFrontLeft) {
+ if (REGION_NUM_RECTS(region) == 1) {
+ BoxPtr extents = REGION_EXTENTS(pScreen, region);
+
+ if (extents->x1 == 0 && extents->y1 == 0 &&
+ extents->x2 == drawable->width &&
+ extents->y2 == drawable->height) {
+ struct radeon_exa_pixmap_priv *exa_priv =
+ exaGetPixmapDriverPrivate(dst_pixmap);
+
+ if (exa_priv && exa_priv->bo)
+ radeon_bo_wait(exa_priv->bo);
+ }
+ }
+ }
+
vsync = info->accel_state->vsync;
info->accel_state->vsync = TRUE;