diff --git a/CMakeLists.txt b/CMakeLists.txt index 4dc800c..9290bcd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2024 Arm Limited. +# Copyright (c) 2019-2025 Arm Limited. # # SPDX-License-Identifier: MIT # @@ -33,7 +33,7 @@ if (NOT CLANG_TIDY STREQUAL "CLANG_TIDY-NOTFOUND") set(CMAKE_CXX_CLANG_TIDY ${CLANG_TIDY} -checks=bugprone-*,modernize-*) endif() -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -pthread -fPIC") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -Wextra -pthread -fPIC") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) diff --git a/layer/present_timing.cpp b/layer/present_timing.cpp index db704c6..980799e 100644 --- a/layer/present_timing.cpp +++ b/layer/present_timing.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Arm Limited. + * Copyright (c) 2024-2025 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -30,6 +30,7 @@ #include #include "wsi_layer_experimental.hpp" #include "wsi/swapchain_base.hpp" +#include "util/macros.hpp" #if VULKAN_WSI_LAYER_EXPERIMENTAL @@ -39,6 +40,7 @@ VWL_VKAPI_CALL(VkResult) wsi_layer_vkSetSwapchainPresentTimingQueueSizeEXT(VkDevice device, VkSwapchainKHR swapchain, uint32_t size) VWL_API_POST { + UNUSED(device); assert(swapchain != VK_NULL_HANDLE); auto *sc = reinterpret_cast(swapchain); return sc->presentation_timing_queue_set_size(size); @@ -52,6 +54,10 @@ wsi_layer_vkGetSwapchainTimingPropertiesEXT(VkDevice device, VkSwapchainKHR swap uint64_t *pSwapchainTimingPropertiesCounter, VkSwapchainTimingPropertiesEXT *pSwapchainTimingProperties) VWL_API_POST { + UNUSED(device); + UNUSED(swapchain); + UNUSED(pSwapchainTimingPropertiesCounter); + UNUSED(pSwapchainTimingProperties); VkResult result = VK_SUCCESS; return result; } @@ -83,6 +89,9 @@ wsi_layer_vkGetPastPresentationTimingEXT( VkDevice device, const VkPastPresentationTimingInfoEXT *pPastPresentationTimingInfo, VkPastPresentationTimingPropertiesEXT *pPastPresentationTimingProperties) VWL_API_POST { + UNUSED(device); + UNUSED(pPastPresentationTimingInfo); + UNUSED(pPastPresentationTimingProperties); VkResult result = VK_SUCCESS; return result; } diff --git a/layer/private_data.cpp b/layer/private_data.cpp index 080c831..349ae7a 100644 --- a/layer/private_data.cpp +++ b/layer/private_data.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2024 Arm Limited. + * Copyright (c) 2018-2025 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -30,6 +30,7 @@ #include "util/unordered_map.hpp" #include "util/log.hpp" #include "util/helpers.hpp" +#include "util/macros.hpp" namespace layer { @@ -367,7 +368,7 @@ bool instance_private_data::has_image_compression_support(VkPhysicalDevice phys_ VkPhysicalDeviceImageCompressionControlFeaturesEXT compression = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_FEATURES_EXT, nullptr, VK_FALSE }; - VkPhysicalDeviceFeatures2KHR features = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR, &compression }; + VkPhysicalDeviceFeatures2KHR features = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR, &compression, {} }; disp.GetPhysicalDeviceFeatures2KHR(phys_dev, &features); @@ -380,7 +381,7 @@ bool instance_private_data::has_frame_boundary_support(VkPhysicalDevice phys_dev VkPhysicalDeviceFrameBoundaryFeaturesEXT frame_boundary = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_FEATURES_EXT, nullptr, VK_FALSE }; - VkPhysicalDeviceFeatures2KHR features = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR, &frame_boundary }; + VkPhysicalDeviceFeatures2KHR features = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR, &frame_boundary, {} }; disp.GetPhysicalDeviceFeatures2KHR(phys_dev, &features); @@ -533,6 +534,7 @@ bool device_private_data::should_layer_create_swapchain(VkSurfaceKHR vk_surface) bool device_private_data::can_icds_create_swapchain(VkSurfaceKHR vk_surface) { + UNUSED(vk_surface); return disp.get_fn("vkCreateSwapchainKHR").has_value(); } diff --git a/layer/swapchain_api.cpp b/layer/swapchain_api.cpp index e05fc03..b5ed7dd 100644 --- a/layer/swapchain_api.cpp +++ b/layer/swapchain_api.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2019, 2021-2024 Arm Limited. + * Copyright (c) 2017, 2019, 2021-2025 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -38,6 +38,7 @@ #include "swapchain_api.hpp" #include #include "wsi/synchronization.hpp" +#include "util/macros.hpp" VWL_VKAPI_CALL(VkResult) wsi_layer_vkCreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR *pSwapchainCreateInfo, @@ -246,6 +247,7 @@ VWL_VKAPI_CALL(VkResult) wsi_layer_vkGetDeviceGroupPresentCapabilitiesKHR( VkDevice device, VkDeviceGroupPresentCapabilitiesKHR *pDeviceGroupPresentCapabilities) VWL_API_POST { + UNUSED(device); assert(pDeviceGroupPresentCapabilities != nullptr); pDeviceGroupPresentCapabilities->presentMask[0] = 1; diff --git a/wsi/display/swapchain.cpp b/wsi/display/swapchain.cpp index 225f88c..0258c52 100644 --- a/wsi/display/swapchain.cpp +++ b/wsi/display/swapchain.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Arm Limited. + * Copyright (c) 2024-2025 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -78,7 +78,9 @@ static void page_flip_event(int fd, unsigned int sequence, unsigned int tv_sec, VkResult swapchain::init_platform(VkDevice device, const VkSwapchainCreateInfoKHR *swapchain_create_info, bool &use_presentation_thread) { - + UNUSED(device); + UNUSED(swapchain_create_info); + UNUSED(use_presentation_thread); WSIALLOC_ASSERT_VERSION(); if (wsialloc_new(&m_wsi_allocator) != WSIALLOC_ERROR_NONE) { @@ -92,6 +94,7 @@ VkResult swapchain::init_platform(VkDevice device, const VkSwapchainCreateInfoKH VkResult swapchain::bind_swapchain_image(VkDevice &device, const VkBindImageMemoryInfo *bind_image_mem_info, const VkBindImageMemorySwapchainInfoKHR *bind_sc_info) { + UNUSED(device); const wsi::swapchain_image &swapchain_image = m_swapchain_images[bind_sc_info->imageIndex]; auto image_data = reinterpret_cast(swapchain_image.data); return image_data->external_mem.bind_swapchain_image_memory(bind_image_mem_info->image); @@ -234,7 +237,12 @@ VkResult swapchain::allocate_wsialloc(VkImageCreateInfo &image_create_info, disp wsialloc_allocate_info alloc_info = { importable_formats.data(), static_cast(importable_formats.size()), image_create_info.extent.width, image_create_info.extent.height, allocation_flags }; - wsialloc_allocate_result alloc_result = { 0 }; + wsialloc_allocate_result alloc_result = { .format = { .fourcc = 0, .modifier = 0, .flags = 0 }, + .average_row_strides = { 0 }, + .offsets = { 0 }, + .buffer_fds = { 0 }, + .is_disjoint = false }; + /* Clear buffer_fds and average_row_strides for error purposes */ for (int i = 0; i < WSIALLOC_MAX_PLANES; ++i) { @@ -301,7 +309,7 @@ static VkResult fill_image_create_info(VkImageCreateInfo &image_create_info, return VK_SUCCESS; } -VkResult swapchain::allocate_image(VkImageCreateInfo &image_create_info, display_image_data *image_data) +VkResult swapchain::allocate_image(display_image_data *image_data) { util::vector importable_formats(util::allocator(m_allocator, VK_SYSTEM_ALLOCATION_SCOPE_COMMAND)); auto &m_allocated_format = m_image_creation_parameters.m_allocated_format; @@ -314,8 +322,7 @@ VkResult swapchain::allocate_image(VkImageCreateInfo &image_create_info, display return VK_SUCCESS; } -VkResult swapchain::create_framebuffer(const VkImageCreateInfo &image_create_info, swapchain_image &image, - display_image_data *image_data) +VkResult swapchain::create_framebuffer(const VkImageCreateInfo &image_create_info, display_image_data *image_data) { VkResult ret_code = VK_SUCCESS; std::array strides{ 0, 0, 0, 0 }; @@ -381,11 +388,11 @@ VkResult swapchain::allocate_and_bind_swapchain_image(VkImageCreateInfo image_cr image.status = swapchain_image::FREE; assert(image.data != nullptr); auto image_data = static_cast(image.data); - TRY_LOG(allocate_image(image_create_info, image_data), "Failed to allocate image"); + TRY_LOG(allocate_image(image_data), "Failed to allocate image"); image_status_lock.unlock(); - TRY_LOG(create_framebuffer(image_create_info, image, image_data), "Failed to create framebuffer"); + TRY_LOG(create_framebuffer(image_create_info, image_data), "Failed to create framebuffer"); TRY_LOG(image_data->external_mem.import_memory_and_bind_swapchain_image(image.image), "Failed to import memory and bind swapchain image"); @@ -431,7 +438,8 @@ VkResult swapchain::create_swapchain_image(VkImageCreateInfo image_create_info, return VK_ERROR_INITIALIZATION_FAILED; } - wsialloc_format allocated_format = { 0 }; + wsialloc_format allocated_format = { .fourcc = 0, .modifier = 0, .flags = 0 }; + TRY_LOG_CALL(allocate_wsialloc(image_create_info, image_data, importable_formats, &allocated_format, true)); for (auto &prop : drm_format_props) diff --git a/wsi/display/swapchain.hpp b/wsi/display/swapchain.hpp index cc58af0..e893f5f 100644 --- a/wsi/display/swapchain.hpp +++ b/wsi/display/swapchain.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Arm Limited. + * Copyright (c) 2024-2025 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -111,7 +111,7 @@ public: void destroy_image(swapchain_image &image) override; private: - VkResult allocate_image(VkImageCreateInfo &image_create_info, display_image_data *image_data); + VkResult allocate_image(display_image_data *image_data); VkResult allocate_wsialloc(VkImageCreateInfo &image_create_info, display_image_data *image_data, util::vector &importable_formats, wsialloc_format *allocated_format, @@ -122,8 +122,7 @@ private: util::vector &exportable_modifers, util::vector &drm_format_props); - VkResult create_framebuffer(const VkImageCreateInfo &image_create_info, swapchain_image &image, - display_image_data *image_data); + VkResult create_framebuffer(const VkImageCreateInfo &image_create_info, display_image_data *image_data); wsialloc_allocator *m_wsi_allocator; drm_display_mode *m_display_mode; diff --git a/wsi/headless/swapchain.cpp b/wsi/headless/swapchain.cpp index 52502d8..4cef89a 100644 --- a/wsi/headless/swapchain.cpp +++ b/wsi/headless/swapchain.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2024 Arm Limited. + * Copyright (c) 2017-2025 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -36,6 +36,7 @@ #include "swapchain.hpp" #include "layer/wsi_layer_experimental.hpp" #include "util/custom_allocator.hpp" +#include "util/macros.hpp" namespace wsi { @@ -66,6 +67,7 @@ swapchain::~swapchain() VkResult swapchain::init_platform(VkDevice device, const VkSwapchainCreateInfoKHR *swapchain_create_info, bool &use_presentation_thread) { + UNUSED(device); if (swapchain_create_info->presentMode == VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR) { use_presentation_thread = false; @@ -101,6 +103,7 @@ VkResult swapchain::init_platform(VkDevice device, const VkSwapchainCreateInfoKH VkResult swapchain::allocate_and_bind_swapchain_image(VkImageCreateInfo image_create, swapchain_image &image) { + UNUSED(image_create); VkResult res = VK_SUCCESS; const std::lock_guard lock(m_image_status_mutex); diff --git a/wsi/surface_properties.cpp b/wsi/surface_properties.cpp index 77cace5..e72d46b 100644 --- a/wsi/surface_properties.cpp +++ b/wsi/surface_properties.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Arm Limited. + * Copyright (c) 2022, 2025 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -31,7 +31,7 @@ namespace wsi VkResult surface_format_properties::check_device_support(VkPhysicalDevice phys_dev, VkPhysicalDeviceImageFormatInfo2KHR image_format_info) { - VkImageFormatProperties2KHR image_format_props{ VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2_KHR, nullptr }; + VkImageFormatProperties2KHR image_format_props = { VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2_KHR, nullptr, {} }; auto &instance_data = layer::instance_private_data::get(phys_dev); @@ -48,11 +48,12 @@ VkResult surface_format_properties::add_device_compression_support( VkImageCompressionPropertiesEXT compression_props = { VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_PROPERTIES_EXT, nullptr, 0, 0 }; VkImageFormatProperties2KHR image_format_props{ VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2_KHR, - &compression_props }; + &compression_props, + {} }; VkImageCompressionControlEXT compression_control{ VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_CONTROL_EXT, image_format_info.pNext, - VK_IMAGE_COMPRESSION_FIXED_RATE_DEFAULT_EXT }; + VK_IMAGE_COMPRESSION_FIXED_RATE_DEFAULT_EXT, 0, nullptr }; image_format_info.pNext = &compression_control; VkResult res = diff --git a/wsi/surface_properties.hpp b/wsi/surface_properties.hpp index 5b3c140..69a046e 100644 --- a/wsi/surface_properties.hpp +++ b/wsi/surface_properties.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019, 2021-2024 Arm Limited. + * Copyright (c) 2017-2019, 2021-2025 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -37,6 +37,7 @@ #include "util/log.hpp" #include "util/format_modifiers.hpp" #include "util/drm/drm_utils.hpp" +#include "util/macros.hpp" #if VULKAN_WSI_LAYER_EXPERIMENTAL #include "layer/wsi_layer_experimental.hpp" @@ -83,6 +84,7 @@ public: virtual VkResult get_required_device_extensions(util::extension_list &extension_list) { /* Requires no additional extensions */ + UNUSED(extension_list); return VK_SUCCESS; } diff --git a/wsi/swapchain_base.cpp b/wsi/swapchain_base.cpp index eec5483..736382b 100644 --- a/wsi/swapchain_base.cpp +++ b/wsi/swapchain_base.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2024 Arm Limited. + * Copyright (c) 2017-2025 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -217,7 +217,7 @@ swapchain_base::swapchain_base(layer::device_private_data &dev_data, const VkAll , m_device(VK_NULL_HANDLE) , m_queue(VK_NULL_HANDLE) #if WSI_IMAGE_COMPRESSION_CONTROL_SWAPCHAIN - , m_image_compression_control_params({ VK_IMAGE_COMPRESSION_DEFAULT_EXT, 0 }) + , m_image_compression_control_params({ VK_IMAGE_COMPRESSION_DEFAULT_EXT, 0, {} }) #endif , m_image_create_info() #if VULKAN_WSI_LAYER_EXPERIMENTAL diff --git a/wsi/swapchain_base.hpp b/wsi/swapchain_base.hpp index b690694..b070f4a 100644 --- a/wsi/swapchain_base.hpp +++ b/wsi/swapchain_base.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2024 Arm Limited. + * Copyright (c) 2017-2025 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -46,12 +46,12 @@ #include "util/helpers.hpp" #include "time_domains.hpp" #include "layer/wsi_layer_experimental.hpp" +#include "util/macros.hpp" namespace wsi { using util::MAX_PLANES; - struct swapchain_image { enum status @@ -553,7 +553,7 @@ protected: * * @param image Handle to the image about to be released. */ - virtual void destroy_image(swapchain_image &image){}; + virtual void destroy_image([[maybe_unused]] swapchain_image &image){}; /** * @brief Hook for any actions to free up a buffer for acquire @@ -570,6 +570,7 @@ protected: */ virtual VkResult get_free_buffer(uint64_t *timeout) { + UNUSED(timeout); return VK_SUCCESS; } diff --git a/wsi/wayland/surface.cpp b/wsi/wayland/surface.cpp index 61ed4b5..38ff3b3 100644 --- a/wsi/wayland/surface.cpp +++ b/wsi/wayland/surface.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 2024 Arm Limited. + * Copyright (c) 2021, 2024-2025 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -50,6 +50,9 @@ namespace VWL_CAPI_CALL(void) zwp_linux_dmabuf_v1_format_impl(void *data, struct zwp_linux_dmabuf_v1 *dma_buf, uint32_t drm_format) VWL_API_POST { + UNUSED(data); + UNUSED(dma_buf); + UNUSED(drm_format); } /* Handler for modifier event of the zwp_linux_dmabuf_v1 interface. */ @@ -57,6 +60,7 @@ VWL_CAPI_CALL(void) zwp_linux_dmabuf_v1_modifier_impl(void *data, struct zwp_linux_dmabuf_v1 *dma_buf, uint32_t drm_format, uint32_t modifier_hi, uint32_t modifier_low) VWL_API_POST { + UNUSED(dma_buf); auto *drm_supported_formats = reinterpret_cast(data); drm_format_pair format = {}; @@ -208,7 +212,7 @@ bool surface::init() return false; } - const wl_registry_listener registry_listener = { surface_registry_handler }; + const wl_registry_listener registry_listener = { surface_registry_handler, nullptr }; int res = wl_registry_add_listener(registry.get(), ®istry_listener, this); if (res < 0) { @@ -293,7 +297,8 @@ util::unique_ptr surface::allocate_swapchain(layer::device_priva static void frame_done(void *data, wl_callback *cb, uint32_t time) { - (void)time; + UNUSED(time); + UNUSED(cb); bool *present_pending = reinterpret_cast(data); assert(present_pending); diff --git a/wsi/wayland/surface_properties.cpp b/wsi/wayland/surface_properties.cpp index e6435b9..3725e4c 100644 --- a/wsi/wayland/surface_properties.cpp +++ b/wsi/wayland/surface_properties.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019, 2021-2024 Arm Limited. + * Copyright (c) 2017-2019, 2021-2025 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -250,6 +250,9 @@ VkResult surface_properties::get_surface_formats(VkPhysicalDevice physical_devic VkResult surface_properties::get_surface_present_modes(VkPhysicalDevice physical_device, VkSurfaceKHR surface, uint32_t *pPresentModeCount, VkPresentModeKHR *pPresentModes) { + UNUSED(physical_device); + UNUSED(surface); + return get_surface_present_modes_common(pPresentModeCount, pPresentModes, m_supported_modes); } @@ -292,6 +295,8 @@ VWL_CAPI_CALL(void) check_required_protocols(void *data, struct wl_registry *registry, uint32_t name, const char *interface, uint32_t version) VWL_API_POST { + UNUSED(registry); + UNUSED(name); auto supported = static_cast(data); if (!strcmp(interface, zwp_linux_dmabuf_v1_interface.name) && version >= ZWP_LINUX_DMABUF_V1_MODIFIER_SINCE_VERSION) @@ -304,7 +309,7 @@ check_required_protocols(void *data, struct wl_registry *registry, uint32_t name } } -static const wl_registry_listener registry_listener = { check_required_protocols }; +static const wl_registry_listener registry_listener = { check_required_protocols, nullptr }; static bool check_wl_protocols(struct wl_display *display) { @@ -350,6 +355,7 @@ VWL_VKAPI_CALL(VkBool32) GetPhysicalDeviceWaylandPresentationSupportKHR(VkPhysicalDevice physical_device, uint32_t queue_index, struct wl_display *display) { + UNUSED(queue_index); bool dev_supports_sync = sync_fd_fence_sync::is_supported(layer::instance_private_data::get(physical_device), physical_device); if (!dev_supports_sync) diff --git a/wsi/wayland/swapchain.cpp b/wsi/wayland/swapchain.cpp index b83ace2..b7312f1 100644 --- a/wsi/wayland/swapchain.cpp +++ b/wsi/wayland/swapchain.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2024 Arm Limited. + * Copyright (c) 2017-2025 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -81,6 +81,9 @@ swapchain::~swapchain() VkResult swapchain::init_platform(VkDevice device, const VkSwapchainCreateInfoKHR *swapchain_create_info, bool &use_presentation_thread) { + UNUSED(device); + UNUSED(swapchain_create_info); + UNUSED(use_presentation_thread); #if VULKAN_WSI_LAYER_EXPERIMENTAL std::array, 1> time_domains_array = { m_allocator.make_unique(VK_PRESENT_STAGE_QUEUE_OPERATIONS_END_BIT_EXT, @@ -292,7 +295,7 @@ VkResult swapchain::allocate_wsialloc(VkImageCreateInfo &image_create_info, wayl image_create_info.extent.width, image_create_info.extent.height, allocation_flags }; - wsialloc_allocate_result alloc_result = { 0 }; + wsialloc_allocate_result alloc_result = { {}, { 0 }, { 0 }, { -1 }, false }; /* Clear buffer_fds and average_row_strides for error purposes */ for (int i = 0; i < WSIALLOC_MAX_PLANES; ++i) { @@ -360,7 +363,7 @@ static VkResult fill_image_create_info(VkImageCreateInfo &image_create_info, return VK_SUCCESS; } -VkResult swapchain::allocate_image(VkImageCreateInfo &image_create_info, wayland_image_data *image_data) +VkResult swapchain::allocate_image(wayland_image_data *image_data) { util::vector importable_formats(util::allocator(m_allocator, VK_SYSTEM_ALLOCATION_SCOPE_COMMAND)); auto &m_allocated_format = m_image_creation_parameters.m_allocated_format; @@ -411,7 +414,7 @@ VkResult swapchain::allocate_and_bind_swapchain_image(VkImageCreateInfo image_cr assert(image.data != nullptr); auto image_data = static_cast(image.data); - TRY_LOG(allocate_image(image_create_info, image_data), "Failed to allocate image"); + TRY_LOG(allocate_image(image_data), "Failed to allocate image"); image_status_lock.unlock(); TRY_LOG(create_wl_buffer(image_create_info, image, image_data), "Failed to create wl_buffer"); @@ -460,7 +463,7 @@ VkResult swapchain::create_swapchain_image(VkImageCreateInfo image_create_info, return VK_ERROR_INITIALIZATION_FAILED; } - wsialloc_format allocated_format = { 0 }; + wsialloc_format allocated_format = { 0, 0, 0 }; TRY_LOG_CALL(allocate_wsialloc(image_create_info, image_data, importable_formats, &allocated_format, true)); for (auto &prop : drm_format_props) @@ -633,6 +636,7 @@ VkResult swapchain::image_wait_present(swapchain_image &, uint64_t) VkResult swapchain::bind_swapchain_image(VkDevice &device, const VkBindImageMemoryInfo *bind_image_mem_info, const VkBindImageMemorySwapchainInfoKHR *bind_sc_info) { + UNUSED(device); const wsi::swapchain_image &swapchain_image = m_swapchain_images[bind_sc_info->imageIndex]; auto image_data = reinterpret_cast(swapchain_image.data); return image_data->external_mem.bind_swapchain_image_memory(bind_image_mem_info->image); diff --git a/wsi/wayland/swapchain.hpp b/wsi/wayland/swapchain.hpp index 7667324..b7a1af1 100644 --- a/wsi/wayland/swapchain.hpp +++ b/wsi/wayland/swapchain.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2024 Arm Limited. + * Copyright (c) 2017-2025 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -183,7 +183,7 @@ protected: private: VkResult create_wl_buffer(const VkImageCreateInfo &image_create_info, swapchain_image &image, wayland_image_data *image_data); - VkResult allocate_image(VkImageCreateInfo &image_create_info, wayland_image_data *image_data); + VkResult allocate_image(wayland_image_data *image_data); VkResult allocate_wsialloc(VkImageCreateInfo &image_create_info, wayland_image_data *image_data, util::vector &importable_formats, wsialloc_format *allocated_format, bool avoid_allocation);