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