Commit graph

12 commits

Author SHA1 Message Date
Maged Elnaggar
d1ade3d218 Append WSI layer warning flags
- switch CMAKE_CXX_FLAGS and C_FLAGS to string(APPEND)
- concatenate flags without semicolons or list issues
- preserve existing: -Wall -Werror -Wextra -pthread -fPIC
- add new diagnostics:
  Wdouble-promotion, Wnon-virtual-dtor,
  Wdelete-non-virtual-dtor, Woverloaded-virtual,
  Wcast-qual, Wmissing-field-initializers,
  Werror=return-type, Wmissing-format-attribute
- add C-only check: -Wstrict-prototypes

Change-Id: Icae6cf649b9ab88c1d0bc736b91b4bc50e24c9dd
Signed-off-by: Maged Elnaggar <maged.elnaggar@arm.com>
2025-08-05 13:34:59 +01:00
Iason Paraskevopoulos
cd19e3827b Add dma_buf_heaps wsialloc implementation
Change-Id: I738f8cbfb1aec52a122689ebaeb7f5b898ba200a
Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
2024-10-31 10:40:09 +00:00
Iason Paraskevopoulos
8619f42973 Add helper functions to wsialloc
Moves out the non ion specific code from the wsialloc ion implementation
to a new wsialloc_helpers file.

Change-Id: I7ca816b27eb7e68fd1f138ec7bda006b204c0cbe
Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
2024-10-31 10:40:09 +00:00
Iason Paraskevopoulos
b02486ff87 Extend wsialloc_alloc with disjoint information
Extends wsialloc_alloc to return whether or not the allocation will be
disjoint.

Groups wsialloc_alloc's return values to a struct.

Change-Id: I7542e37d8af16ce7989ab235c02305d562f3c667
Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
2024-06-10 10:00:49 +01:00
Dennis Tsiang
2bc2109194 Add support for VK_EXT_image_compression_control_swapchain
Implement support for VK_EXT_image_compression_control_swapchain
for both the Wayland and the headless windowing systems.
The extension can be conditionally enabled through the new build option
BUILD_WSI_IMAGE_COMPRESSION_CONTROL_SWAPCHAIN. Compiling with this
option enabled requires recent Vulkan headers (1.3.213)
Note also that support in the layer is enabled conditionally to
the ICD supporting VK_EXT_image_compression_control.

Update the WSIALLOC interface to version 2 and add support to
prefer selection of a format with the highest fixed rate compression
from the formats provided. This is used to pick a fixed rate
compression when VK_IMAGE_COMPRESSION_FIXED_RATE_EXPLICIT_EXT is
specified during swapchain creation.

Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
Signed-off-by: Rosen Zhelev <rosen.zhelev@arm.com>
Signed-off-by: Normunds Rieksts <normunds.rieksts@arm.com>
Signed-off-by: Matteo Franchin <matteo.franchin@arm.com>
Change-Id: Ie37e6901042a65f2a408e428a705b5a24227b262
2022-05-25 16:49:52 +01:00
Fufu Fang
c6a38f53c2 Casting operands to a wider type to prevent integer overflow
Previously the calculation for total_size was done in 32-bits, as the
operands were all 32-bit signed or unsigned integers. This led to
integer overflow when the extent being allocated is too large.
total_size is finally cast to size_t, as the kernel UAPI for ION uses
size_t.

Change-Id: I7a76b2c18be25fda0bf6ef70cd8a6fe717c2903c
Signed-off-by: Fufu Fang <fufu.fang@arm.com>
2021-12-10 12:11:30 +00:00
Dennis Tsiang
1701c1fea4 Add versioning to wsialloc interface
The wsialloc interface now has explicit versioning which is used to
ensure that wsialloc implementations are compatible with the interface.
wsialloc implementations should define which version they are using and
upon version mismatch compilation will fail.

Also:
- add new WSIALLOC_MAX_PLANE macro to define the maximum number of
planes that the wsialloc should support.

Change-Id: I211fc4341f249deff0c005d946c483ba47366600
Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
2021-11-15 13:59:10 +00:00
Dennis Tsiang
b348247fbe Fix formatting issues
All files in the project should have an empty line at the EOF. Necessary
for some pre-processing tools.

Change-Id: Ic4502588f2733f669fc1edc898258f8589c484c6
Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
2021-10-29 08:51:25 +00:00
Normunds Rieksts
293ae2ab13 Implement a vendor agnostic wsialloc interface
Refactors the wsialloc interface in the layer.
This patch ensures that wsialloc interface could be ported
to different GPU architectures and systems that could
have different requirements

Change-Id: I6593f2373abc75fb2074700d156ba3797d7ff058
Signed-off-by: Normunds Rieksts <normunds.rieksts@arm.com>
Signed-off-by: Rosen Zhelev <rosen.zhelev@arm.com>
2021-07-28 15:39:11 +00:00
Dennis Tsiang
241e05d3e4 Resolve segfault in wsialloc_delete
A segfault can occur if wsialloc_delete is called but m_wsi_allocator's
ion field has not been allocated yet, as the function attempts to access
the ion properties.

This commit resolves the issue by changing m_wsi_allocator to an opaque
struct and removing the fd property, which was not being used.
wsialloc_new is then changed to return a pointer to the struct and
the swapchain then carries this pointer around, which will be
initialised to nullptr in the swapchain constructor.

Change-Id: I202e967cff4555babf0ddcd387275b74470b09d5
Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
2021-05-05 15:44:32 +01:00
Iason Paraskevopoulos
926cd66fcd Add support for multiplane swapchain images in Wayland
Updates wsialloc and wsi::wayland::swapchain to support multiplane
image allocations.

Uses the custom allocator for allocations in Wayland image creation.

Change-Id: I1950b14b75711a76521bbf1967c3c835d006f8a8
Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
2021-04-23 09:47:31 +01:00
Iason Paraskevopoulos
8dc4d923ff Adds initial support for VK_KHR_wayland_surface.
Very basic Wayland support is implemented by importing
memory with VK_EXT_image_drm_format_modifiers.
The current implementation requires an external system
memory allocator. An API for this allocator is defined
in util/wsialloc/wsialloc.h and an implementation using
the ION memory allocator is included.

Outstanding issues:
 * This is an initial prototype for Wayland support and
   has many outstanding TODOs which need addressing to
   properly use the Wayland protocol.
 * Using ICD Exported memory instead of a system allocator
   is not implemented.

Wayland support is still experimental and outstanding issues
will be fixed in future commits.

Change-Id: I1b0d5991e15ff1cf25ebbab3392a631b021e8c17
Signed-off-by: Rosen Zhelev <rosen.zhelev@arm.com>
Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
2021-02-09 18:22:09 +00:00