Mesa (master): Revert "gallium/dri: fix dri2_from_planar for multiplanar images"
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Nov 3 10:41:42 UTC 2020
Module: Mesa
Branch: master
Commit: 788f6dc85781c58b37c0d762085090d2d5d8d3d5
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=788f6dc85781c58b37c0d762085090d2d5d8d3d5
Author: Lucas Stach <l.stach at pengutronix.de>
Date: Sat Oct 31 08:21:15 2020 +0100
Revert "gallium/dri: fix dri2_from_planar for multiplanar images"
It breaks some assumptions in the iris driver, leading to crashes.
Signed-off-by: Lucas Stach <l.stach at pengutronix.de>
Tested-by: Jordan Justen <jordan.l.justen at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7391>
---
src/gallium/frontends/dri/dri2.c | 16 ++--------------
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/src/gallium/frontends/dri/dri2.c b/src/gallium/frontends/dri/dri2.c
index 2215fcf0172..6f98926b5db 100644
--- a/src/gallium/frontends/dri/dri2.c
+++ b/src/gallium/frontends/dri/dri2.c
@@ -1395,28 +1395,18 @@ static __DRIimage *
dri2_from_planar(__DRIimage *image, int plane, void *loaderPrivate)
{
__DRIimage *img;
- struct pipe_resource *tex = image->texture;
- int i;
if (plane < 0) {
return NULL;
} else if (plane > 0) {
uint64_t planes;
- if (dri2_resource_get_param(image, PIPE_RESOURCE_PARAM_NPLANES, 0,
- &planes) &&
+ if (!dri2_resource_get_param(image, PIPE_RESOURCE_PARAM_NPLANES, 0,
+ &planes) ||
plane >= planes) {
return NULL;
}
}
- if (tex->next) {
- for (i = 0; i < plane; i++) {
- tex = tex->next;
- if (!tex)
- return NULL;
- }
- }
-
if (image->dri_components == 0) {
uint64_t modifier;
if (!dri2_resource_get_param(image, PIPE_RESOURCE_PARAM_MODIFIER, 0,
@@ -1430,8 +1420,6 @@ dri2_from_planar(__DRIimage *image, int plane, void *loaderPrivate)
if (img == NULL)
return NULL;
- pipe_resource_reference(&img->texture, tex);
-
if (img->texture->screen->resource_changed)
img->texture->screen->resource_changed(img->texture->screen,
img->texture);
More information about the mesa-commit
mailing list