Mesa (main): crocus: fail resource allocation properly.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Dec 30 04:11:05 UTC 2021


Module: Mesa
Branch: main
Commit: d8a38edc48e5567e5f0205b7347761e3d05a4bda
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d8a38edc48e5567e5f0205b7347761e3d05a4bda

Author: Dave Airlie <airlied at redhat.com>
Date:   Wed Dec 29 17:32:12 2021 +1000

crocus: fail resource allocation properly.

Older gens have a limit of 2GB on surfaces, this results in
isl_surf_init_s failing if the surface exceeds that, in this
case this should fail all the way back up the stack.

This fixes some cases of max-texture-size on crocus

Fixes: f3630548f1da ("crocus: initial gallium driver for Intel gfx 4-7")

Reviewed-by: Emma Anholt <emma at anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14347>

---

 src/gallium/drivers/crocus/crocus_resource.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/crocus/crocus_resource.c b/src/gallium/drivers/crocus/crocus_resource.c
index 4962be3f650..9d4336d3317 100644
--- a/src/gallium/drivers/crocus/crocus_resource.c
+++ b/src/gallium/drivers/crocus/crocus_resource.c
@@ -688,9 +688,10 @@ crocus_resource_create_with_modifiers(struct pipe_screen *pscreen,
        devinfo->ver < 6)
       return NULL;
 
-   UNUSED const bool isl_surf_created_successfully =
+   const bool isl_surf_created_successfully =
       crocus_resource_configure_main(screen, res, templ, modifier, 0);
-   assert(isl_surf_created_successfully);
+   if (!isl_surf_created_successfully)
+      return NULL;
 
    const char *name = "miptree";
 



More information about the mesa-commit mailing list