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)
This commit is contained in:
Mike Blumenkrantz 2022-08-01 15:59:48 -04:00 committed by Dylan Baker
parent 0d7d35c84a
commit 349576d92f
2 changed files with 9 additions and 6 deletions

View File

@ -418,7 +418,7 @@
"description": "nine: check return on resource_get_handle",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null
},

View File

@ -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;