summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/amdgpu_drv.h3
-rw-r--r--src/amdgpu_kms.c18
-rw-r--r--src/drmmode_display.c3
3 files changed, 13 insertions, 11 deletions
diff --git a/src/amdgpu_drv.h b/src/amdgpu_drv.h
index da71ce8..515d466 100644
--- a/src/amdgpu_drv.h
+++ b/src/amdgpu_drv.h
@@ -340,7 +340,8 @@ typedef struct {
Bool amdgpu_dri3_screen_init(ScreenPtr screen);
/* amdgpu_kms.c */
-Bool amdgpu_scanout_do_update(xf86CrtcPtr xf86_crtc, int scanout_id);
+Bool amdgpu_scanout_do_update(xf86CrtcPtr xf86_crtc, int scanout_id,
+ DrawablePtr src_draw);
void AMDGPUWindowExposures_oneshot(WindowPtr pWin, RegionPtr pRegion
#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1,16,99,901,0)
, RegionPtr pBSRegion
diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
index d8f667d..230a779 100644
--- a/src/amdgpu_kms.c
+++ b/src/amdgpu_kms.c
@@ -792,7 +792,8 @@ amdgpu_dirty_update(ScrnInfoPtr scrn)
#endif
Bool
-amdgpu_scanout_do_update(xf86CrtcPtr xf86_crtc, int scanout_id)
+amdgpu_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);
@@ -827,10 +828,7 @@ amdgpu_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 "
@@ -874,8 +872,7 @@ amdgpu_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);
@@ -900,8 +897,10 @@ amdgpu_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;
- amdgpu_scanout_do_update(crtc, drmmode_crtc->scanout_id);
+ amdgpu_scanout_do_update(crtc, drmmode_crtc->scanout_id,
+ &screen->GetWindowPixmap(screen->root)->drawable);
amdgpu_scanout_update_abort(crtc, event_data);
}
@@ -988,7 +987,8 @@ amdgpu_scanout_flip(ScreenPtr pScreen, AMDGPUInfoPtr info,
return;
scanout_id = drmmode_crtc->scanout_id ^ 1;
- if (!amdgpu_scanout_do_update(xf86_crtc, scanout_id))
+ if (!amdgpu_scanout_do_update(xf86_crtc, scanout_id,
+ &pScreen->GetWindowPixmap(pScreen->root)->drawable))
return;
drm_queue_seq = amdgpu_drm_queue_alloc(xf86_crtc,
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index eb701a8..972a6f2 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -770,7 +770,8 @@ drmmode_crtc_scanout_update(xf86CrtcPtr crtc, DisplayModePtr mode,
*fb = amdgpu_pixmap_get_fb(drmmode_crtc->scanout[scanout_id].pixmap);
*x = *y = 0;
- amdgpu_scanout_do_update(crtc, scanout_id);
+ amdgpu_scanout_do_update(crtc, scanout_id,
+ &screen->GetWindowPixmap(screen->root)->drawable);
amdgpu_glamor_finish(scrn);
}
}