public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] intel: fix fullscreen damage posting on pageflip
@ 2012-10-11  4:30 Dave Airlie
  2012-10-11  7:53 ` Chris Wilson
  0 siblings, 1 reply; 4+ messages in thread
From: Dave Airlie @ 2012-10-11  4:30 UTC (permalink / raw)
  To: intel-gfx

From: Dave Airlie <airlied@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@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, &region);
 
 	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, &region);
-		DamageRegionProcessPending(&front->drawable);
-	}
+	DamageRegionProcessPending(&front->drawable);
 
 	return new_front;
 }
-- 
1.7.12.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-10-11  8:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-11  4:30 [PATCH] intel: fix fullscreen damage posting on pageflip Dave Airlie
2012-10-11  7:53 ` Chris Wilson
2012-10-11  8:12   ` Dave Airlie
2012-10-11  8:26     ` Chris Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox