[Intel-gfx] [PATCH] intel: fix fullscreen damage posting on pageflip
Dave Airlie
airlied at gmail.com
Thu Oct 11 06:30:29 CEST 2012
From: Dave Airlie <airlied at redhat.com>
While playing with MPX and sw cursor I noticed page flips won't
end up misrendering some bits, so the sw cursor was replacing the
bits on the wrong pixmap.
Fix the damage handling to be correct and append damage before swapping
the pointers and process damage after.
This fixes misrendering with MPX cursors under a fullscreen compositor,
that pageflips.
Signed-off-by: Dave Airlie <airlied at redhat.com>
---
src/intel_dri.c | 25 ++++++++++++-------------
1 file changed, 12 insertions(+), 13 deletions(-)
diff --git a/src/intel_dri.c b/src/intel_dri.c
index 64cb567..867a465 100644
--- a/src/intel_dri.c
+++ b/src/intel_dri.c
@@ -725,6 +725,17 @@ static struct intel_pixmap *
intel_exchange_pixmap_buffers(struct intel_screen_private *intel, PixmapPtr front, PixmapPtr back)
{
struct intel_pixmap *new_front, *new_back;
+ RegionRec region;
+
+ /* Post damage on the front buffer so that listeners, such
+ * as DisplayLink know take a copy and shove it over the USB.
+ * also for sw cursors.
+ */
+ region.extents.x1 = region.extents.y1 = 0;
+ region.extents.x2 = front->drawable.width;
+ region.extents.y2 = front->drawable.height;
+ region.data = NULL;
+ DamageRegionAppend(&front->drawable, ®ion);
new_front = intel_get_pixmap_private(back);
new_back = intel_get_pixmap_private(front);
@@ -735,19 +746,7 @@ intel_exchange_pixmap_buffers(struct intel_screen_private *intel, PixmapPtr fron
intel_glamor_exchange_buffers(intel, front, back);
- /* Post damage on the new front buffer so that listeners, such
- * as DisplayLink know take a copy and shove it over the USB.
- */
- {
- RegionRec region;
-
- region.extents.x1 = region.extents.y1 = 0;
- region.extents.x2 = front->drawable.width;
- region.extents.y2 = front->drawable.height;
- region.data = NULL;
- DamageRegionAppend(&front->drawable, ®ion);
- DamageRegionProcessPending(&front->drawable);
- }
+ DamageRegionProcessPending(&front->drawable);
return new_front;
}
--
1.7.12.1
More information about the Intel-gfx
mailing list