[PATCH xf86-video-ati 07/10] Add source drawable parameter to radeon_scanout_do_update

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Michel Dänzer <michel.daenzer@xxxxxxx>

Preparation for following changes, no functional change intended yet.

Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
 src/drmmode_display.c |  3 ++-
 src/radeon.h          |  3 ++-
 src/radeon_kms.c      | 18 +++++++++---------
 3 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index ae8b4a110..a7be21965 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -831,7 +831,8 @@ drmmode_crtc_scanout_update(xf86CrtcPtr crtc, DisplayModePtr mode,
 		*fb = radeon_pixmap_get_fb(drmmode_crtc->scanout[scanout_id].pixmap);
 		*x = *y = 0;
 
-		radeon_scanout_do_update(crtc, scanout_id);
+		radeon_scanout_do_update(crtc, scanout_id,
+					 &screen->GetWindowPixmap(screen->root)->drawable);
 		radeon_bo_wait(drmmode_crtc->scanout[scanout_id].bo);
 	}
 }
diff --git a/src/radeon.h b/src/radeon.h
index b93e28163..864fe7c30 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -664,7 +664,8 @@ extern Bool RADEONGetPixmapOffsetPitch(PixmapPtr pPix,
 Bool radeon_dri3_screen_init(ScreenPtr screen);
 
 /* radeon_kms.c */
-Bool radeon_scanout_do_update(xf86CrtcPtr xf86_crtc, int scanout_id);
+Bool radeon_scanout_do_update(xf86CrtcPtr xf86_crtc, int scanout_id,
+			      DrawablePtr src_draw);
 void RADEONWindowExposures_oneshot(WindowPtr pWin, RegionPtr pRegion
 #if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1,16,99,901,0)
 				   , RegionPtr pBSRegion
diff --git a/src/radeon_kms.c b/src/radeon_kms.c
index 977504d94..5f02a4879 100644
--- a/src/radeon_kms.c
+++ b/src/radeon_kms.c
@@ -890,7 +890,8 @@ radeon_dirty_update(ScrnInfoPtr scrn)
 #endif
 
 Bool
-radeon_scanout_do_update(xf86CrtcPtr xf86_crtc, int scanout_id)
+radeon_scanout_do_update(xf86CrtcPtr xf86_crtc, int scanout_id,
+			 DrawablePtr src_draw)
 {
     drmmode_crtc_private_ptr drmmode_crtc = xf86_crtc->driver_private;
     RegionPtr pRegion = DamageRegion(drmmode_crtc->scanout_damage);
@@ -930,10 +931,7 @@ radeon_scanout_do_update(xf86CrtcPtr xf86_crtc, int scanout_id)
 	PicturePtr src, dst;
 	XID include_inferiors = IncludeInferiors;
 
-	src = CreatePicture(None,
-			    &pScreen->root->drawable,
-			    format,
-			    CPSubwindowMode,
+	src = CreatePicture(None, src_draw, format, CPSubwindowMode,
 			    &include_inferiors, serverClient, &error);
 	if (!src) {
 	    ErrorF("Failed to create source picture for transformed scanout "
@@ -978,8 +976,7 @@ radeon_scanout_do_update(xf86CrtcPtr xf86_crtc, int scanout_id)
 	GCPtr gc = GetScratchGC(pDraw->depth, pScreen);
 
 	ValidateGC(pDraw, gc);
-	(*gc->ops->CopyArea)(&pScreen->GetWindowPixmap(pScreen->root)->drawable,
-			     pDraw, gc,
+	(*gc->ops->CopyArea)(src_draw, pDraw, gc,
 			     xf86_crtc->x + extents.x1, xf86_crtc->y + extents.y1,
 			     extents.x2 - extents.x1, extents.y2 - extents.y1,
 			     extents.x1, extents.y1);
@@ -1006,8 +1003,10 @@ radeon_scanout_update_handler(xf86CrtcPtr crtc, uint32_t frame, uint64_t usec,
 			      void *event_data)
 {
     drmmode_crtc_private_ptr drmmode_crtc = event_data;
+    ScreenPtr screen = crtc->scrn->pScreen;
 
-    radeon_scanout_do_update(crtc, drmmode_crtc->scanout_id);
+    radeon_scanout_do_update(crtc, drmmode_crtc->scanout_id,
+			     &screen->GetWindowPixmap(screen->root)->drawable);
 
     radeon_scanout_update_abort(crtc, event_data);
 }
@@ -1094,7 +1093,8 @@ radeon_scanout_flip(ScreenPtr pScreen, RADEONInfoPtr info,
 	return;
 
     scanout_id = drmmode_crtc->scanout_id ^ 1;
-    if (!radeon_scanout_do_update(xf86_crtc, scanout_id))
+    if (!radeon_scanout_do_update(xf86_crtc, scanout_id,
+				  &pScreen->GetWindowPixmap(pScreen->root)->drawable))
 	return;
 
     drm_queue_seq = radeon_drm_queue_alloc(xf86_crtc,
-- 
2.14.1



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux