[Mesa-dev] [PATCH 13/15] gallium/dri: Handle prime fds in __DRIBuffers

Christopher James Halse Rogers christopher.halse.rogers at canonical.com
Sat Jul 20 04:40:45 PDT 2013


---
 src/gallium/state_trackers/dri/drm/dri2.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/gallium/state_trackers/dri/drm/dri2.c b/src/gallium/state_trackers/dri/drm/dri2.c
index edbf801..f5e8bec 100644
--- a/src/gallium/state_trackers/dri/drm/dri2.c
+++ b/src/gallium/state_trackers/dri/drm/dri2.c
@@ -263,8 +263,13 @@ dri2_drawable_process_buffers(struct dri_drawable *drawable,
 
       templ.format = format;
       templ.bind = bind;
-      whandle.type = DRM_API_HANDLE_TYPE_SHARED;
-      whandle.handle = buf->name;
+      if (buf->name != 0) {
+         whandle.type = DRM_API_HANDLE_TYPE_SHARED;
+         whandle.handle = buf->name;
+      } else {
+         whandle.type = DRM_API_HANDLE_TYPE_FD;
+         whandle.handle = buf->fd;
+      }
       whandle.stride = buf->pitch;
 
       drawable->textures[statt] =
-- 
1.8.3.2



More information about the mesa-dev mailing list