summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLucas Stach <[email protected]>2017-06-23 17:36:37 +0200
committerDaniel Stone <[email protected]>2017-06-24 16:57:55 +0100
commitd6b9ba36a487f3f4dfdc20fc1106532372eb0978 (patch)
treef369960f048ec353a42b9c6211643b9e79f33c0d /src
parentcb577e379e20d70d62821c0ca2f1cb77c7b6790e (diff)
st/dri2: implement image offset query
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 <[email protected]> Reviewed-by: Daniel Stone <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/state_trackers/dri/dri2.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/dri/dri2.c b/src/gallium/state_trackers/dri/dri2.c
index 2402c61bd85..60ec38d8e44 100644
--- a/src/gallium/state_trackers/dri/dri2.c
+++ b/src/gallium/state_trackers/dri/dri2.c
@@ -1179,6 +1179,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,