freedreno: Handle export error handling

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23324>
This commit is contained in:
Rob Clark
2023-05-30 09:19:50 -07:00
committed by Marge Bot
parent 7cc8185ca3
commit 221a6986ba
@@ -883,11 +883,17 @@ fd_screen_bo_get_handle(struct pipe_screen *pscreen, struct fd_bo *bo,
if (screen->ro) {
return renderonly_get_handle(scanout, whandle);
} else {
whandle->handle = fd_bo_handle(bo);
uint32_t handle = fd_bo_handle(bo);
if (!handle)
return false;
whandle->handle = handle;
return true;
}
} else if (whandle->type == WINSYS_HANDLE_TYPE_FD) {
whandle->handle = fd_bo_dmabuf(bo);
int fd = fd_bo_dmabuf(bo);
if (fd < 0)
return false;
whandle->handle = fd;
return true;
} else {
return false;