From 82d63c9282923371d131bf1505c56b891b9381ee Mon Sep 17 00:00:00 2001 From: Kitlith Date: Tue, 20 Jan 2026 11:55:25 -0800 Subject: [PATCH] panvk: Free drm device in can_present_on_device Fixes: 08da41f2f19 ("panvk: override can_present_on_device") Signed-off-by: Kitlith Reviewed-by: Erik Faye-Lund Reviewed-by: Daniel Stone (cherry picked from commit 4de41bf27dbcb8c3e40560c2b504a0827ecd9c7d) Part-of: --- .pick_status.json | 2 +- src/panfrost/vulkan/panvk_wsi.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 847613ebea4..931f5216314 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1044,7 +1044,7 @@ "description": "panvk: Free drm device in can_present_on_device", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "08da41f2f198571d7aac23c75bcf076517047226", "notes": null diff --git a/src/panfrost/vulkan/panvk_wsi.c b/src/panfrost/vulkan/panvk_wsi.c index cabb90d14c4..680d7adaf9c 100644 --- a/src/panfrost/vulkan/panvk_wsi.c +++ b/src/panfrost/vulkan/panvk_wsi.c @@ -50,7 +50,11 @@ panvk_can_present_on_device(VkPhysicalDevice pdevice, int fd) return false; /* Allow on-device presentation for all devices with bus type PLATFORM. * Other device types such as PCI or USB should use the PRIME blit path. */ - return device->bustype == DRM_BUS_PLATFORM; + bool match = device->bustype == DRM_BUS_PLATFORM; + + drmFreeDevice(&device); + + return match; } VkResult