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 <ginu.jacob@arm.com>
Change-Id: I4ad33ef52dbb81faaf580ce7b89ce74ffe96e002
This commit is contained in:
Ginu Jacob 2024-11-05 18:47:31 +00:00
parent d0671474e5
commit 3675833d19
3 changed files with 6 additions and 3 deletions

View file

@ -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)
{
}

View file

@ -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;

View file

@ -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<uint32_t>::max())
{
int result = drmModeRmFB(display->get_drm_fd(), image_data->fb_id);
assert(result == 0);
UNUSED(result);
}
m_allocator.destroy(1, image_data);