Module: Mesa
Branch: main
Commit: 47f000c170ccb824b308e02db8c2c955a8c00217
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=47f000c170ccb824b308e02db8c2c955a8c00217

Author: Simon Ser <[email protected]>
Date:   Tue Jul 27 09:04:14 2021 +0200

lima: 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 <[email protected]>
Reviewed-by: Vasily Khoruzhick <[email protected]>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12074>

---

 src/gallium/drivers/lima/lima_resource.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/lima/lima_resource.c 
b/src/gallium/drivers/lima/lima_resource.c
index a783595411a..7b94dd48320 100644
--- a/src/gallium/drivers/lima/lima_resource.c
+++ b/src/gallium/drivers/lima/lima_resource.c
@@ -416,9 +416,8 @@ lima_resource_get_handle(struct pipe_screen *pscreen,
 
    res->modifier_constant = true;
 
-   if (handle->type == WINSYS_HANDLE_TYPE_KMS && screen->ro &&
-       renderonly_get_handle(res->scanout, handle))
-      return true;
+   if (handle->type == WINSYS_HANDLE_TYPE_KMS && screen->ro)
+      return renderonly_get_handle(res->scanout, handle);
 
    if (!lima_bo_export(res->bo, handle))
       return false;

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to