gallium/winsys/drm: Prepare for passing prime fds in winsys_handle
[mesa.git] / src / gallium / winsys / i915 / drm / i915_drm_buffer.c
index ac66af333dfd84000171d16bdd3fc5d6851ac131..38e06193c61f3b82079e76d07f2c62afcd995612 100644 (file)
@@ -95,9 +95,13 @@ i915_drm_buffer_from_handle(struct i915_winsys *iws,
                             unsigned *stride)
 {
    struct i915_drm_winsys *idws = i915_drm_winsys(iws);
-   struct i915_drm_buffer *buf = CALLOC_STRUCT(i915_drm_buffer);
+   struct i915_drm_buffer *buf;
    uint32_t tile = 0, swizzle = 0;
 
+   if (whandle->type != DRM_API_HANDLE_TYPE_SHARED)
+      return NULL;
+
+   buf = CALLOC_STRUCT(i915_drm_buffer);
    if (!buf)
       return NULL;