Skip to contentSkip to conversation

Make radeon_scanout_do_update take a PixmapPtr instead of a DrawablePtr

PATCH In review Michel Dänzer 2 participants 2 messages Aug 17, 2017 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Make radeon_scanout_do_update take a PixmapPtr instead of a DrawablePtr

From: Michel Dänzer <[email protected]>

All callers were already passing in a pixmap.

This allows simplifying the rotated scanout case slightly.

---
 src/drmmode_display.c |  6 +++---
 src/radeon.h          |  2 +-
 src/radeon_kms.c      | 13 ++++++-------
 3 files changed, 10 insertions(+), 11 deletions(-)
src/drmmode_display.c +3 -3
index 90588671d..4839b415c 100644
@@ -842,7 +842,7 @@ drmmode_crtc_scanout_update(xf86CrtcPtr crtc, DisplayModePtr mode,
 		*x = *y = 0;
 
 		radeon_scanout_do_update(crtc, scanout_id,
-					 &screen->GetWindowPixmap(screen->root)->drawable,
+					 screen->GetWindowPixmap(screen->root),
 					 box);
 		radeon_bo_wait(drmmode_crtc->scanout[scanout_id].bo);
 	}
@@ -3050,8 +3050,8 @@ Bool radeon_do_pageflip(ScrnInfoPtr scrn, ClientPtr client,
 				goto error;
 			}
 
-			radeon_scanout_do_update(crtc, scanout_id,
-						 &new_front->drawable, &extents);
+			radeon_scanout_do_update(crtc, scanout_id, new_front,
+						 &extents);
 
 			drmmode_crtc_wait_pending_event(drmmode_crtc, pRADEONEnt->fd,
 							drmmode_crtc->scanout_update_pending);
src/radeon.h +1 -1
index bba344340..71123c7c7 100644
@@ -665,7 +665,7 @@ Bool radeon_dri3_screen_init(ScreenPtr screen);
 
 /* radeon_kms.c */
 Bool radeon_scanout_do_update(xf86CrtcPtr xf86_crtc, int scanout_id,
-			      DrawablePtr src_draw, BoxPtr extents);
+			      PixmapPtr src_pix, BoxPtr extents);
 void RADEONWindowExposures_oneshot(WindowPtr pWin, RegionPtr pRegion
 #if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1,16,99,901,0)
 				   , RegionPtr pBSRegion
src/radeon_kms.c +6 -7
index 4c001a31f..ca2d36d04 100644
@@ -904,7 +904,7 @@ radeon_dirty_update(ScrnInfoPtr scrn)
 
 Bool
 radeon_scanout_do_update(xf86CrtcPtr xf86_crtc, int scanout_id,
-			 DrawablePtr src_draw, BoxPtr extents)
+			 PixmapPtr src_pix, BoxPtr extents)
 {
     drmmode_crtc_private_ptr drmmode_crtc = xf86_crtc->driver_private;
     RegionRec region = { .extents = *extents, .data = NULL };
@@ -937,10 +937,9 @@ radeon_scanout_do_update(xf86CrtcPtr xf86_crtc, int scanout_id,
 	PictFormatPtr format = PictureWindowFormat(pScreen->root);
 	int error;
 	PicturePtr src, dst;
-	XID include_inferiors = IncludeInferiors;
 
-	src = CreatePicture(None, src_draw, format, CPSubwindowMode,
-			    &include_inferiors, serverClient, &error);
+	src = CreatePicture(None, &src_pix->drawable, format, 0L, NULL,
+			    serverClient, &error);
 	if (!src) {
 	    ErrorF("Failed to create source picture for transformed scanout "
 		   "update\n");
@@ -984,7 +983,7 @@ radeon_scanout_do_update(xf86CrtcPtr xf86_crtc, int scanout_id,
 	GCPtr gc = GetScratchGC(pDraw->depth, pScreen);
 
 	ValidateGC(pDraw, gc);
-	(*gc->ops->CopyArea)(src_draw, pDraw, gc,
+	(*gc->ops->CopyArea)(&src_pix->drawable, pDraw, gc,
 			     xf86_crtc->x + extents->x1, xf86_crtc->y + extents->y1,
 			     extents->x2 - extents->x1, extents->y2 - extents->y1,
 			     extents->x1, extents->y1);
@@ -1018,7 +1017,7 @@ radeon_scanout_update_handler(xf86CrtcPtr crtc, uint32_t frame, uint64_t usec,
 	!drmmode_crtc->flip_pending &&
 	drmmode_crtc->dpms_mode == DPMSModeOn) {
 	if (radeon_scanout_do_update(crtc, drmmode_crtc->scanout_id,
-				     &screen->GetWindowPixmap(screen->root)->drawable,
+				     screen->GetWindowPixmap(screen->root),
 				     &region->extents))
 	    RegionEmpty(region);
     }
@@ -1099,7 +1098,7 @@ radeon_scanout_flip(ScreenPtr pScreen, RADEONInfoPtr info,
 
     scanout_id = drmmode_crtc->scanout_id ^ 1;
     if (!radeon_scanout_do_update(xf86_crtc, scanout_id,
-				  &pScreen->GetWindowPixmap(pScreen->root)->drawable,
+				  pScreen->GetWindowPixmap(pScreen->root),
 				  &region->extents))
 	return;
     RegionEmpty(region);
Signature · 6 lines
2.14.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20170817072308.19111-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org

Reviewed-by Alex Deucher
#2 lore raw
Quoted 8 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Michel Dänzer
Sent: Thursday, August 17, 2017 3:23 AM
To: [email protected]
Subject: [PATCH xf86-video-ati] Make radeon_scanout_do_update take a PixmapPtr instead of a DrawablePtr

Quoted 7 lines

From: Michel Dänzer <[email protected]>

All callers were already passing in a pixmap.

This allows simplifying the rotated scanout case slightly.

Quoted 119 lines
---
 src/drmmode_display.c |  6 +++---
 src/radeon.h          |  2 +-
 src/radeon_kms.c      | 13 ++++++-------
 3 files changed, 10 insertions(+), 11 deletions(-)
src/drmmode_display.c +1 -1
index 90588671d..4839b415c 100644
@@ -842,7 +842,7 @@ drmmode_crtc_scanout_update(xf86CrtcPtr crtc,
 DisplayModePtr mode,
 		*x = *y = 0;
 
 		radeon_scanout_do_update(crtc, scanout_id,
-					 &screen-
 >GetWindowPixmap(screen->root)->drawable,
+					 screen->GetWindowPixmap(screen-
 >root),
src/drmmode_display.c +2 -2
 					 box);
 		radeon_bo_wait(drmmode_crtc->scanout[scanout_id].bo);
 	}
@@ -3050,8 +3050,8 @@ Bool radeon_do_pageflip(ScrnInfoPtr scrn,
 ClientPtr client,
 				goto error;
 			}
 
-			radeon_scanout_do_update(crtc, scanout_id,
-						 &new_front->drawable,
 &extents);
+			radeon_scanout_do_update(crtc, scanout_id,
 new_front,
+						 &extents);

drmmode_crtc_wait_pending_event(drmmode_crtc, pRADEONEnt-

Quoted 1 line

fd,

drmmode_crtc-

Quoted 1 line

scanout_update_pending);

src/radeon.h +1 -1
index bba344340..71123c7c7 100644
@@ -665,7 +665,7 @@ Bool radeon_dri3_screen_init(ScreenPtr screen);
 
 /* radeon_kms.c */
 Bool radeon_scanout_do_update(xf86CrtcPtr xf86_crtc, int scanout_id,
-			      DrawablePtr src_draw, BoxPtr extents);
+			      PixmapPtr src_pix, BoxPtr extents);
 void RADEONWindowExposures_oneshot(WindowPtr pWin, RegionPtr

pRegion
#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1,16,99,901,0)

src/radeon.h +0 -0
 				   , RegionPtr pBSRegion
src/radeon_kms.c +3 -4
index 4c001a31f..ca2d36d04 100644
@@ -904,7 +904,7 @@ radeon_dirty_update(ScrnInfoPtr scrn)
 
 Bool
 radeon_scanout_do_update(xf86CrtcPtr xf86_crtc, int scanout_id,
-			 DrawablePtr src_draw, BoxPtr extents)
+			 PixmapPtr src_pix, BoxPtr extents)
 {
     drmmode_crtc_private_ptr drmmode_crtc = xf86_crtc->driver_private;
     RegionRec region = { .extents = *extents, .data = NULL };
@@ -937,10 +937,9 @@ radeon_scanout_do_update(xf86CrtcPtr xf86_crtc,
 int scanout_id,
 	PictFormatPtr format = PictureWindowFormat(pScreen->root);
 	int error;
 	PicturePtr src, dst;
-	XID include_inferiors = IncludeInferiors;
 
-	src = CreatePicture(None, src_draw, format, CPSubwindowMode,
-			    &include_inferiors, serverClient, &error);
+	src = CreatePicture(None, &src_pix->drawable, format, 0L, NULL,
+			    serverClient, &error);
 	if (!src) {
 	    ErrorF("Failed to create source picture for transformed scanout "
src/radeon_kms.c +1 -1
 		   "update\n");
@@ -984,7 +983,7 @@ radeon_scanout_do_update(xf86CrtcPtr xf86_crtc,
 int scanout_id,
 	GCPtr gc = GetScratchGC(pDraw->depth, pScreen);
 
 	ValidateGC(pDraw, gc);
-	(*gc->ops->CopyArea)(src_draw, pDraw, gc,
+	(*gc->ops->CopyArea)(&src_pix->drawable, pDraw, gc,
 			     xf86_crtc->x + extents->x1, xf86_crtc->y +
 extents->y1,

extents->x2 - extents->x1, extents->y2 - extents-

Quoted 1 line

y1,

src/radeon_kms.c +1 -1
 			     extents->x1, extents->y1);
@@ -1018,7 +1017,7 @@ radeon_scanout_update_handler(xf86CrtcPtr crtc,
 uint32_t frame, uint64_t usec,
 	!drmmode_crtc->flip_pending &&
 	drmmode_crtc->dpms_mode == DPMSModeOn) {
 	if (radeon_scanout_do_update(crtc, drmmode_crtc->scanout_id,
-				     &screen->GetWindowPixmap(screen-
 >root)->drawable,
+				     screen->GetWindowPixmap(screen-
 >root),
src/radeon_kms.c +1 -1
 				     &region->extents))
 	    RegionEmpty(region);
     }
@@ -1099,7 +1098,7 @@ radeon_scanout_flip(ScreenPtr pScreen,
 RADEONInfoPtr info,
 
     scanout_id = drmmode_crtc->scanout_id ^ 1;
     if (!radeon_scanout_do_update(xf86_crtc, scanout_id,
-				  &pScreen->GetWindowPixmap(pScreen-
 >root)->drawable,
+				  pScreen->GetWindowPixmap(pScreen-
 >root),
src/radeon_kms.c +0 -1
 				  &region->extents))
 	return;
     RegionEmpty(region);
--

2.14.1

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx