From 3675833d19f164375ede256c94592f1be8776b42 Mon Sep 17 00:00:00 2001 From: Ginu Jacob Date: Tue, 5 Nov 2024 18:47:31 +0000 Subject: [PATCH] Fix the VK_KHR_DISPLAY implementation within the WSI Layer Surface extents are initialized in this change. This fixes the issues with execution of the wsi layer display backend. Additionally, functional code snippets are moved out of assert calls in the file wsi/display/swapchain.cpp to avoid them being stripped out by ndebug compilation. This change also fixes the unused variable error in ndebug compilation. Signed-off-by: Ginu Jacob Change-Id: I4ad33ef52dbb81faaf580ce7b89ce74ffe96e002 --- wsi/display/surface.cpp | 1 + wsi/display/surface_properties.cpp | 1 + wsi/display/swapchain.cpp | 7 ++++--- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/wsi/display/surface.cpp b/wsi/display/surface.cpp index 5ff67e2..4d6b61e 100644 --- a/wsi/display/surface.cpp +++ b/wsi/display/surface.cpp @@ -38,6 +38,7 @@ namespace display surface::surface(drm_display_mode *display_mode, VkExtent2D extent) : m_display_mode(display_mode) , m_extent(extent) + , m_surface_properties(this) { } diff --git a/wsi/display/surface_properties.cpp b/wsi/display/surface_properties.cpp index 530d98f..0d57242 100644 --- a/wsi/display/surface_properties.cpp +++ b/wsi/display/surface_properties.cpp @@ -332,6 +332,7 @@ GetDisplayPlaneCapabilitiesKHR(VkPhysicalDevice physicalDevice, VkDisplayModeKHR }); assert(valid_mode != display->get_display_modes_end()); + UNUSED(valid_mode); VkDisplayPlaneCapabilitiesKHR planeCapabilities{}; planeCapabilities.supportedAlpha = VK_DISPLAY_PLANE_ALPHA_OPAQUE_BIT_KHR; diff --git a/wsi/display/swapchain.cpp b/wsi/display/swapchain.cpp index 5868830..225f88c 100644 --- a/wsi/display/swapchain.cpp +++ b/wsi/display/swapchain.cpp @@ -524,8 +524,9 @@ void swapchain::present_image(const pending_present_request &pending_present) } else { - assert(FD_ISSET(display->get_drm_fd(), &fds)); - + int result = FD_ISSET(display->get_drm_fd(), &fds); + assert(result > 0); + UNUSED(result); drmEventContext ev = {}; ev.version = DRM_EVENT_CONTEXT_VERSION; ev.page_flip_handler = page_flip_event; @@ -603,9 +604,9 @@ void swapchain::destroy_image(swapchain_image &image) } if (image_data->fb_id != std::numeric_limits::max()) { - int result = drmModeRmFB(display->get_drm_fd(), image_data->fb_id); assert(result == 0); + UNUSED(result); } m_allocator.destroy(1, image_data);