[Mesa-dev] [PATCH] st/dri2: implement image offset query

Lucas Stach l.stach at pengutronix.de
Fri Jun 23 15:36:37 UTC 2017


This trivially adds support for the image offset query, which is needed
for the zwp_linux_dmabuf based EGL platform wayland implementation.

Signed-off-by: Lucas Stach <l.stach at pengutronix.de>
---
 src/gallium/state_trackers/dri/dri2.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/gallium/state_trackers/dri/dri2.c b/src/gallium/state_trackers/dri/dri2.c
index 3119a396ce29..b517b9ca8ebb 100644
--- a/src/gallium/state_trackers/dri/dri2.c
+++ b/src/gallium/state_trackers/dri/dri2.c
@@ -1186,6 +1186,12 @@ dri2_query_image(__DRIimage *image, int attrib, int *value)
             NULL, image->texture, &whandle, usage);
       *value = whandle.stride;
       return GL_TRUE;
+   case __DRI_IMAGE_ATTRIB_OFFSET:
+      whandle.type = DRM_API_HANDLE_TYPE_KMS;
+      image->texture->screen->resource_get_handle(image->texture->screen,
+            NULL, image->texture, &whandle, usage);
+      *value = whandle.offset;
+      return GL_TRUE;
    case __DRI_IMAGE_ATTRIB_HANDLE:
       whandle.type = DRM_API_HANDLE_TYPE_KMS;
       image->texture->screen->resource_get_handle(image->texture->screen,
-- 
2.11.0



More information about the mesa-dev mailing list