summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2017-08-02 19:03:40 +0900
committerMichel Dänzer <michel.daenzer@amd.com>2017-08-02 19:03:40 +0900
commit3e08409344a2fd504429522507592f98555bec05 (patch)
tree73626080e57bb5b90155bc031ca2f055d9b6aa02 /src
parent35106fc0a948957cbb7e1e9649c89993a3d5c95c (diff)
Use root window (pixmap) instead of screen pixmap for scanout updates
Preparation for following changes, no functional change intended yet. (Ported from radeon commit c2d26890691ec105858f086b63170ad94c6f7f05) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src')
-rw-r--r--src/amdgpu_kms.c2
-rw-r--r--src/drmmode_display.c21
2 files changed, 15 insertions, 8 deletions
diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
index 2355a89..c86f117 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 9b33d4d..8ddb2ac 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);
}