iris: Don't leak the surface if uncompressed re-interp fails

Fixes: a032a9665f "iris: Enable PIPE_CAP_SURFACE_REINTERPRET_BLOCKS"
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11647>
(cherry picked from commit 98faa09bb5)
This commit is contained in:
Jason Ekstrand 2021-06-28 19:11:46 -05:00 committed by Eric Engestrom
parent f7e63ad13e
commit b61449f334
2 changed files with 4 additions and 2 deletions

View file

@ -2488,7 +2488,7 @@
"description": "iris: Don't leak the surface if uncompressed re-interp fails",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "a032a9665f275085c825b54b62128ae90adba1c6"
},

View file

@ -2668,8 +2668,10 @@ iris_create_surface(struct pipe_context *ctx,
*
* Return NULL to force gallium frontends to take fallback paths.
*/
if (view->array_len > 1 || GFX_VER == 8)
if (view->array_len > 1 || GFX_VER == 8) {
free(surf);
return NULL;
}
const bool is_3d = res->surf.dim == ISL_SURF_DIM_3D;
isl_surf_get_image_surf(&screen->isl_dev, &res->surf,