Commit graph

3 commits

Author SHA1 Message Date
Normunds Rieksts
2d4cbd5afa Decouple swapchain images and their memory from swapchain class
Decouples the swapchain images and their memory binder/allocator logic into separate classes. This allows us to reduce code duplication across different backends that use the same type of allocation logic and also allows us to make use of RAII to release the resources for swapchain images.

The swapchain_base and other swapchain classes have been refactored to handle the new swapchain images.

The patch makes the following adjustments:

* Introduces a new swapchain_image class that holds all swapchain image resources
* Introduces a swapchain image factory class that constructs swapchain images
* Introduces a Vulkan image handle class that is responsible for constructing VkImage handles
* Introduces a new interface that describes how swapchain backing memory is being allocated
* As part of this backing memory interface, introduces device and external (wsialloc) backing memory classes
* Introduces a new interface that holds swapchain image data like wl_buffers
* Refactors lots of swapchain image parts out of the base swapchain class and moves it into the respective backends to simplify the swapchain classes.
2025-11-20 13:55:45 +00:00
Iason Paraskevopoulos
ca3820a0ba Add external memory extension
Adds a swapchain create info extension for creating an image using
external memory. This removes the need for modifying the
image_create_info in the display and wayland backends. There is still
code duplication left in these backends though, because swapchain
allocation needs to know the selected format. This will be removed when
the swapchain images will be created from the swapchain image creator.

Moves the definition of drm_format_pair to drm_utils.

Removes two step initialization from swapchain_wsi_allocator.

Change-Id: I0c937a59cc62e7e3134f0af4728fdda3739237bd
Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
2025-04-25 15:28:39 +01:00
Iason Paraskevopoulos
b326e4b21f Add wsialloc wrapper class
Adds a class for owning and managing a wsialloc allocator, which removes
duplicated functionality from the wayland and display backends.

Change-Id: Ieb0c75481c2b1c0019e620a88fc0e153eba1e29a
Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
2025-04-25 15:03:42 +01:00