[Mesa-dev] [PATCH 2/6] st/dri: fix dri2_query_image for multiplanar images
Eric Anholt
eric at anholt.net
Fri Apr 19 18:19:51 UTC 2019
Lucas Stach <l.stach at pengutronix.de> writes:
> From: Philipp Zabel <p.zabel at pengutronix.de>
>
> Images with multiple planes in separate chained texture resources should
> report the correct number of planes.
>
> Signed-off-by: Philipp Zabel <p.zabel at pengutronix.de>
> ---
> src/gallium/state_trackers/dri/dri2.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/src/gallium/state_trackers/dri/dri2.c b/src/gallium/state_trackers/dri/dri2.c
> index 510b7f8d04a7..4c8ea485cc70 100644
> --- a/src/gallium/state_trackers/dri/dri2.c
> +++ b/src/gallium/state_trackers/dri/dri2.c
> @@ -1083,7 +1083,9 @@ static GLboolean
> dri2_query_image(__DRIimage *image, int attrib, int *value)
> {
> struct winsys_handle whandle;
> + struct pipe_resource *tex;
> unsigned usage;
> + int i;
>
> if (image->use & __DRI_IMAGE_USE_BACKBUFFER)
> usage = PIPE_HANDLE_USAGE_EXPLICIT_FLUSH;
> @@ -1157,7 +1159,9 @@ dri2_query_image(__DRIimage *image, int attrib, int *value)
> }
> return GL_TRUE;
> case __DRI_IMAGE_ATTRIB_NUM_PLANES:
> - *value = 1;
> + for (i = 0, tex = image->texture; i < 4 && tex; tex = tex->next)
> + i++;
> + *value = i;
> return GL_TRUE;
What's the "< 4" limit for? Other than that, patch 1-2 are:
Reviewed-by: Eric Anholt <eric at anholt.net>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20190419/266fb362/attachment.sig>
More information about the mesa-dev
mailing list