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 <l.stach@pengutronix.de>
Reviewed-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
Lucas Stach 2017-06-23 17:36:37 +02:00 committed by Daniel Stone
parent cb577e379e
commit d6b9ba36a4

View file

@ -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,