Mesa (master): Revert remaining half of "gallium/dri2: Pass the resource that corresponds to the plane"
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Apr 13 16:53:42 UTC 2021
Module: Mesa
Branch: master
Commit: 07546c69b0b23feeab532a903f4bd1f7b1caa019
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=07546c69b0b23feeab532a903f4bd1f7b1caa019
Author: Lucas Stach <l.stach at pengutronix.de>
Date: Tue Apr 13 16:42:57 2021 +0200
Revert remaining half of "gallium/dri2: Pass the resource that corresponds to the plane"
As documented in 6ec7e0d40664 (gallium: document convention for get_handle
calls on multi-planar resources) it's the drivers responsibility to walk
the chain of resources for multi-planar resources. The get_handle interface
should always be called with the base resource by the frontend.
Signed-off-by: Lucas Stach <l.stach at pengutronix.de>
Acked-by: Simon Ser <contact at emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10212>
---
src/gallium/frontends/dri/dri2.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/src/gallium/frontends/dri/dri2.c b/src/gallium/frontends/dri/dri2.c
index 781ddcb6c6f..59698719978 100644
--- a/src/gallium/frontends/dri/dri2.c
+++ b/src/gallium/frontends/dri/dri2.c
@@ -1167,12 +1167,8 @@ dri2_query_image_by_resource_handle(__DRIimage *image, int attrib, int *value)
if (image->use & __DRI_IMAGE_USE_BACKBUFFER)
usage |= PIPE_HANDLE_USAGE_EXPLICIT_FLUSH;
- for (i = 0, tex = image->texture; tex; i++, tex = tex->next)
- if (i == image->plane)
- break;
- assert(tex);
-
- if (!pscreen->resource_get_handle(pscreen, NULL, tex, &whandle, usage))
+ if (!pscreen->resource_get_handle(pscreen, NULL, image->texture,
+ &whandle, usage))
return false;
switch (attrib) {
More information about the mesa-commit
mailing list