All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH xf86-video-amdgpu] Use correct ScrnInfoPtr in redisplay_dirty
@ 2017-11-08 17:47 Michel Dänzer
       [not found] ` <20171108174725.20180-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Michel Dänzer @ 2017-11-08 17:47 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

From: Michel Dänzer <michel.daenzer@amd.com>

We used the destination pixmap's screen for flushing glamor. But when
we are the master screen, the destination pixmap is from the slave
screen.

Fixes crash when the slave screen isn't using glamor as well.

Bugzilla: https://bugs.freedesktop.org/103613
Fixes: e15b23663cd1 ("Adapt to PixmapDirtyUpdateRec::src being a
                     DrawablePtr")
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
---
 src/amdgpu_kms.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
index cb0fb3b57..a5f2040a8 100644
--- a/src/amdgpu_kms.c
+++ b/src/amdgpu_kms.c
@@ -479,7 +479,11 @@ dirty_region(PixmapDirtyUpdatePtr dirty)
 static void
 redisplay_dirty(PixmapDirtyUpdatePtr dirty, RegionPtr region)
 {
-	ScrnInfoPtr scrn = 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;
@@ -493,7 +497,7 @@ redisplay_dirty(PixmapDirtyUpdatePtr dirty, RegionPtr region)
 	PixmapSyncDirtyHelper(dirty, region);
 #endif
 
-	amdgpu_glamor_flush(scrn);
+	amdgpu_glamor_flush(src_scrn);
 	if (dirty->slave_dst->master_pixmap)
 		DamageRegionProcessPending(&dirty->slave_dst->drawable);
 
-- 
2.15.0

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* RE: [PATCH xf86-video-amdgpu] Use correct ScrnInfoPtr in redisplay_dirty
       [not found] ` <20171108174725.20180-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
@ 2017-11-08 18:20   ` Deucher, Alexander
  0 siblings, 0 replies; 2+ messages in thread
From: Deucher, Alexander @ 2017-11-08 18:20 UTC (permalink / raw)
  To: 'Michel Dänzer', amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

> -----Original Message-----
> From: amd-gfx [mailto:amd-gfx-bounces@lists.freedesktop.org] On Behalf
> Of Michel Dänzer
> Sent: Wednesday, November 08, 2017 12:47 PM
> To: amd-gfx@lists.freedesktop.org
> Subject: [PATCH xf86-video-amdgpu] Use correct ScrnInfoPtr in
> redisplay_dirty
> 
> From: Michel Dänzer <michel.daenzer@amd.com>
> 
> We used the destination pixmap's screen for flushing glamor. But when
> we are the master screen, the destination pixmap is from the slave
> screen.
> 
> Fixes crash when the slave screen isn't using glamor as well.
> 
> Bugzilla: https://bugs.freedesktop.org/103613
> Fixes: e15b23663cd1 ("Adapt to PixmapDirtyUpdateRec::src being a
>                      DrawablePtr")
> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>


> ---
>  src/amdgpu_kms.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
> index cb0fb3b57..a5f2040a8 100644
> --- a/src/amdgpu_kms.c
> +++ b/src/amdgpu_kms.c
> @@ -479,7 +479,11 @@ dirty_region(PixmapDirtyUpdatePtr dirty)
>  static void
>  redisplay_dirty(PixmapDirtyUpdatePtr dirty, RegionPtr region)
>  {
> -	ScrnInfoPtr scrn = 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;
> @@ -493,7 +497,7 @@ redisplay_dirty(PixmapDirtyUpdatePtr dirty,
> RegionPtr region)
>  	PixmapSyncDirtyHelper(dirty, region);
>  #endif
> 
> -	amdgpu_glamor_flush(scrn);
> +	amdgpu_glamor_flush(src_scrn);
>  	if (dirty->slave_dst->master_pixmap)
>  		DamageRegionProcessPending(&dirty->slave_dst-
> >drawable);
> 
> --
> 2.15.0
> 
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-11-08 18:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-08 17:47 [PATCH xf86-video-amdgpu] Use correct ScrnInfoPtr in redisplay_dirty Michel Dänzer
     [not found] ` <20171108174725.20180-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
2017-11-08 18:20   ` Deucher, Alexander

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.