mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-04 17:10:26 +01:00
panfrost: 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: Daniel Stone <daniels@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12074>
(cherry picked from commit 4c092947df)
This commit is contained in:
parent
4524e8bff8
commit
4bb8e29a28
2 changed files with 8 additions and 7 deletions
|
|
@ -256,7 +256,7 @@
|
|||
"description": "panfrost: 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
|
||||
},
|
||||
|
|
|
|||
|
|
@ -144,13 +144,14 @@ panfrost_resource_get_handle(struct pipe_screen *pscreen,
|
|||
if (handle->type == WINSYS_HANDLE_TYPE_SHARED) {
|
||||
return false;
|
||||
} else if (handle->type == WINSYS_HANDLE_TYPE_KMS) {
|
||||
if (renderonly_get_handle(scanout, handle))
|
||||
if (dev->ro) {
|
||||
return renderonly_get_handle(scanout, handle);
|
||||
} else {
|
||||
handle->handle = rsrc->image.data.bo->gem_handle;
|
||||
handle->stride = rsrc->image.layout.slices[0].line_stride;
|
||||
handle->offset = rsrc->image.layout.slices[0].offset;
|
||||
return true;
|
||||
|
||||
handle->handle = rsrc->image.data.bo->gem_handle;
|
||||
handle->stride = rsrc->image.layout.slices[0].line_stride;
|
||||
handle->offset = rsrc->image.layout.slices[0].offset;
|
||||
return TRUE;
|
||||
}
|
||||
} else if (handle->type == WINSYS_HANDLE_TYPE_FD) {
|
||||
if (scanout) {
|
||||
struct drm_prime_handle args = {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue