[Mesa-dev] [PATCH v2 2/2] st/dri2: Return invalid modifier when no driver support

Marek Olšák maraeo at gmail.com
Tue Jul 25 16:43:52 UTC 2017


For the series:

Reviewed-by: Marek Olšák <marek.olsak at amd.com>

Marek

On Mon, Jul 24, 2017 at 5:46 PM, Daniel Stone <daniels at collabora.com> wrote:
> Always initialise whandle.modifier for DRIImage modifier queries, so if
> the driver doesn't support it then we return false for the query.
>
> Signed-off-by: Daniel Stone <daniels at collabora.com>
> Cc: Varad Gautam <varad.gautam at collabora.com>
> Fixes: d33fe8b84e45 ("st/dri: enable DRIimage modifier queries")
> ---
>  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 151fa5312a..688db8835b 100644
> --- a/src/gallium/state_trackers/dri/dri2.c
> +++ b/src/gallium/state_trackers/dri/dri2.c
> @@ -1239,14 +1239,20 @@ 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;
>        if (!image->texture->screen->resource_get_handle(image->texture->screen,
>              NULL, image->texture, &whandle, usage))
> +      if (whandle.modifier == DRM_FORMAT_MOD_INVALID)
> +         return GL_FALSE;
>        *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;
>        if (!image->texture->screen->resource_get_handle(image->texture->screen,
>              NULL, image->texture, &whandle, usage))
> +      if (whandle.modifier == DRM_FORMAT_MOD_INVALID)
> +         return GL_FALSE;
>        *value = whandle.modifier & 0xffffffff;
>        return GL_TRUE;
>     default:
> --
> 2.13.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list