summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2022-08-01 15:59:48 -0400
committerDylan Baker <dylan.c.baker@intel.com>2022-08-11 10:30:37 -0700
commiteee80bc312301c79c5d3b15672a70ff0b611b08b (patch)
tree1769b5c20b8ab152fceb12edb68b9b6e6a27bedd
parent65c10ac61dd6e93b20a16ba34c79087f08cf54e1 (diff)
downloadmesa-eee80bc312301c79c5d3b15672a70ff0b611b08b.tar.gz
nine: check return on resource_get_handle
this has a return code, and if it return false, this is probably an exit condition cc: mesa-stable Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17775> (cherry picked from commit 188721d6d3d4cab9b0ca8fa419e4c33a33ae3910)
-rw-r--r--.pick_status.json2
-rw-r--r--src/gallium/frontends/nine/swapchain9.c13
2 files changed, 9 insertions, 6 deletions
diff --git a/.pick_status.json b/.pick_status.json
index cb7a05960e7..78068fa8f50 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -2119,7 +2119,7 @@
"description": "nine: check return on resource_get_handle",
"nominated": true,
"nomination_type": 0,
- "resolution": 0,
+ "resolution": 1,
"main_sha": null,
"because_sha": null
},
diff --git a/src/gallium/frontends/nine/swapchain9.c b/src/gallium/frontends/nine/swapchain9.c
index 1376ed99454..df42bffa12e 100644
--- a/src/gallium/frontends/nine/swapchain9.c
+++ b/src/gallium/frontends/nine/swapchain9.c
@@ -103,11 +103,14 @@ D3DWindowBuffer_create(struct NineSwapChain9 *This,
memset(&whandle, 0, sizeof(whandle));
whandle.type = WINSYS_HANDLE_TYPE_FD;
- This->screen->resource_get_handle(This->screen, pipe, resource,
- &whandle,
- for_frontbuffer_reading ?
- PIPE_HANDLE_USAGE_FRAMEBUFFER_WRITE :
- PIPE_HANDLE_USAGE_EXPLICIT_FLUSH);
+ if (!This->screen->resource_get_handle(This->screen, pipe, resource,
+ &whandle,
+ for_frontbuffer_reading ?
+ PIPE_HANDLE_USAGE_FRAMEBUFFER_WRITE :
+ PIPE_HANDLE_USAGE_EXPLICIT_FLUSH)) {
+ ERR("Failed to get handle for resource\n");
+ return NULL;
+ }
nine_context_get_pipe_release(This->base.device);
stride = whandle.stride;
dmaBufFd = whandle.handle;