Module: Mesa Branch: staging/23.2 Commit: 4171bb1239544c287c728fd1974b126c51cc1cac URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=4171bb1239544c287c728fd1974b126c51cc1cac
Author: Mike Blumenkrantz <[email protected]> Date: Mon Jul 10 14:30:39 2023 -0400 kopper: handle pixmap creation failure more gracefully cc: mesa-stable Reviewed-by: Adam Jackson <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24075> (cherry picked from commit 2b71e645bc71f69287ba47008763e47ca0318702) --- .pick_status.json | 2 +- src/gallium/frontends/dri/kopper.c | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index dfc599d747a..8453a2d21bb 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -22994,7 +22994,7 @@ "description": "kopper: handle pixmap creation failure more gracefully", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/gallium/frontends/dri/kopper.c b/src/gallium/frontends/dri/kopper.c index 1ec3f6ca88a..514be0e3bcc 100644 --- a/src/gallium/frontends/dri/kopper.c +++ b/src/gallium/frontends/dri/kopper.c @@ -410,6 +410,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); @@ -430,6 +432,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); @@ -594,13 +598,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 &
