mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2024-11-23 10:14:13 +08:00
llvmpipe: make sure to duplicate the fd handle before giving out
This handle is given to the user to close, so make sure to dup it first. Fixes:d74ea2c117
("llvmpipe: Implement dmabuf handling") Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Reviewed-by: Lucas Fryzek <lfryzek@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30839> (cherry picked from commit4bf257a18f
)
This commit is contained in:
parent
46695f7cca
commit
f6da7d541b
@ -414,7 +414,7 @@
|
||||
"description": "llvmpipe: make sure to duplicate the fd handle before giving out",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "d74ea2c117fe96e527471e572336f931c3c77da1",
|
||||
"notes": null
|
||||
|
@ -761,8 +761,9 @@ llvmpipe_resource_get_handle(struct pipe_screen *_screen,
|
||||
lpr->data = lpr->dmabuf_alloc->data;
|
||||
/* reuse lavapipe codepath to handle destruction */
|
||||
lpr->backable = true;
|
||||
} else {
|
||||
whandle->handle = os_dupfd_cloexec(lpr->dmabuf_alloc->dmabuf_fd);
|
||||
}
|
||||
whandle->handle = lpr->dmabuf_alloc->dmabuf_fd;
|
||||
return true;
|
||||
} else if (!lpr->dt && whandle->type == WINSYS_HANDLE_TYPE_KMS) {
|
||||
/* dri winsys code will use this to query the drm modifiers
|
||||
|
Loading…
Reference in New Issue
Block a user