Files
packages/anda/lib/mesa/bazzite.patch
T
Raboneko a730b893ac feat: Update for Mesa 25.3 (#7660) (#7700)
* feat: Update for Mesa 25.3
feat: Enable AMD Virtio support



* Update anda/lib/mesa/mesa.spec




---------



(cherry picked from commit 5013df18ee)

Signed-off-by: Kyle Gospodnetich <me@kylegospodneti.ch>
Co-authored-by: Kyle Gospodnetich <me@kylegospodneti.ch>
Co-authored-by: Gilver <rockgrub@disroot.org>
2025-11-25 20:19:52 -06:00

526 lines
21 KiB
Diff

From 822117cacfa1eb2f327734c9b95739b7882c17ae Mon Sep 17 00:00:00 2001
From: Kyle Gospodnetich <me@kylegospodneti.ch>
Date: Mon, 24 Nov 2025 21:07:27 -0800
Subject: [PATCH 1/8] [BEGIN] SteamOS Changes
--
2.52.0
From 94b012e3b5858db415b4fff612df61667ea85f7b Mon Sep 17 00:00:00 2001
From: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Date: Fri, 14 Jan 2022 15:58:45 +0100
Subject: [PATCH 2/8] STEAMOS: radv: min image count override for FH5
Otherwise in combination with the vblank time reservation in
gamescope the game could get stuck in low power states.
---
src/util/00-radv-defaults.conf | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/util/00-radv-defaults.conf b/src/util/00-radv-defaults.conf
index e36357b9e4a..68a1957ee7b 100644
--- a/src/util/00-radv-defaults.conf
+++ b/src/util/00-radv-defaults.conf
@@ -311,5 +311,9 @@ Application bugs worked around in this file:
<application name="No Man's Sky" application_name_match="No Man's Sky">
<option name="radv_app_layer" value="no_mans_sky" />
</application>
+
+ <application name="Forza Horizon 5" application_name_match="ForzaHorizon5.exe">
+ <option name="vk_x11_override_min_image_count" value="4" />
+ </application>
</device>
</driconf>
--
2.52.0
From 482112717feaee42098c18eb9143d5afd6f5e173 Mon Sep 17 00:00:00 2001
From: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Date: Thu, 22 Feb 2024 22:32:45 +0100
Subject: [PATCH 3/8] STEAMOS: Dynamic swapchain override for gamescope limiter
for DRI3 only
The original patch (from Bas) contained WSI VK support too but it's
been removed because the Gamescope WSI layer already handles that.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
---
.../frontends/dri/loader_dri3_helper.c | 42 ++++++++++++++++++-
.../frontends/dri/loader_dri3_helper.h | 1 +
2 files changed, 41 insertions(+), 2 deletions(-)
diff --git a/src/gallium/frontends/dri/loader_dri3_helper.c b/src/gallium/frontends/dri/loader_dri3_helper.c
index 2c8caba08fd..2c9159672dc 100644
--- a/src/gallium/frontends/dri/loader_dri3_helper.c
+++ b/src/gallium/frontends/dri/loader_dri3_helper.c
@@ -297,6 +297,30 @@ dri3_update_max_num_back(struct loader_dri3_drawable *draw)
}
}
+static unsigned
+gamescope_swapchain_override()
+{
+ const char *path = getenv("GAMESCOPE_LIMITER_FILE");
+ if (!path)
+ return 0;
+
+ static simple_mtx_t mtx = SIMPLE_MTX_INITIALIZER;
+ static int fd = -1;
+
+ simple_mtx_lock(&mtx);
+ if (fd < 0) {
+ fd = open(path, O_RDONLY);
+ }
+ simple_mtx_unlock(&mtx);
+
+ if (fd < 0)
+ return 0;
+
+ uint32_t override_value = 0;
+ pread(fd, &override_value, sizeof(override_value), 0);
+ return override_value;
+}
+
void
loader_dri3_set_swap_interval(struct loader_dri3_drawable *draw, int interval)
{
@@ -311,10 +335,12 @@ loader_dri3_set_swap_interval(struct loader_dri3_drawable *draw, int interval)
* PS. changing from value A to B and A < B won't cause swap out of order but
* may still gets wrong target_msc value at the beginning.
*/
- if (draw->swap_interval != interval)
+ if (draw->orig_swap_interval != interval)
loader_dri3_swapbuffer_barrier(draw);
- draw->swap_interval = interval;
+ draw->orig_swap_interval = interval;
+ if (gamescope_swapchain_override() != 1)
+ draw->swap_interval = interval;
}
static void
@@ -443,6 +469,12 @@ loader_dri3_drawable_init(xcb_connection_t *conn,
draw->swap_interval = dri_get_initial_swap_interval(draw->dri_screen_render_gpu);
+ draw->orig_swap_interval = draw->swap_interval;
+
+ unsigned gamescope_override = gamescope_swapchain_override();
+ if (gamescope_override == 1)
+ draw->swap_interval = 1;
+
dri3_update_max_num_back(draw);
/* Create a new drawable */
@@ -1085,6 +1117,12 @@ loader_dri3_swap_buffers_msc(struct loader_dri3_drawable *draw,
if (draw->type == LOADER_DRI3_DRAWABLE_WINDOW) {
dri3_fence_reset(draw->conn, back);
+ unsigned gamescope_override = gamescope_swapchain_override();
+ if (gamescope_override == 1)
+ draw->swap_interval = 1;
+ else
+ draw->swap_interval = draw->orig_swap_interval;
+
/* Compute when we want the frame shown by taking the last known
* successful MSC and adding in a swap interval for each outstanding swap
* request. target_msc=divisor=remainder=0 means "Use glXSwapBuffers()
diff --git a/src/gallium/frontends/dri/loader_dri3_helper.h b/src/gallium/frontends/dri/loader_dri3_helper.h
index 26f138d1b83..3f0f3f66fac 100644
--- a/src/gallium/frontends/dri/loader_dri3_helper.h
+++ b/src/gallium/frontends/dri/loader_dri3_helper.h
@@ -169,6 +169,7 @@ struct loader_dri3_drawable {
bool block_on_depleted_buffers;
bool queries_buffer_age;
int swap_interval;
+ int orig_swap_interval;
const struct loader_dri3_vtable *vtable;
--
2.52.0
From 46d91c20dfb4f314a6e261ef4f1ae7ae65d90569 Mon Sep 17 00:00:00 2001
From: Kyle Gospodnetich <me@kylegospodneti.ch>
Date: Mon, 24 Nov 2025 21:08:23 -0800
Subject: [PATCH 4/8] [BEGIN] SteamOS Backports
--
2.52.0
From 6823720adcf0fc209bcc341999b3e3fe76b6c189 Mon Sep 17 00:00:00 2001
From: Kyle Gospodnetich <me@kylegospodneti.ch>
Date: Mon, 24 Nov 2025 21:08:31 -0800
Subject: [PATCH 5/8] [BEGIN] Our Mesa Backports
--
2.52.0
From 227cd7d88802583e47ea3c7ff006103266330ec9 Mon Sep 17 00:00:00 2001
From: Antheas Kapenekakis <git@antheas.dev>
Date: Mon, 24 Mar 2025 19:50:51 +0100
Subject: [PATCH 6/8] Revert "winsys/amdgpu: use VM_ALWAYS_VALID for all VRAM
and GTT allocations"
This reverts commit 8c91624614c1f939974fe0d2d1a3baf83335cecb.
Messes with AutoVRAM, who would have thought?
---
src/gallium/winsys/amdgpu/drm/amdgpu_bo.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c
index ce4e9f67659..47703444abf 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c
@@ -624,11 +624,6 @@ static struct amdgpu_winsys_bo *amdgpu_create_bo(struct amdgpu_winsys *aws,
if (flags & RADEON_FLAG_GTT_WC)
request.flags |= AMDGPU_GEM_CREATE_CPU_GTT_USWC;
- if (aws->info.has_vm_always_valid &&
- initial_domain & (RADEON_DOMAIN_VRAM_GTT | RADEON_DOMAIN_DOORBELL) &&
- flags & RADEON_FLAG_NO_INTERPROCESS_SHARING)
- request.flags |= AMDGPU_GEM_CREATE_VM_ALWAYS_VALID;
-
if (flags & RADEON_FLAG_DISCARDABLE &&
aws->info.drm_minor >= 47)
request.flags |= AMDGPU_GEM_CREATE_DISCARDABLE;
--
2.52.0
From 4f1a882f75edd79690610135738f5d5317263ffd Mon Sep 17 00:00:00 2001
From: Kyle Gospodnetich <me@kylegospodneti.ch>
Date: Mon, 24 Nov 2025 21:09:02 -0800
Subject: [PATCH 7/8] [BEGIN] Proton-GE Patches
--
2.52.0
From 59eb16ed2551892c18d75e146a29a213964aee6b Mon Sep 17 00:00:00 2001
From: Kyle Gospodnetich <me@kylegospodneti.ch>
Date: Sun, 18 May 2025 09:42:23 -0700
Subject: [PATCH 8/8] radv: min image count patch for Wine Wayland/Path of
Exile 2 Credit to Glorious Eggroll.
---
src/amd/vulkan/radv_instance.c | 2 +-
src/asahi/vulkan/hk_instance.c | 2 +-
src/freedreno/vulkan/tu_device.cc | 2 +-
src/intel/vulkan/anv_instance.c | 2 +-
src/intel/vulkan_hasvk/anv_device.c | 2 +-
src/nouveau/vulkan/nvk_instance.c | 2 +-
src/panfrost/vulkan/panvk_instance.c | 2 +-
src/util/00-mesa-defaults.conf | 10 ++++++----
src/util/driconf.h | 4 ++--
src/virtio/vulkan/vn_instance.c | 2 +-
src/vulkan/wsi/wsi_common.c | 2 +-
src/vulkan/wsi/wsi_common.h | 4 ++++
src/vulkan/wsi/wsi_common_private.h | 3 ++-
src/vulkan/wsi/wsi_common_wayland.c | 21 +++++++++++++++++----
src/vulkan/wsi/wsi_common_x11.c | 4 ++--
15 files changed, 42 insertions(+), 22 deletions(-)
diff --git a/src/amd/vulkan/radv_instance.c b/src/amd/vulkan/radv_instance.c
index c43b8f9a00c..fb0db9769e6 100644
--- a/src/amd/vulkan/radv_instance.c
+++ b/src/amd/vulkan/radv_instance.c
@@ -154,7 +154,7 @@ static const struct debug_control trace_options[] = {
static const driOptionDescription radv_dri_options[] = {
DRI_CONF_SECTION_PERFORMANCE
DRI_CONF_ADAPTIVE_SYNC(true)
- DRI_CONF_VK_X11_OVERRIDE_MIN_IMAGE_COUNT(0)
+ DRI_CONF_VK_OVERRIDE_MIN_IMAGE_COUNT(0)
DRI_CONF_VK_X11_STRICT_IMAGE_COUNT(false)
DRI_CONF_VK_X11_ENSURE_MIN_IMAGE_COUNT(false)
DRI_CONF_VK_XWAYLAND_WAIT_READY(false)
diff --git a/src/asahi/vulkan/hk_instance.c b/src/asahi/vulkan/hk_instance.c
index 1fd2c844681..a872018d923 100644
--- a/src/asahi/vulkan/hk_instance.c
+++ b/src/asahi/vulkan/hk_instance.c
@@ -80,7 +80,7 @@ hk_EnumerateInstanceExtensionProperties(const char *pLayerName,
static const driOptionDescription hk_dri_options[] = {
DRI_CONF_SECTION_PERFORMANCE
DRI_CONF_ADAPTIVE_SYNC(true)
- DRI_CONF_VK_X11_OVERRIDE_MIN_IMAGE_COUNT(0)
+ DRI_CONF_VK_OVERRIDE_MIN_IMAGE_COUNT(0)
DRI_CONF_VK_X11_STRICT_IMAGE_COUNT(false)
DRI_CONF_VK_X11_ENSURE_MIN_IMAGE_COUNT(false)
DRI_CONF_VK_XWAYLAND_WAIT_READY(false)
diff --git a/src/freedreno/vulkan/tu_device.cc b/src/freedreno/vulkan/tu_device.cc
index 05ffad6424d..e32862161de 100644
--- a/src/freedreno/vulkan/tu_device.cc
+++ b/src/freedreno/vulkan/tu_device.cc
@@ -1748,7 +1748,7 @@ tu_destroy_physical_device(struct vk_physical_device *device)
static const driOptionDescription tu_dri_options[] = {
DRI_CONF_SECTION_PERFORMANCE
- DRI_CONF_VK_X11_OVERRIDE_MIN_IMAGE_COUNT(0)
+ DRI_CONF_VK_OVERRIDE_MIN_IMAGE_COUNT(0)
DRI_CONF_VK_X11_STRICT_IMAGE_COUNT(false)
DRI_CONF_VK_X11_ENSURE_MIN_IMAGE_COUNT(false)
DRI_CONF_VK_XWAYLAND_WAIT_READY(false)
diff --git a/src/intel/vulkan/anv_instance.c b/src/intel/vulkan/anv_instance.c
index 73a46dc72ee..b51b055ca7b 100644
--- a/src/intel/vulkan/anv_instance.c
+++ b/src/intel/vulkan/anv_instance.c
@@ -10,7 +10,7 @@
static const driOptionDescription anv_dri_options[] = {
DRI_CONF_SECTION_PERFORMANCE
DRI_CONF_ADAPTIVE_SYNC(true)
- DRI_CONF_VK_X11_OVERRIDE_MIN_IMAGE_COUNT(0)
+ DRI_CONF_VK_OVERRIDE_MIN_IMAGE_COUNT(0)
DRI_CONF_VK_X11_STRICT_IMAGE_COUNT(false)
DRI_CONF_VK_XWAYLAND_WAIT_READY(false)
DRI_CONF_ANV_ASSUME_FULL_SUBGROUPS(0)
diff --git a/src/intel/vulkan_hasvk/anv_device.c b/src/intel/vulkan_hasvk/anv_device.c
index d111c96ae7a..42e3f82eff9 100644
--- a/src/intel/vulkan_hasvk/anv_device.c
+++ b/src/intel/vulkan_hasvk/anv_device.c
@@ -66,7 +66,7 @@
static const driOptionDescription anv_dri_options[] = {
DRI_CONF_SECTION_PERFORMANCE
DRI_CONF_ADAPTIVE_SYNC(true)
- DRI_CONF_VK_X11_OVERRIDE_MIN_IMAGE_COUNT(0)
+ DRI_CONF_VK_OVERRIDE_MIN_IMAGE_COUNT(0)
DRI_CONF_VK_X11_STRICT_IMAGE_COUNT(false)
DRI_CONF_VK_XWAYLAND_WAIT_READY(true)
DRI_CONF_ANV_ASSUME_FULL_SUBGROUPS(0)
diff --git a/src/nouveau/vulkan/nvk_instance.c b/src/nouveau/vulkan/nvk_instance.c
index e2413045455..2261dc080a8 100644
--- a/src/nouveau/vulkan/nvk_instance.c
+++ b/src/nouveau/vulkan/nvk_instance.c
@@ -98,7 +98,7 @@ nvk_init_debug_flags(struct nvk_instance *instance)
static const driOptionDescription nvk_dri_options[] = {
DRI_CONF_SECTION_PERFORMANCE
DRI_CONF_ADAPTIVE_SYNC(true)
- DRI_CONF_VK_X11_OVERRIDE_MIN_IMAGE_COUNT(0)
+ DRI_CONF_VK_OVERRIDE_MIN_IMAGE_COUNT(0)
DRI_CONF_VK_X11_STRICT_IMAGE_COUNT(false)
DRI_CONF_VK_X11_ENSURE_MIN_IMAGE_COUNT(false)
DRI_CONF_VK_XWAYLAND_WAIT_READY(false)
diff --git a/src/panfrost/vulkan/panvk_instance.c b/src/panfrost/vulkan/panvk_instance.c
index bb425414bb1..39f137d5ab3 100644
--- a/src/panfrost/vulkan/panvk_instance.c
+++ b/src/panfrost/vulkan/panvk_instance.c
@@ -178,7 +178,7 @@ panvk_kmod_free(const struct pan_kmod_allocator *allocator, void *data)
static const driOptionDescription panvk_dri_options[] = {
DRI_CONF_SECTION_PERFORMANCE
DRI_CONF_ADAPTIVE_SYNC(true)
- DRI_CONF_VK_X11_OVERRIDE_MIN_IMAGE_COUNT(0)
+ DRI_CONF_VK_OVERRIDE_MIN_IMAGE_COUNT(0)
DRI_CONF_VK_X11_STRICT_IMAGE_COUNT(false)
DRI_CONF_VK_X11_ENSURE_MIN_IMAGE_COUNT(false)
DRI_CONF_VK_XWAYLAND_WAIT_READY(false)
diff --git a/src/util/00-mesa-defaults.conf b/src/util/00-mesa-defaults.conf
index b09512adfbb..bd816765bf0 100644
--- a/src/util/00-mesa-defaults.conf
+++ b/src/util/00-mesa-defaults.conf
@@ -639,24 +639,24 @@ TODO: document the other workarounds.
<application name="gfxbench" executable="testfw_app">
<option name="mesa_glthread_app_profile" value="0" />
- <option name="vk_x11_override_min_image_count" value="2" />
+ <option name="vk_override_min_image_count" value="2" />
<option name="vk_wsi_force_bgra8_unorm_first" value="true" />
</application>
<application name="Rainbow Six Siege (Vulkan)" executable="RainbowSix_Vulkan.exe">
- <option name="vk_x11_override_min_image_count" value="2" />
+ <option name="vk_override_min_image_count" value="2" />
<option name="vk_x11_strict_image_count" value="true" />
</application>
<application name="Rainbow Six Extraction (Wine)" executable="R6-Extraction.exe">
- <option name="vk_x11_override_min_image_count" value="2" />
+ <option name="vk_override_min_image_count" value="2" />
<option name="vk_x11_strict_image_count" value="true" />
</application>
<!-- Workaround for Hades: Vulkan backend of the game is not starting
if the implementation returns more than 3 swapchain images. -->
<application name="Hades" executable="Hades.exe">
- <option name="vk_x11_override_min_image_count" value="3" />
+ <option name="vk_override_min_image_count" value="3" />
<option name="vk_x11_strict_image_count" value="true" />
</application>
@@ -717,10 +717,12 @@ TODO: document the other workarounds.
<application name="Path of Exile" executable="PathOfExile_x64Steam.exe">
<option name="vk_zero_vram" value="true" />
+ <option name="vk_override_min_image_count" value="3" />
</application>
<application name="Path of Exile" executable="PathOfExileSteam.exe">
<option name="vk_zero_vram" value="true" />
+ <option name="vk_override_min_image_count" value="3" />
</application>
<application name="X4 Foundations" executable="X4">
diff --git a/src/util/driconf.h b/src/util/driconf.h
index 45ed8a40579..84934b24dd9 100644
--- a/src/util/driconf.h
+++ b/src/util/driconf.h
@@ -453,8 +453,8 @@
DRI_CONF_OPT_B(vk_wsi_disable_unordered_submits, def, \
"Disable unordered WSI submits to workaround application synchronization bugs")
-#define DRI_CONF_VK_X11_OVERRIDE_MIN_IMAGE_COUNT(def) \
- DRI_CONF_OPT_I(vk_x11_override_min_image_count, def, 0, 999, \
+#define DRI_CONF_VK_OVERRIDE_MIN_IMAGE_COUNT(def) \
+ DRI_CONF_OPT_I(vk_override_min_image_count, def, 0, 999, \
"Override the VkSurfaceCapabilitiesKHR::minImageCount (0 = no override)")
#define DRI_CONF_VK_X11_STRICT_IMAGE_COUNT(def) \
diff --git a/src/virtio/vulkan/vn_instance.c b/src/virtio/vulkan/vn_instance.c
index 523f0590e9a..b1f642f1c2e 100644
--- a/src/virtio/vulkan/vn_instance.c
+++ b/src/virtio/vulkan/vn_instance.c
@@ -70,8 +70,8 @@ static const struct vk_instance_extension_table
static const driOptionDescription vn_dri_options[] = {
/* clang-format off */
DRI_CONF_SECTION_PERFORMANCE
+ DRI_CONF_VK_OVERRIDE_MIN_IMAGE_COUNT(0)
DRI_CONF_VK_X11_ENSURE_MIN_IMAGE_COUNT(false)
- DRI_CONF_VK_X11_OVERRIDE_MIN_IMAGE_COUNT(0)
DRI_CONF_VK_X11_STRICT_IMAGE_COUNT(false)
DRI_CONF_VK_XWAYLAND_WAIT_READY(true)
DRI_CONF_VENUS_IMPLICIT_FENCING(false)
diff --git a/src/vulkan/wsi/wsi_common.c b/src/vulkan/wsi/wsi_common.c
index 362e50f2aec..2d22e6bfc3d 100644
--- a/src/vulkan/wsi/wsi_common.c
+++ b/src/vulkan/wsi/wsi_common.c
@@ -220,7 +220,7 @@ wsi_device_init(struct wsi_device *wsi,
#endif
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
- result = wsi_wl_init_wsi(wsi, alloc, pdevice);
+ result = wsi_wl_init_wsi(wsi, alloc, pdevice, dri_options);
if (result != VK_SUCCESS)
goto fail;
#endif
diff --git a/src/vulkan/wsi/wsi_common.h b/src/vulkan/wsi/wsi_common.h
index abe771b5bfc..d67f953c42a 100644
--- a/src/vulkan/wsi/wsi_common.h
+++ b/src/vulkan/wsi/wsi_common.h
@@ -161,6 +161,10 @@ struct wsi_device {
struct {
/* Don't use the commit-timing protocol for pacing */
bool disable_timestamps;
+
+ /* Override the minimum number of images on the swapchain.
+ * 0 = no override */
+ double override_minImageCount;
} wayland;
/*
diff --git a/src/vulkan/wsi/wsi_common_private.h b/src/vulkan/wsi/wsi_common_private.h
index 9fe64cfba95..c20174f6175 100644
--- a/src/vulkan/wsi/wsi_common_private.h
+++ b/src/vulkan/wsi/wsi_common_private.h
@@ -456,7 +456,8 @@ void wsi_x11_finish_wsi(struct wsi_device *wsi_device,
const VkAllocationCallbacks *alloc);
VkResult wsi_wl_init_wsi(struct wsi_device *wsi_device,
const VkAllocationCallbacks *alloc,
- VkPhysicalDevice physical_device);
+ VkPhysicalDevice physical_device,
+ const struct driOptionCache *dri_options);
void wsi_wl_finish_wsi(struct wsi_device *wsi_device,
const VkAllocationCallbacks *alloc);
VkResult wsi_win32_init_wsi(struct wsi_device *wsi_device,
diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c
index cf3749be6d4..04278d3c8a3 100644
--- a/src/vulkan/wsi/wsi_common_wayland.c
+++ b/src/vulkan/wsi/wsi_common_wayland.c
@@ -58,6 +58,7 @@
#include <util/u_dynarray.h>
#include <util/anon_file.h>
#include <util/os_time.h>
+#include <util/xmlconfig.h>
#include <loader/loader_wayland_helper.h>
@@ -1703,9 +1704,12 @@ wsi_wl_surface_get_support(VkIcdSurfaceBase *surface,
#define WSI_WL_DEFAULT_NUM_IMAGES 3
static uint32_t
-wsi_wl_surface_get_min_image_count(struct wsi_wl_display *display,
+wsi_wl_surface_get_min_image_count(struct wsi_device *wsi_device, struct wsi_wl_display *display,
const VkSurfacePresentModeEXT *present_mode)
{
+ if (wsi_device->wayland.override_minImageCount)
+ return wsi_device->wayland.override_minImageCount;
+
if (present_mode) {
return present_mode->presentMode == VK_PRESENT_MODE_MAILBOX_KHR ?
WSI_WL_BUMPED_NUM_IMAGES : WSI_WL_DEFAULT_NUM_IMAGES;
@@ -1754,7 +1758,7 @@ wsi_wl_surface_get_capabilities(VkIcdSurfaceBase *icd_surface,
display = &temp_display;
}
- caps->minImageCount = wsi_wl_surface_get_min_image_count(display, present_mode);
+ caps->minImageCount = wsi_wl_surface_get_min_image_count(wsi_device, display, present_mode);
if (!wsi_wl_surface->display)
wsi_wl_display_finish(&temp_display);
@@ -3516,7 +3520,7 @@ wsi_wl_surface_create_swapchain(VkIcdSurfaceBase *icd_surface,
const VkSurfacePresentModeEXT mode =
{ VK_STRUCTURE_TYPE_SURFACE_PRESENT_MODE_EXT, NULL, pCreateInfo->presentMode };
- uint32_t min_images = wsi_wl_surface_get_min_image_count(wsi_wl_surface->display, &mode);
+ uint32_t min_images = wsi_wl_surface_get_min_image_count(wsi_device, wsi_wl_surface->display, &mode);
bool requires_image_count_bump = min_images == WSI_WL_BUMPED_NUM_IMAGES;
if (requires_image_count_bump)
num_images = MAX2(min_images, num_images);
@@ -3711,7 +3715,8 @@ fail:
VkResult
wsi_wl_init_wsi(struct wsi_device *wsi_device,
const VkAllocationCallbacks *alloc,
- VkPhysicalDevice physical_device)
+ VkPhysicalDevice physical_device,
+ const struct driOptionCache *dri_options)
{
struct wsi_wayland *wsi;
VkResult result;
@@ -3737,6 +3742,14 @@ wsi_wl_init_wsi(struct wsi_device *wsi_device,
wsi_device->wsi[VK_ICD_WSI_PLATFORM_WAYLAND] = &wsi->base;
+ if (dri_options)
+ {
+ if (driCheckOption(dri_options, "vk_override_min_image_count", DRI_INT)) {
+ wsi_device->wayland.override_minImageCount =
+ driQueryOptioni(dri_options, "vk_override_min_image_count");
+ }
+ }
+
return VK_SUCCESS;
fail:
diff --git a/src/vulkan/wsi/wsi_common_x11.c b/src/vulkan/wsi/wsi_common_x11.c
index 2cd023dadcf..7872a2a899f 100644
--- a/src/vulkan/wsi/wsi_common_x11.c
+++ b/src/vulkan/wsi/wsi_common_x11.c
@@ -2924,9 +2924,9 @@ wsi_x11_init_wsi(struct wsi_device *wsi_device,
}
if (dri_options) {
- if (driCheckOption(dri_options, "vk_x11_override_min_image_count", DRI_INT)) {
+ if (driCheckOption(dri_options, "vk_override_min_image_count", DRI_INT)) {
wsi_device->x11.override_minImageCount =
- driQueryOptioni(dri_options, "vk_x11_override_min_image_count");
+ driQueryOptioni(dri_options, "vk_override_min_image_count");
}
if (driCheckOption(dri_options, "vk_x11_strict_image_count", DRI_BOOL)) {
wsi_device->x11.strict_imageCount =
--
2.52.0