[PATCH xf86-video-amdgpu 1/3] Use root window (pixmap) instead of screen pixmap for scanout updates

Michel Dänzer michel at daenzer.net
Wed Aug 2 10:12:46 UTC 2017


From: Michel Dänzer <michel.daenzer at amd.com>

Preparation for following changes, no functional change intended yet.

(Ported from radeon commit c2d26890691ec105858f086b63170ad94c6f7f05)

Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
 src/amdgpu_kms.c      |  2 +-
 src/drmmode_display.c | 21 ++++++++++++++-------
 2 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
index 2355a8979..c86f117f9 100644
--- a/src/amdgpu_kms.c
+++ b/src/amdgpu_kms.c
@@ -877,7 +877,7 @@ amdgpu_scanout_do_update(xf86CrtcPtr xf86_crtc, int scanout_id)
 		GCPtr gc = GetScratchGC(pDraw->depth, pScreen);
 
 		ValidateGC(pDraw, gc);
-		(*gc->ops->CopyArea)(&pScreen->GetScreenPixmap(pScreen)->drawable,
+		(*gc->ops->CopyArea)(&pScreen->GetWindowPixmap(pScreen->root)->drawable,
 				     pDraw, gc,
 				     xf86_crtc->x + extents.x1, xf86_crtc->y + extents.y1,
 				     extents.x2 - extents.x1, extents.y2 - extents.y1,
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 9b33d4dbb..8ddb2ac9b 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -471,11 +471,8 @@ drmmode_crtc_scanout_free(drmmode_crtc_private_ptr drmmode_crtc)
 					     &drmmode_crtc->scanout[1]);
 	}
 
-	if (drmmode_crtc->scanout_damage) {
+	if (drmmode_crtc->scanout_damage)
 		DamageDestroy(drmmode_crtc->scanout_damage);
-		drmmode_crtc->scanout_damage = NULL;
-		RegionUninit(&drmmode_crtc->scanout_last_region);
-	}
 }
 
 void
@@ -543,6 +540,15 @@ amdgpu_screen_damage_report(DamagePtr damage, RegionPtr region, void *closure)
 	damage->damage.data = NULL;
 }
 
+static void
+drmmode_screen_damage_destroy(DamagePtr damage, void *closure)
+{
+	drmmode_crtc_private_ptr drmmode_crtc = closure;
+
+	drmmode_crtc->scanout_damage = NULL;
+	RegionUninit(&drmmode_crtc->scanout_last_region);
+}
+
 static Bool
 drmmode_can_use_hw_cursor(xf86CrtcPtr crtc)
 {
@@ -730,9 +736,10 @@ drmmode_crtc_scanout_update(xf86CrtcPtr crtc, DisplayModePtr mode,
 		if (!drmmode_crtc->scanout_damage) {
 			drmmode_crtc->scanout_damage =
 				DamageCreate(amdgpu_screen_damage_report,
-					     NULL, DamageReportRawRegion,
-					     TRUE, screen, NULL);
-			DamageRegister(&screen->GetScreenPixmap(screen)->drawable,
+					     drmmode_screen_damage_destroy,
+					     DamageReportRawRegion,
+					     TRUE, screen, drmmode_crtc);
+			DamageRegister(&screen->root->drawable,
 				       drmmode_crtc->scanout_damage);
 		}
 
-- 
2.13.3



More information about the amd-gfx mailing list