On 21 July 2017 at 14:34, Daniel Stone <dani...@collabora.com> wrote: > Always initialise whandle.modifier for DRIImage modifier queries, so if > the driver doesn't support it then we return DRM_FORMAT_MOD_INVALID. > > Signed-off-by: Daniel Stone <dani...@collabora.com> > Cc: Varad Gautam <varad.gau...@collabora.com> > Fixes: d33fe8b84e45 ("st/dri: enable DRIimage modifier queries") > --- > src/gallium/state_trackers/dri/dri2.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/src/gallium/state_trackers/dri/dri2.c > b/src/gallium/state_trackers/dri/dri2.c > index 19ee5f495e..66643c6727 100644 > --- a/src/gallium/state_trackers/dri/dri2.c > +++ b/src/gallium/state_trackers/dri/dri2.c > @@ -1235,12 +1235,14 @@ dri2_query_image(__DRIimage *image, int attrib, int > *value) > return GL_TRUE; > case __DRI_IMAGE_ATTRIB_MODIFIER_UPPER: > whandle.type = DRM_API_HANDLE_TYPE_KMS; > + whandle.modifier = DRM_FORMAT_MOD_INVALID; > image->texture->screen->resource_get_handle(image->texture->screen, > NULL, image->texture, &whandle, usage); > *value = (whandle.modifier >> 32) & 0xffffffff; > return GL_TRUE; > case __DRI_IMAGE_ATTRIB_MODIFIER_LOWER: > whandle.type = DRM_API_HANDLE_TYPE_KMS; > + whandle.modifier = DRM_FORMAT_MOD_INVALID; > image->texture->screen->resource_get_handle(image->texture->screen, > NULL, image->texture, &whandle, usage); > *value = whandle.modifier & 0xffffffff; I think the key issue is that the resource_get_handle() calls lack proper error handling.
There's a single case, that was fixed not too long ago, yet everywhere else we consider that resource_get_handle() can fail. Can we address that instead? Only dri2_query_image seems to be buggy. Thanks Emil _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev