summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2017-11-15 18:01:29 +0100
committerMichel Dänzer <michel.daenzer@amd.com>2017-11-15 18:01:29 +0100
commit15350bd5538c21cd4c6b406d565ca765b7e0218a (patch)
treecdd9ad1c8c7fad916a18c539fda94d4d8b16c589
parent6441210bc53978a2c46c572e9174215b14f9e813 (diff)
Use correct ScrnInfoPtr in redisplay_dirty
We used the destination pixmap's screen for flushing drawing commands. But when we are the master screen, the destination pixmap is from the slave screen. Fixes crash when the slave screen isn't using the same acceleration architecture as us. Bugzilla: https://bugs.freedesktop.org/103613 Fixes: 01b040b4a807 ("Adapt to PixmapDirtyUpdateRec::src being a DrawablePtr") (Ported from amdgpu commit 3a4f7422913093ed9e26b73ecd7f9e773478cb1e) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--src/radeon_kms.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/radeon_kms.c b/src/radeon_kms.c
index 06c8a47f..5fcd8f0b 100644
--- a/src/radeon_kms.c
+++ b/src/radeon_kms.c
@@ -570,7 +570,11 @@ dirty_region(PixmapDirtyUpdatePtr dirty)
static void
redisplay_dirty(PixmapDirtyUpdatePtr dirty, RegionPtr region)
{
- ScrnInfoPtr pScrn = xf86ScreenToScrn(dirty->slave_dst->drawable.pScreen);
+#ifdef HAS_DIRTYTRACKING_DRAWABLE_SRC
+ ScrnInfoPtr src_scrn = xf86ScreenToScrn(dirty->src->pScreen);
+#else
+ ScrnInfoPtr src_scrn = xf86ScreenToScrn(dirty->src->drawable.pScreen);
+#endif
if (RegionNil(region))
goto out;
@@ -584,7 +588,7 @@ redisplay_dirty(PixmapDirtyUpdatePtr dirty, RegionPtr region)
PixmapSyncDirtyHelper(dirty, region);
#endif
- radeon_cs_flush_indirect(pScrn);
+ radeon_cs_flush_indirect(src_scrn);
if (dirty->slave_dst->master_pixmap)
DamageRegionProcessPending(&dirty->slave_dst->drawable);