Similar to how support for X11's DRI2 protocol was deprecated in 24.2,
begin deprecating EGL_WL_bind_wayland_display (including
eglBindWaylandDisplayWL et al) by moving it behind a legacy-wayland
build option.
This extension was originally created in a pre-dmabuf world, where we
didn't have a universally-accepted way of exchanging buffers between
client and compositor, or even really the ability to describe formats
and modifiers universally.
Since then, the world has settled on dmabuf with DRM FourCC and
modifiers. We've had the zwp_linux_dmabuf_v1 protocol for 10 years now:
both clients and compositors implement this protocol to handle buffer
sharing. Compositors either use EGL_EXT_image_dma_buf_import or the
Vulkan dmabuf extensions to import these into GPU world.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36026>
The current wsi_common_get_image api is mainly used for aliased wsi
image binding. However, it's not a convenient api because what's missing
is the swapchain image memory bound, with which we can trivially fix the
VkBindImageMemoryInfo so it works just like a normal binding request
from the driver pov. To be noted, besides the simplification of the
driver codes, this helper is also to prepare for common BindImageMemory2
implementation.
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35875>
The existing common ANB helpers are declared under DETECT_OS_ANDROID but
the implementations are hidden further behind ANDROID_API_LEVEL >= 26,
which is not right.
In addition, for the sanity, let's move front buffer usage query behind
api level 26, while moving baseline ANB entry points above the
conditional api level scope.
In the future, we should look to drop below 26 support (basically drop
Android N support where Vulkan 1.0.3 was initially supported).
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35785>
No need to check the baseline support since that's part of core, and the
extended support is checked from vkGetPhysicalDeviceSurfaceFormatsKHR by
the platform against both gralloc and the driver.
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35785>
The composer usage bit is automatically added by the surface consumer
side when the consumer is SurfaceFlinger. e.g. if the swapchain is
connected with a media encoder surface, the consumer side would append
encoder usage bit instead.
Fixes: c406d53858 ("vulkan/android: Add common vkGetSwapchainGrallocUsage{2}ANDROID")
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35785>
The prime blit dst buffer can be backed by external memory, no matter
host ptr shm or dma-buf export alloc. Whether the external path is taken
is only decided upon blit ctx creation time, so we have to track whether
external in the wsi_image. When the external path is taken, we have to
explicitly handle queue family ownership transfer from internal to
foreign. To be noted, no explicit foreign to internal ownership transfer
is needed since the blit dst content can be left undefined.
Reviewed-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35034>
For non-external blit dst buffer, it's bliting the wsi image to a buffer
with mapping populated by vkMapMemory, and it's shared via xcb_put_image
for x11 or memcpy into a shared wl_buffer backed by shm. So we need
additional host stage and host access bit to ensure proper cache flush.
There's no queue family ownership transfer needed.
Reviewed-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35034>
AMD hardware can early-cull box nodes if all leaves are either opaque or
not and the ray flags are set to discard (non-)opaque geometries. This
works even across TLAS/BLAS boundaries.
Propagate info on whether all child nodes are opaque or not through the
BVH to allow RADV to set these flags per box node.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32417>
These generator scripts use the `write` function that, unlike `print`,
doesn't print a trailing newline. So let's add one to the template.
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35697>
It is annoying to change all function signatures when a driver needs
more information. There are also some callbacks that have a lot of
parameters and there have already been bugs related to that.
This patch tries to clean the interface by adding a struct that contains
all information that might be relevant for the driver and passing that
to most callbacks.
radv changes are:
Reviewed-by: Natalie Vock <natalie.vock@gmx.de>
anv changes are:
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
turnip changes are:
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
vulkan runtime changes are:
Reviewed-by: Natalie Vock <natalie.vock@gmx.de>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35385>
When front buffer rendering is supported, the returned usage bit is
non-zero. Return zero for all other cases including uninitialized
gralloc.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35568>
This should help vk-icd-loader skip libraries of the wrong bit width.
Reviewed-by: Eric Engestrom <eric@igalia.com>
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35567>
It's ill-defined at best since it doesn't even initialize the
vk_object_base and its only use was NVK and that use is now gone.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35624>
This struct gathers up all the sampler state from VkSamplerCreateInfo
and its pNext chain into a single struct. The struct is has no pointers
and has uses -Wpadded to ensure no holes. This means it's hashable and
mem-comparable. We also make give vk_ycbcr_conversion_state -Wpadded
because vk_sampler_state has a copy of vk_ycbcr_conversion_state
embedded in it.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35624>
There's no need for a per driver HMI implementation since the
vk_icdGetInstanceProcAddr implementation can well populate the required
entrypoints for Android icd.
Changes have to be done in this single commit for simplicity. Otherwise,
I would have to create a separate android shared library in the runtime
like how vk_instance is handled today, so that the target is able to
check per driver enablement def. However, after all drivers have
migrated over within this MR, we still have to clean those up. So I
decided to just do those in a single commit instead.
v2: avoid preloading u_gralloc in vulkan hal open
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> (v1)
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35561>
Initialize u_gralloc once upon the initial init or get call. We'll skip
updating the backend drivers for this since most usages will be cleaned
up later.
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Acked-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35561>
...to avoid mixing up with type name and local returns from getter.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Acked-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35561>
Add common code for PresentWait2.
Unlike PresentWait, PresentWait2 is exposed by a surface capability.
On Wayland, PresentWait (and PresentWait2) require the presentation-time
extension to be available for a proper implementation, but not all
compositors support this. PresentWait would either have to be exposed
nowhere, or have weird/complicated fallback paths to try to enable it
on systems where presentation-time is unavailable.
Since PresentWait2 has a surface capability, we can simply not expose it
on Wayland when present-time is unavailable instead of always having to
have a less compliant fallback path.
PresentWait2 also explicitly forbids waiting on an ID that hasn't been
queued for presentation, so we don't need to handle that weird case.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35414>
Because the ASTC HDR formats are extension formats, we need to convert
it manually in vk_format_to_pipe_format() instead of using the table.
Otherwise, the compiler tries to create a gigantic array and ends up
dying.
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34828>