Skip to contentSkip to conversation

Use correct ScrnInfoPtr in redisplay_dirty

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

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Use correct ScrnInfoPtr in redisplay_dirty

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

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)

---
 src/radeon_kms.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
src/radeon_kms.c +6 -2
index 06c8a47fb..5fcd8f0b7 100644
@@ -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);
 
Signature · 6 lines
2.15.0

_______________________________________________
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): 20171115170943.9442-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org

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

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Michel Dänzer
Sent: Wednesday, November 15, 2017 12:10 PM
To: [email protected]
Subject: [PATCH xf86-video-ati] Use correct ScrnInfoPtr in redisplay_dirty

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

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.

Quoted 7 lines

Bugzilla: https://bugs.freedesktop.org/103613

Fixes 01b040b4a807 ("Adapt to PixmapDirtyUpdateRec::src being a

DrawablePtr")
(Ported from amdgpu commit
3a4f7422913093ed9e26b73ecd7f9e773478cb1e)

Quoted 36 lines
---
 src/radeon_kms.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
src/radeon_kms.c +5 -1
index 06c8a47fb..5fcd8f0b7 100644
@@ -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
 
src/radeon_kms.c +1 -2
 	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);
 
--

2.15.0

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