mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 07:28:11 +02:00
llvmpipe: query winsys support for dmabuf mapping
Fixes #11257 by ensuring winsys mapping functions is only called
if its supported by the winsys, which should prevent llvmpipe from
crashing with kmswast.
If the winsys is kms_swrast then this method will be null, but on
drisw it will be available.
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
(cherry picked from commit db38a4913e)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29721>
This commit is contained in:
parent
7bda959181
commit
92a43a3f47
2 changed files with 8 additions and 2 deletions
|
|
@ -5334,7 +5334,7 @@
|
|||
"description": "llvmpipe: query winsys support for dmabuf mapping",
|
||||
"nominated": false,
|
||||
"nomination_type": 3,
|
||||
"resolution": 4,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null,
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -664,7 +664,13 @@ llvmpipe_resource_from_handle(struct pipe_screen *_screen,
|
|||
#ifdef HAVE_LINUX_UDMABUF_H
|
||||
struct llvmpipe_memory_fd_alloc *alloc;
|
||||
uint64_t size;
|
||||
if(_screen->import_memory_fd(_screen, whandle->handle, (struct pipe_memory_allocation**)&alloc, &size, true)) {
|
||||
/* Not all winsys implement displaytarget_create_mapped so we need to check
|
||||
* that is available (not null).
|
||||
*/
|
||||
if (winsys->displaytarget_create_mapped &&
|
||||
_screen->import_memory_fd(_screen, whandle->handle,
|
||||
(struct pipe_memory_allocation**)&alloc,
|
||||
&size, true)) {
|
||||
data = alloc->data;
|
||||
lpr->dt = winsys->displaytarget_create_mapped(winsys, template->bind,
|
||||
template->format, template->width0, template->height0,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue