diff options
author | Mike Blumenkrantz <michael.blumenkrantz@gmail.com> | 2023-07-10 14:30:39 -0400 |
---|---|---|
committer | Eric Engestrom <eric@engestrom.ch> | 2023-07-28 18:48:24 +0100 |
commit | f77250791c736126a64eac31d8ad6578f5680192 (patch) | |
tree | 8185371b04619d6ff9837511fd55db7fc9a7458e /src | |
parent | 5c0ba833622241c3c5b7f4e3fb10cbad106cef4d (diff) | |
download | mesa-f77250791c736126a64eac31d8ad6578f5680192.tar.gz mesa-f77250791c736126a64eac31d8ad6578f5680192.tar.bz2 mesa-f77250791c736126a64eac31d8ad6578f5680192.zip |
kopper: handle pixmap creation failure more gracefully
cc: mesa-stable
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24075>
(cherry picked from commit 2b71e645bc71f69287ba47008763e47ca0318702)
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/frontends/dri/kopper.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gallium/frontends/dri/kopper.c b/src/gallium/frontends/dri/kopper.c index 637b25d3539..4a46130a984 100644 --- a/src/gallium/frontends/dri/kopper.c +++ b/src/gallium/frontends/dri/kopper.c @@ -413,6 +413,8 @@ kopper_get_pixmap_buffer(struct dri_drawable *drawable, dri3_create_image_from_buffers(conn, bps_reply, format, screen, &driVkImageExtension, drawable); + if (!drawable->image) + return NULL; width = bps_reply->width; height = bps_reply->height; free(bps_reply); @@ -433,6 +435,8 @@ kopper_get_pixmap_buffer(struct dri_drawable *drawable, drawable->image = dri3_create_image(conn, bp_reply, format, screen, &driVkImageExtension, drawable); + if (!drawable->image) + return NULL; width = bp_reply->width; height = bp_reply->height; free(bp_reply); @@ -597,13 +601,13 @@ XXX do this once swapinterval is hooked up #ifdef VK_USE_PLATFORM_XCB_KHR else if (is_pixmap && statts[i] == ST_ATTACHMENT_FRONT_LEFT && !screen->is_sw) { drawable->textures[statts[i]] = kopper_get_pixmap_buffer(drawable, format); - handle_in_fence(ctx, drawable->image); + if (drawable->textures[statts[i]]) + handle_in_fence(ctx, drawable->image); } #endif - else { + if (!drawable->textures[statts[i]]) drawable->textures[statts[i]] = screen->base.screen->resource_create(screen->base.screen, &templ); - } } if (drawable->stvis.samples > 1 && !drawable->msaa_textures[statts[i]]) { templ.bind = bind & |