mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-19 23:10:47 +02:00
etnaviv: 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: Christian Gmeiner <christian.gmeiner@gmail.com> Cc: mesa-stable Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12074>
This commit is contained in:
parent
3b3cd51286
commit
9da901d2b2
1 changed files with 3 additions and 2 deletions
|
|
@ -580,6 +580,7 @@ etna_resource_get_handle(struct pipe_screen *pscreen,
|
||||||
struct pipe_resource *prsc,
|
struct pipe_resource *prsc,
|
||||||
struct winsys_handle *handle, unsigned usage)
|
struct winsys_handle *handle, unsigned usage)
|
||||||
{
|
{
|
||||||
|
struct etna_screen *screen = etna_screen(pscreen);
|
||||||
struct etna_resource *rsc = etna_resource(prsc);
|
struct etna_resource *rsc = etna_resource(prsc);
|
||||||
struct renderonly_scanout *scanout;
|
struct renderonly_scanout *scanout;
|
||||||
|
|
||||||
|
|
@ -607,8 +608,8 @@ etna_resource_get_handle(struct pipe_screen *pscreen,
|
||||||
if (handle->type == WINSYS_HANDLE_TYPE_SHARED) {
|
if (handle->type == WINSYS_HANDLE_TYPE_SHARED) {
|
||||||
return etna_bo_get_name(rsc->bo, &handle->handle) == 0;
|
return etna_bo_get_name(rsc->bo, &handle->handle) == 0;
|
||||||
} else if (handle->type == WINSYS_HANDLE_TYPE_KMS) {
|
} else if (handle->type == WINSYS_HANDLE_TYPE_KMS) {
|
||||||
if (renderonly_get_handle(scanout, handle)) {
|
if (screen->ro) {
|
||||||
return true;
|
return renderonly_get_handle(scanout, handle);
|
||||||
} else {
|
} else {
|
||||||
handle->handle = etna_bo_handle(rsc->bo);
|
handle->handle = etna_bo_handle(rsc->bo);
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue