vulkan/wsi: Convert usage of -1 to UINT32_MAX. The integers are unsigned so they do the same but this makes it locally more clear what happened. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6071>
vulkan/wsi: Make wsi_swapchain inherit from vk_object_base Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Acked-by: Kristian H. Kristensen <hoegsberg@google.com> Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4690>
vulkan/wsi: Add a driconf option to force WSI to advertise BGRA8_UNORM first The Aztec Ruins benchmark just grabs the first format in the list and SRGB causes it to render washed out. With this workaround, it renders the same as OpenGL. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3350> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3350>
vulkan/wsi/wayland: implement acquire timeout v2: Eric's nits v3: Reuse timespec utils (Daniel) Deal with ppoll being interrupted by a signal (Daniel) v4: Remove unnecessary time check v5: Deal with EAGAIN from wl_display_prepare_read_queue() (Daniel) Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Eric Engestrom <eric.engestrom@intel.com> (v2) Reviewed-by: Daniel Stone <daniels@collabora.com>
wsi/wayland: document lack of vkAcquireNextImageKHR timeout support Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
vulkan/wsi/wayland: Respect non-blocking AcquireNextImage If the client has requested that AcquireNextImage not block at all, with a timeout of 0, then don't make any non-blocking calls. This will still potentially block infinitely given a non-infinte timeout, but the fix for that is much more involved. Signed-off-by: Daniel Stone <daniels@collabora.com> Cc: mesa-stable@lists.freedesktop.org Cc: Chad Versace <chadversary@chromium.org> Cc: Jason Ekstrand <jason@jlekstrand.net> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108540 Acked-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Chad Versace <chadversary@chromium.org> Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
wsi: allow to override the present mode with MESA_VK_WSI_PRESENT_MODE This is common to all Vulkan drivers and all WSI. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
vulkan/wsi: make wl_drm optional When wl_drm is missing and the driver supports modifiers, use zwp_linux_dmabuf_v1 for the list of supported formats and for buffer creation. Limit the supported formats to those with modifiers, which are WL_DRM_FORMAT_{ARGB8888,XRGB8888} currently. Signed-off-by: Chia-I Wu <olvaffe@gmail.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
vulkan/wsi: add wsi_wl_display_dmabuf Add wsi_wl_display_dmabuf for zwp_linux_dmabuf_v1-related states. Signed-off-by: Chia-I Wu <olvaffe@gmail.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
vulkan/wsi: add wsi_wl_display_drm Add wsi_wl_display_drm for wl_drm-related states. We will move formats into the struct in a later commit. Remove the unnecessary check for wl_registry_bind failures. Signed-off-by: Chia-I Wu <olvaffe@gmail.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
vulkan/wsi: refactor drm_handle_format Refactor the swtich statement in drm_handle_format out to wsi_wl_display_add_wl_format. Signed-off-by: Chia-I Wu <olvaffe@gmail.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
vulkan/wsi: create wl_drm wrapper as needed When modifiers are specified, we have to use dmabuf rather than wl_drm. We don't need the wrapper in that case. Signed-off-by: Chia-I Wu <olvaffe@gmail.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
vulkan/wsi: move modifier array into wsi_wl_swapchain This avoids repeated checks for each wsi_wl_image. Signed-off-by: Chia-I Wu <olvaffe@gmail.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
anv,radv: Implement VK_KHR_surface_capability_protected Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Reviewed-by: Eric Engestrom <eric@engestrom.ch>
wsi/wayland: fix pointer casting warning on 32bit Signed-off-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
drm-uapi: use local files, not system libdrm There was an issue recently caused by the system header being included by mistake, so let's just get rid of this include path and always explicitly #include "drm-uapi/FOO.h" Signed-off-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org>
wsi: query the ICD's max dimensions instead of hard-coding them anv and radv both happened to already return 2^14 for these, but querying the ICD is safer and will help if vdreno (or whatever it's called) doesn't have the same max. Signed-off-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
vulkan: Allow storage images in the WSI. Since apps also have to follow the ImageFormatProperties query, we can disallow formats that don't allow image stores (for AMD that would be SRGB formats). Note that this only affects anything if the app actually decides to use the flag. Had someone ask for this on IRC and at least on the AMD side we can support it. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
wsi/wayland: only finish() a successfully init()ed display Fixes: 43691024982b3ea734ad0 "vulkan/wsi/wayland: Stop caching Wayland displays" Signed-off-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
wsi/wayland: use proper VkResult type Signed-off-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Dave Airlie <airlied@redhat.com>