summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2017-02-07 18:58:23 +0900
committerMichel Dänzer <michel@daenzer.net>2017-08-17 15:49:01 +0900
commit1443270e52e8562bd8dc3603f301963bd4027cef (patch)
treeb10642a12953162837bc1a82903bb8666799aaac
parent7c10ee9c88378d773c0bcf651fdc5d9f2c6dc5e5 (diff)
Add source drawable parameter to radeon_scanout_do_update
Preparation for following changes, no functional change intended yet. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--src/drmmode_display.c3
-rw-r--r--src/radeon.h3
-rw-r--r--src/radeon_kms.c18
3 files changed, 13 insertions, 11 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index d86c4ba9..35b706e0 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -833,7 +833,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 b93e2816..864fe7c3 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 977504d9..5f02a487 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,