From 39ffd918cd260c646b1eb665113ea92630390e06 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Tue, 27 Jul 2021 09:04:14 +0200 Subject: [PATCH] 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 Reviewed-by: Vasily Khoruzhick Cc: mesa-stable Part-of: (cherry picked from commit 47f000c170ccb824b308e02db8c2c955a8c00217) --- .pick_status.json | 2 +- src/gallium/drivers/lima/lima_resource.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 421259755dd..b0ff252710c 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -247,7 +247,7 @@ "description": "lima: 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 }, 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;