From: Lucas Stach Date: Fri, 23 Jun 2017 15:36:37 +0000 (+0200) Subject: st/dri2: implement image offset query X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d6b9ba36a487f3f4dfdc20fc1106532372eb0978;p=mesa.git 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 Reviewed-by: Daniel Stone --- 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,