All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH xf86-video-ati 1/4] glamor: Fix radeon_glamor_share_pixmap_backing for priv->bo == NULL
@ 2016-09-13  8:55 Michel Dänzer
       [not found] ` <20160913085556.16189-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Michel Dänzer @ 2016-09-13  8:55 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

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

Fixes crash when running a compositor and DRI_PRIME client via DRI2.

Reported-by: Qiang Yu <qiang.yu@amd.com>
(Ported from amdgpu commit b36c77695ba77b59a0ccd868454e3af4fc04d5ff)

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
---
 src/radeon_glamor.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/radeon_glamor.c b/src/radeon_glamor.c
index f94e0fd..5c4191b 100644
--- a/src/radeon_glamor.c
+++ b/src/radeon_glamor.c
@@ -289,12 +289,17 @@ static Bool
 radeon_glamor_share_pixmap_backing(PixmapPtr pixmap, ScreenPtr slave,
 				   void **handle_p)
 {
-	struct radeon_pixmap *priv = radeon_get_pixmap_private(pixmap);
+	ScreenPtr screen = pixmap->drawable.pScreen;
+	CARD16 stride;
+	CARD32 size;
+	int fd;
 
-	if (!priv)
+	fd = glamor_fd_from_pixmap(screen, pixmap, &stride, &size);
+	if (fd < 0)
 		return FALSE;
 
-	return radeon_share_pixmap_backing(priv->bo, handle_p);
+	*handle_p = (void *)(long)fd;
+	return TRUE;
 }
 
 static Bool
-- 
2.9.3

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

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

end of thread, other threads:[~2016-09-13 14:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-13  8:55 [PATCH xf86-video-ati 1/4] glamor: Fix radeon_glamor_share_pixmap_backing for priv->bo == NULL Michel Dänzer
     [not found] ` <20160913085556.16189-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
2016-09-13  8:55   ` [PATCH xf86-video-ati 2/4] Consolidate get_drawable_pixmap helper Michel Dänzer
2016-09-13  8:55   ` [PATCH xf86-video-ati 3/4] Move DRI2's local fixup_glamor helper to radeon_glamor_set_pixmap_bo Michel Dänzer
2016-09-13  8:55   ` [PATCH xf86-video-ati 4/4] glamor: Reallocate linear pixmap BO if necessary for DRI2 PRIME Michel Dänzer
     [not found]     ` <20160913085556.16189-4-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
2016-09-13 14:22       ` Alex Deucher

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.