xf86-video-intel: src/intel_dri.c src/sna/sna_dri.c

Chris Wilson ickle at kemper.freedesktop.org
Tue Jun 19 03:02:39 PDT 2012


 src/intel_dri.c   |   15 +++++++++++++++
 src/sna/sna_dri.c |   11 +++++++++++
 2 files changed, 26 insertions(+)

New commits:
commit 99845dcb3ba862269b29aec782e2bcef31c0403e
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Jun 19 10:37:10 2012 +0100

    Post Damage on the Screen Pixmap after a pageflip
    
    This issue was raised by Dave Airlie as he is trying to integrate
    multiple GPUs into the xserver, and a particular setup has a slave
    rendering device that copies the contents from the GPU over a
    DisplayLink USB adaptor. As such the slave device is listening for
    Damage on the Screen Pixmap and needs the update following pageflips.
    Since we already are posting damage for all the SwapBuffers paths other
    than pageflip, for consistency we should post damage along the pageflip
    path as well.
    
    Reported-by: Dave Airlie <airlied at redhat.com>
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/intel_dri.c b/src/intel_dri.c
index 6bf76d0..88ab249 100644
--- a/src/intel_dri.c
+++ b/src/intel_dri.c
@@ -860,6 +860,21 @@ intel_exchange_pixmap_buffers(struct intel_screen_private *intel, PixmapPtr fron
 	new_back->busy = -1;
 
 	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);
+	}
+
 	return new_front;
 }
 
diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c
index b9f9b85..5390b5a 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -384,6 +384,7 @@ static void set_bo(PixmapPtr pixmap, struct kgem_bo *bo)
 {
 	struct sna *sna = to_sna_from_pixmap(pixmap);
 	struct sna_pixmap *priv = sna_pixmap(pixmap);
+	RegionRec region;
 
 	sna_damage_all(&priv->gpu_damage,
 		       pixmap->drawable.width,
@@ -393,6 +394,16 @@ static void set_bo(PixmapPtr pixmap, struct kgem_bo *bo)
 
 	kgem_bo_destroy(&sna->kgem, priv->gpu_bo);
 	priv->gpu_bo = ref(bo);
+
+	/* Post damage on the new front buffer so that listeners, such
+	 * as DisplayLink know take a copy and shove it over the USB.
+	 */
+	region.extents.x1 = region.extents.y1 = 0;
+	region.extents.x2 = pixmap->drawable.width;
+	region.extents.y2 = pixmap->drawable.height;
+	region.data = NULL;
+	DamageRegionAppend(&pixmap->drawable, &region);
+	DamageRegionProcessPending(&pixmap->drawable);
 }
 
 static struct kgem_bo *


More information about the xorg-commit mailing list