mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
freedreno: fail in get_handle(TYPE_KMS) without a scanout resource
The previous logic was returning a handle valid for the render-only
device if rsc->scanout was NULL. However the caller doesn't expect
this: the caller will use the handle with the KMS device.
Instead of returning a handle for the wrong device, fail if we don't
have one.
Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Emma Anholt <emma@anholt.net>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12074>
(cherry picked from commit 465eb7864b)
This commit is contained in:
parent
bda17c7388
commit
4524e8bff8
2 changed files with 8 additions and 4 deletions
|
|
@ -265,7 +265,7 @@
|
|||
"description": "freedreno: fail in get_handle(TYPE_KMS) without a scanout resource",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null
|
||||
},
|
||||
|
|
|
|||
|
|
@ -803,15 +803,19 @@ fd_screen_bo_get_handle(struct pipe_screen *pscreen, struct fd_bo *bo,
|
|||
struct renderonly_scanout *scanout, unsigned stride,
|
||||
struct winsys_handle *whandle)
|
||||
{
|
||||
struct fd_screen *screen = fd_screen(pscreen);
|
||||
|
||||
whandle->stride = stride;
|
||||
|
||||
if (whandle->type == WINSYS_HANDLE_TYPE_SHARED) {
|
||||
return fd_bo_get_name(bo, &whandle->handle) == 0;
|
||||
} else if (whandle->type == WINSYS_HANDLE_TYPE_KMS) {
|
||||
if (renderonly_get_handle(scanout, whandle))
|
||||
if (screen->ro) {
|
||||
return renderonly_get_handle(scanout, whandle);
|
||||
} else {
|
||||
whandle->handle = fd_bo_handle(bo);
|
||||
return true;
|
||||
whandle->handle = fd_bo_handle(bo);
|
||||
return true;
|
||||
}
|
||||
} else if (whandle->type == WINSYS_HANDLE_TYPE_FD) {
|
||||
whandle->handle = fd_bo_dmabuf(bo);
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue