summaryrefslogtreecommitdiff
path: root/src/radeon_dri3.c
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2015-03-18 12:56:07 +0900
committerMichel Dänzer <michel@daenzer.net>2015-03-25 18:29:40 +0900
commit391900a670addec39515f924265bfa9f8bfa9ec0 (patch)
tree66cc9fa6a63a476f3ea8e09e699b0416dbed4f25 /src/radeon_dri3.c
parentdfad91fffb5bd013785223b42d78886df839eacf (diff)
glamor: Avoid generating GEM flink names for BOs shared via DRI3 v2
We can't create our own struct radeon_bo representation in this case because destroying that would make the GEM handle inaccessible to glamor as well. So just get the handle directly via dma-buf. v2: Close dma-buf file descriptor, pointed out by Axel Davy. Reviewed-by: Axel Davy <axel.davy@ens.fr> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src/radeon_dri3.c')
-rw-r--r--src/radeon_dri3.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/radeon_dri3.c b/src/radeon_dri3.c
index 993c7a77..3a7322e5 100644
--- a/src/radeon_dri3.c
+++ b/src/radeon_dri3.c
@@ -96,6 +96,16 @@ static PixmapPtr radeon_dri3_pixmap_from_fd(ScreenPtr screen,
{
PixmapPtr pixmap;
+#ifdef USE_GLAMOR
+ /* Avoid generating a GEM flink name if possible */
+ if (RADEONPTR(xf86ScreenToScrn(screen))->use_glamor) {
+ pixmap = glamor_pixmap_from_fd(screen, fd, width, height,
+ stride, depth, bpp);
+ if (pixmap)
+ return pixmap;
+ }
+#endif
+
if (depth < 8)
return NULL;