diff --git a/.gitignore b/.gitignore index e7cdf56..b67dc2c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,11 @@ -SOURCES/libclc-20.1.3.src.tar.xz -SOURCES/mesa-25.0.7.tar.xz -SOURCES/meson-1.3.0.tar.gz -SOURCES/spirv-llvm-translator-834db1a.tar.gz -SOURCES/wayland-protocols-1.38.tar.xz +SOURCES/libclc-21.1.3.src.tar.xz +SOURCES/mesa-25.2.7.tar.xz +SOURCES/meson-1.7.0.tar.gz +SOURCES/paste-1.0.15.tar.gz +SOURCES/proc-macro2-1.0.101.tar.gz +SOURCES/quote-1.0.40.tar.gz +SOURCES/rustc-hash-2.1.1.tar.gz +SOURCES/spirv-llvm-translator-a37544f.tar.gz +SOURCES/syn-2.0.106.tar.gz +SOURCES/unicode-ident-1.0.18.tar.gz +SOURCES/wayland-protocols-1.41.tar.xz diff --git a/.mesa.metadata b/.mesa.metadata index 6f99e1b..cb81b15 100644 --- a/.mesa.metadata +++ b/.mesa.metadata @@ -1,5 +1,11 @@ -0d3fda8d6ac128ead0883253008c24f16b7d3848 SOURCES/libclc-20.1.3.src.tar.xz -7f98eca4670fe20cebb327a0d78f01d76332f861 SOURCES/mesa-25.0.7.tar.xz -6e2c98cccd1b85d5fe8716e7b0f6f080acd77f37 SOURCES/meson-1.3.0.tar.gz -23de2f0b60789090c06f33ea7293d862b0362af4 SOURCES/spirv-llvm-translator-834db1a.tar.gz -3fbb7095a8a33e8465351c25ff1fc01bedeafacd SOURCES/wayland-protocols-1.38.tar.xz +3dcfd76b6097774d3c8f2bb05e920c12fb5e18f0 SOURCES/libclc-21.1.3.src.tar.xz +43e42024911f1fc54044d703efb5f0cb050db44e SOURCES/mesa-25.2.7.tar.xz +df69d7e60fd4d502d2b717b35d35924c017f3068 SOURCES/meson-1.7.0.tar.gz +9daa82dceaa495951cc92ad83879d99cc04969af SOURCES/paste-1.0.15.tar.gz +47e47f5da2396a4befa61a36469efa1ecb2b34f4 SOURCES/proc-macro2-1.0.101.tar.gz +be7844434db89e988fec5a48aea5f5a768721dc9 SOURCES/quote-1.0.40.tar.gz +f144c32f41afa29f6e09c0ceefcc458b291c5bff SOURCES/rustc-hash-2.1.1.tar.gz +b4bafa76d4fa5f05e8f0307b366c0b412041ce9e SOURCES/spirv-llvm-translator-a37544f.tar.gz +ebffd7f7aad4984cb2ec79956c93b3ade7e40bf6 SOURCES/syn-2.0.106.tar.gz +b58aa62ecd755071e241408ef4e78e3baeca019c SOURCES/unicode-ident-1.0.18.tar.gz +523b591f54e788d3117718096228b2cb6e999f2d SOURCES/wayland-protocols-1.41.tar.xz diff --git a/SOURCES/0001-Revert-dri-fix-__DRI_IMAGE_FORMAT-to-PIPE_FORMAT-map.patch b/SOURCES/0001-Revert-dri-fix-__DRI_IMAGE_FORMAT-to-PIPE_FORMAT-map.patch new file mode 100644 index 0000000..cb45b1d --- /dev/null +++ b/SOURCES/0001-Revert-dri-fix-__DRI_IMAGE_FORMAT-to-PIPE_FORMAT-map.patch @@ -0,0 +1,59 @@ +From 102d282d8add081f5f1aab35974218f151744ac5 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= +Date: Mon, 23 Feb 2026 08:40:07 +0100 +Subject: [PATCH] Revert "dri: fix __DRI_IMAGE_FORMAT* to PIPE_FORMAT* + mappings" + +This reverts commit 2ae8d0362bec12e84f787f226d2ba7a18130084f. +--- + src/loader/loader_dri_helper.h | 18 ++++++++++-------- + 1 file changed, 10 insertions(+), 8 deletions(-) + +diff --git a/src/loader/loader_dri_helper.h b/src/loader/loader_dri_helper.h +index 169e36b5d80..0d801e99648 100644 +--- a/src/loader/loader_dri_helper.h ++++ b/src/loader/loader_dri_helper.h +@@ -61,8 +61,10 @@ struct loader_screen_resources { + + + /** +- * These formats are endian independent they result in the same layout +- * regradless of a big or little endian cpu. ++ * These formats correspond to the similarly named MESA_FORMAT_* ++ * tokens, except in the native endian of the CPU. For example, on ++ * little endian __DRI_IMAGE_FORMAT_XRGB8888 corresponds to ++ * MESA_FORMAT_XRGB8888, but MESA_FORMAT_XRGB8888_REV on big endian. + * + * __DRI_IMAGE_FORMAT_NONE is for images that aren't directly usable + * by the driver (YUV planar formats) but serve as a base image for +@@ -73,21 +75,21 @@ struct loader_screen_resources { + * createImageFromNames (NONE, see above) and fromPlane (R8 & GR88). + */ + #define __DRI_IMAGE_FORMAT_RGB565 PIPE_FORMAT_B5G6R5_UNORM +-#define __DRI_IMAGE_FORMAT_XRGB8888 PIPE_FORMAT_B8G8R8X8_UNORM +-#define __DRI_IMAGE_FORMAT_ARGB8888 PIPE_FORMAT_B8G8R8A8_UNORM +-#define __DRI_IMAGE_FORMAT_ABGR8888 PIPE_FORMAT_R8G8B8A8_UNORM +-#define __DRI_IMAGE_FORMAT_XBGR8888 PIPE_FORMAT_R8G8B8X8_UNORM ++#define __DRI_IMAGE_FORMAT_XRGB8888 PIPE_FORMAT_BGRX8888_UNORM ++#define __DRI_IMAGE_FORMAT_ARGB8888 PIPE_FORMAT_BGRA8888_UNORM ++#define __DRI_IMAGE_FORMAT_ABGR8888 PIPE_FORMAT_RGBA8888_UNORM ++#define __DRI_IMAGE_FORMAT_XBGR8888 PIPE_FORMAT_RGBX8888_UNORM + #define __DRI_IMAGE_FORMAT_RGB888 PIPE_FORMAT_B8G8R8_UNORM + #define __DRI_IMAGE_FORMAT_BGR888 PIPE_FORMAT_R8G8B8_UNORM + #define __DRI_IMAGE_FORMAT_R8 PIPE_FORMAT_R8_UNORM +-#define __DRI_IMAGE_FORMAT_GR88 PIPE_FORMAT_R8G8_UNORM ++#define __DRI_IMAGE_FORMAT_GR88 PIPE_FORMAT_RG88_UNORM + #define __DRI_IMAGE_FORMAT_NONE PIPE_FORMAT_NONE + #define __DRI_IMAGE_FORMAT_XRGB2101010 PIPE_FORMAT_B10G10R10X2_UNORM + #define __DRI_IMAGE_FORMAT_ARGB2101010 PIPE_FORMAT_B10G10R10A2_UNORM + #define __DRI_IMAGE_FORMAT_SARGB8 PIPE_FORMAT_BGRA8888_SRGB + #define __DRI_IMAGE_FORMAT_ARGB1555 PIPE_FORMAT_B5G5R5A1_UNORM + #define __DRI_IMAGE_FORMAT_R16 PIPE_FORMAT_R16_UNORM +-#define __DRI_IMAGE_FORMAT_GR1616 PIPE_FORMAT_R16G16_UNORM ++#define __DRI_IMAGE_FORMAT_GR1616 PIPE_FORMAT_RG1616_UNORM + #define __DRI_IMAGE_FORMAT_XBGR2101010 PIPE_FORMAT_R10G10B10X2_UNORM + #define __DRI_IMAGE_FORMAT_ABGR2101010 PIPE_FORMAT_R10G10B10A2_UNORM + #define __DRI_IMAGE_FORMAT_SABGR8 PIPE_FORMAT_RGBA8888_SRGB +-- +2.53.0 + diff --git a/SOURCES/0001-Revert-hasvk-elk-stop-turning-load_push_constants-in.patch b/SOURCES/0001-Revert-hasvk-elk-stop-turning-load_push_constants-in.patch deleted file mode 100644 index 1c8a598..0000000 --- a/SOURCES/0001-Revert-hasvk-elk-stop-turning-load_push_constants-in.patch +++ /dev/null @@ -1,88 +0,0 @@ -From 870b8717b25eceadac8dd653debe8346826227cb Mon Sep 17 00:00:00 2001 -From: Dave Airlie -Date: Mon, 9 Jun 2025 09:19:28 +1000 -Subject: [PATCH] Revert "hasvk/elk: stop turning load_push_constants into - load_uniform" - -This reverts commit b036d2ded2de32e81730ec8ce37c803bad112efa. - -This seems to break gtk4 and other stuff. - -Cc: mesa-stable -(taking ack from Lionel saying we should revert) - -Acked-by: Lionel Landwerlin -Part-of: ---- - src/intel/compiler/elk/elk_fs_nir.cpp | 4 ++-- - src/intel/vulkan_hasvk/anv_nir_apply_pipeline_layout.c | 6 +++--- - src/intel/vulkan_hasvk/anv_nir_compute_push_layout.c | 3 +-- - 3 files changed, 6 insertions(+), 7 deletions(-) - -diff --git a/src/intel/compiler/elk/elk_fs_nir.cpp b/src/intel/compiler/elk/elk_fs_nir.cpp -index 459e2d966b7..6b78d6cf9f8 100644 ---- a/src/intel/compiler/elk/elk_fs_nir.cpp -+++ b/src/intel/compiler/elk/elk_fs_nir.cpp -@@ -4969,8 +4969,7 @@ fs_nir_emit_intrinsic(nir_to_elk_state &ntb, - break; - } - -- case nir_intrinsic_load_uniform: -- case nir_intrinsic_load_push_constant: { -+ case nir_intrinsic_load_uniform: { - /* Offsets are in bytes but they should always aligned to - * the type size - */ -@@ -7058,3 +7057,4 @@ nir_to_elk(elk_fs_visitor *s) - - ralloc_free(ntb.mem_ctx); - } -+ -diff --git a/src/intel/vulkan_hasvk/anv_nir_apply_pipeline_layout.c b/src/intel/vulkan_hasvk/anv_nir_apply_pipeline_layout.c -index 2bedf9017ed..1c613a9ebe7 100644 ---- a/src/intel/vulkan_hasvk/anv_nir_apply_pipeline_layout.c -+++ b/src/intel/vulkan_hasvk/anv_nir_apply_pipeline_layout.c -@@ -463,9 +463,9 @@ build_buffer_addr_for_res_index(nir_builder *b, - nir_iadd(b, res.dyn_offset_base, res.array_index); - - nir_def *dyn_load = -- nir_load_uniform(b, 1, 32, nir_imul_imm(b, dyn_offset_idx, 4), -- .base = offsetof(struct anv_push_constants, dynamic_offsets), -- .range = MAX_DYNAMIC_BUFFERS * 4); -+ nir_load_push_constant(b, 1, 32, nir_imul_imm(b, dyn_offset_idx, 4), -+ .base = offsetof(struct anv_push_constants, dynamic_offsets), -+ .range = MAX_DYNAMIC_BUFFERS * 4); - - nir_def *dynamic_offset = - nir_bcsel(b, nir_ieq_imm(b, res.dyn_offset_base, 0xff), -diff --git a/src/intel/vulkan_hasvk/anv_nir_compute_push_layout.c b/src/intel/vulkan_hasvk/anv_nir_compute_push_layout.c -index ed314af8b98..8a3f83f2c26 100644 ---- a/src/intel/vulkan_hasvk/anv_nir_compute_push_layout.c -+++ b/src/intel/vulkan_hasvk/anv_nir_compute_push_layout.c -@@ -55,7 +55,6 @@ anv_nir_compute_push_layout(nir_shader *nir, - has_const_ubo = true; - break; - -- case nir_intrinsic_load_uniform: - case nir_intrinsic_load_push_constant: { - unsigned base = nir_intrinsic_base(intrin); - unsigned range = nir_intrinsic_range(intrin); -@@ -132,7 +131,6 @@ anv_nir_compute_push_layout(nir_shader *nir, - - nir_intrinsic_instr *intrin = nir_instr_as_intrinsic(instr); - switch (intrin->intrinsic) { -- case nir_intrinsic_load_uniform: - case nir_intrinsic_load_push_constant: { - /* With bindless shaders we load uniforms with SEND - * messages. All the push constants are located after the -@@ -141,6 +139,7 @@ anv_nir_compute_push_layout(nir_shader *nir, - * elk_nir_lower_rt_intrinsics.c). - */ - unsigned base_offset = push_start; -+ intrin->intrinsic = nir_intrinsic_load_uniform; - nir_intrinsic_set_base(intrin, - nir_intrinsic_base(intrin) - - base_offset); --- -2.49.0 - diff --git a/SOURCES/0001-Revert-kopper-Explicitly-choose-zink.patch b/SOURCES/0001-Revert-kopper-Explicitly-choose-zink.patch deleted file mode 100644 index 954389e..0000000 --- a/SOURCES/0001-Revert-kopper-Explicitly-choose-zink.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 24f85c06c28736b73c14208a0ffa6657d2aee9cd Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= -Date: Mon, 21 Apr 2025 13:52:14 +0200 -Subject: [PATCH] Revert "kopper: Explicitly choose zink" - -On QEMU (virtio driver), without 3D acceleration enabled and without -mesa-vulkan-drivers installed, this commit prevents Mutter to start. - -This reverts commit c0bc957c5d8c7edd57626284b712dd6ea1e375fc. - -Related: https://bugzilla.redhat.com/show_bug.cgi?id=2360851 -Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13009 ---- - .pick_status.json | 2 +- - src/gallium/frontends/dri/kopper.c | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/.pick_status.json b/.pick_status.json -index 99df2fb30c2..cdf3965678c 100644 ---- a/.pick_status.json -+++ b/.pick_status.json -@@ -16204,7 +16204,7 @@ - "description": "kopper: Explicitly choose zink", - "nominated": false, - "nomination_type": 0, -- "resolution": 1, -+ "resolution": 4, - "main_sha": null, - "because_sha": null, - "notes": null -diff --git a/src/gallium/frontends/dri/kopper.c b/src/gallium/frontends/dri/kopper.c -index a1d7dcb79b4..3bdb56022a9 100644 ---- a/src/gallium/frontends/dri/kopper.c -+++ b/src/gallium/frontends/dri/kopper.c -@@ -73,7 +73,7 @@ kopper_init_screen(struct dri_screen *screen, bool driver_name_is_inferred) - bool success; - #ifdef HAVE_LIBDRM - if (screen->fd != -1) -- success = pipe_loader_drm_probe_fd(&screen->dev, screen->fd, true); -+ success = pipe_loader_drm_probe_fd(&screen->dev, screen->fd, false); - else - success = pipe_loader_vk_probe_dri(&screen->dev); - #else --- -2.49.0 - diff --git a/SOURCES/0001-device-select-add-a-layer-setting-to-disable-device-.patch b/SOURCES/0001-device-select-add-a-layer-setting-to-disable-device-.patch new file mode 100644 index 0000000..c286c70 --- /dev/null +++ b/SOURCES/0001-device-select-add-a-layer-setting-to-disable-device-.patch @@ -0,0 +1,149 @@ +From b0158d174d297276397b21a6657ea0ef14652183 Mon Sep 17 00:00:00 2001 +From: Dave Airlie +Date: Wed, 5 Nov 2025 11:01:05 +1000 +Subject: [PATCH 1/2] device-select: add a layer setting to disable device + selection logic + +There are cases like zink where we have a file descriptors we are searching +for devices for, so we don't need device selecting reordering, we just want +the fastest path to get the devices so we can match them. + +This also helps avoid some cases of deadlock inside compositors where +zink/vulkan initialises later and tries to connect to the compositor. + +This uses a VK_EXT_layer_setting to add a bypass setting. +--- + .../VkLayer_MESA_device_select.json.in | 6 +++ + .../device-select-layer/device_select_layer.c | 53 +++++++++++++++---- + 2 files changed, 48 insertions(+), 11 deletions(-) + +diff --git a/src/vulkan/device-select-layer/VkLayer_MESA_device_select.json.in b/src/vulkan/device-select-layer/VkLayer_MESA_device_select.json.in +index 40d6ea8cd8b..1623381a81a 100644 +--- a/src/vulkan/device-select-layer/VkLayer_MESA_device_select.json.in ++++ b/src/vulkan/device-select-layer/VkLayer_MESA_device_select.json.in +@@ -7,6 +7,12 @@ + "api_version": "1.4.303", + "implementation_version": "1", + "description": "Linux device selection layer", ++ "instance_extensions": [ ++ { ++ "name": "VK_EXT_layer_settings", ++ "spec_version": "2" ++ } ++ ], + "functions": { + "vkNegotiateLoaderLayerInterfaceVersion": "vkNegotiateLoaderLayerInterfaceVersion" + }, +diff --git a/src/vulkan/device-select-layer/device_select_layer.c b/src/vulkan/device-select-layer/device_select_layer.c +index 19cfc556f54..c03938b82c0 100644 +--- a/src/vulkan/device-select-layer/device_select_layer.c ++++ b/src/vulkan/device-select-layer/device_select_layer.c +@@ -54,7 +54,9 @@ struct instance_info { + PFN_vkGetPhysicalDeviceProperties2 GetPhysicalDeviceProperties2; + bool has_pci_bus, has_vulkan11; + bool has_wayland, has_xcb; +- bool zink, xwayland, xserver; ++ bool xserver; ++ /* don't do device selection */ ++ bool bypass_device_select; + }; + + static struct hash_table *device_select_instance_ht = NULL; +@@ -118,10 +120,34 @@ static VkResult device_select_CreateInstance(const VkInstanceCreateInfo *pCreate + const VkAllocationCallbacks *pAllocator, + VkInstance *pInstance) + { +- VkLayerInstanceCreateInfo *chain_info; +- for(chain_info = (VkLayerInstanceCreateInfo*)pCreateInfo->pNext; chain_info; chain_info = (VkLayerInstanceCreateInfo*)chain_info->pNext) +- if(chain_info->sType == VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO && chain_info->function == VK_LAYER_LINK_INFO) ++ VkLayerInstanceCreateInfo *chain_info = NULL; ++ bool bypass_device_select = false; ++ vk_foreach_struct_const(s, pCreateInfo->pNext) { ++ switch (s->sType) { ++ case VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO: { ++ const VkLayerInstanceCreateInfo *this_info = (const void *)s; ++ if (this_info->function == VK_LAYER_LINK_INFO) ++ chain_info = (VkLayerInstanceCreateInfo *)this_info; /* loses const */ + break; ++ } ++ case VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT: { ++ const VkLayerSettingsCreateInfoEXT *lsci = (const void *)s; ++ for (unsigned i = 0; i < lsci->settingCount; i++) { ++ const VkLayerSettingEXT *ls = &lsci->pSettings[i]; ++ if (!strcmp(ls->pLayerName, "MESA_device_select")) { ++ if (!strcmp(ls->pSettingName, "no_device_select")) { ++ assert(ls->type == VK_LAYER_SETTING_TYPE_BOOL32_EXT); ++ uint32_t *values = (uint32_t *)ls->pValues; ++ bypass_device_select = values[0]; ++ } ++ } ++ } ++ break; ++ } ++ default: ++ break; ++ } ++ } + + assert(chain_info->u.pLayerInfo); + +@@ -140,10 +166,10 @@ static VkResult device_select_CreateInstance(const VkInstanceCreateInfo *pCreate + return result; + } + ++ bool zink = !strcmp(engineName, "mesa zink"); ++ bool xwayland = !strcmp(applicationName, "Xwayland"); + struct instance_info *info = (struct instance_info *)calloc(1, sizeof(struct instance_info)); + info->GetInstanceProcAddr = GetInstanceProcAddr; +- info->zink = !strcmp(engineName, "mesa zink"); +- info->xwayland = !strcmp(applicationName, "Xwayland"); + info->xserver = !strcmp(applicationName, "Xorg") || !strcmp(applicationName, "Xephyr"); + + bool has_wayland = getenv("WAYLAND_DISPLAY") || getenv("WAYLAND_SOCKET"); +@@ -155,16 +181,20 @@ static VkResult device_select_CreateInstance(const VkInstanceCreateInfo *pCreate + info->has_wayland = true; + #endif + #ifdef VK_USE_PLATFORM_XCB_KHR +- if (!strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_XCB_SURFACE_EXTENSION_NAME) && has_xcb) +- info->has_xcb = !info->xserver || !info->zink; ++ if (!strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_XCB_SURFACE_EXTENSION_NAME) && ++ has_xcb) ++ info->has_xcb = !info->xserver || !zink; + #endif + } + ++ if (zink && xwayland) ++ bypass_device_select = true; + /* + * The loader is currently not able to handle GetPhysicalDeviceProperties2KHR calls in + * EnumeratePhysicalDevices when there are other layers present. To avoid mysterious crashes + * for users just use only the vulkan version for now. + */ ++ info->bypass_device_select = bypass_device_select; + info->has_vulkan11 = pCreateInfo->pApplicationInfo && + pCreateInfo->pApplicationInfo->apiVersion >= VK_MAKE_VERSION(1, 1, 0); + +@@ -558,7 +588,7 @@ static VkResult device_select_EnumeratePhysicalDevices(VkInstance instance, + uint32_t selected_physical_device_count = 0; + const char* selection = getenv("MESA_VK_DEVICE_SELECT"); + bool expose_only_one_dev = false; +- if (info->zink && info->xwayland) ++ if (info->bypass_device_select) + return info->EnumeratePhysicalDevices(instance, pPhysicalDeviceCount, pPhysicalDevices); + VkResult result = info->EnumeratePhysicalDevices(instance, &physical_device_count, NULL); + VK_OUTARRAY_MAKE_TYPED(VkPhysicalDevice, out, pPhysicalDevices, pPhysicalDeviceCount); +@@ -643,8 +673,9 @@ static VkResult device_select_EnumeratePhysicalDeviceGroups(VkInstance instance, + struct instance_info *info = device_select_layer_get_instance(instance); + uint32_t physical_device_group_count = 0; + uint32_t selected_physical_device_group_count = 0; +- if (info->zink && info->xwayland) +- return info->EnumeratePhysicalDeviceGroups(instance, pPhysicalDeviceGroupCount, pPhysicalDeviceGroups); ++ if (info->bypass_device_select) ++ return info->EnumeratePhysicalDeviceGroups(instance, pPhysicalDeviceGroupCount, ++ pPhysicalDeviceGroups); + VkResult result = info->EnumeratePhysicalDeviceGroups(instance, &physical_device_group_count, NULL); + VK_OUTARRAY_MAKE_TYPED(VkPhysicalDeviceGroupProperties, out, pPhysicalDeviceGroups, pPhysicalDeviceGroupCount); + +-- +2.51.1 + diff --git a/SOURCES/0001-gallivm-handle-u16-correct-on-const-loads.patch b/SOURCES/0001-gallivm-handle-u16-correct-on-const-loads.patch new file mode 100644 index 0000000..9769f7a --- /dev/null +++ b/SOURCES/0001-gallivm-handle-u16-correct-on-const-loads.patch @@ -0,0 +1,36 @@ +From c016346b50e9085b531f9bcbd7cfd63d3806a3e1 Mon Sep 17 00:00:00 2001 +From: Dave Airlie +Date: Wed, 11 Feb 2026 05:47:57 +1000 +Subject: [PATCH] gallivm: handle u16 correct on const loads. + +I somehow screwed this up on my previous attempt at fixing this bug, + +This should fix the loop limiter bug on big endian properly. + +Reviewed-by: Georg Lehmann +Cc: mesa-stable +Fixes: e28cfb2bada2 ("gallivm: handle u8/u16 const loads properly on big-endian.") +Part-of: +--- + src/gallium/auxiliary/gallivm/lp_bld_nir_soa.c | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/src/gallium/auxiliary/gallivm/lp_bld_nir_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_nir_soa.c +index 770f1cc6592..e755225dce9 100644 +--- a/src/gallium/auxiliary/gallivm/lp_bld_nir_soa.c ++++ b/src/gallium/auxiliary/gallivm/lp_bld_nir_soa.c +@@ -1269,10 +1269,7 @@ emit_load_const(struct lp_build_nir_soa_context *bld, + + for (unsigned i = 0; i < instr->def.num_components; i++) { + outval[i] = lp_build_const_int_vec(bld->base.gallivm, int_bld->type, +- bits == 8 ? instr->value[i].u8 : +- bits == 16 ? instr->value[i].u32 : +- bits == 32 ? instr->value[i].u32 : +- instr->value[i].u64); ++ nir_const_value_as_uint(instr->value[i], bits)); + } + for (unsigned i = instr->def.num_components; i < NIR_MAX_VEC_COMPONENTS; i++) { + outval[i] = NULL; +-- +2.53.0 + diff --git a/SOURCES/0001-glx-don-t-call-GL-functions-directly-use-the-current.patch b/SOURCES/0001-glx-don-t-call-GL-functions-directly-use-the-current.patch deleted file mode 100644 index 349eaa9..0000000 --- a/SOURCES/0001-glx-don-t-call-GL-functions-directly-use-the-current.patch +++ /dev/null @@ -1,154 +0,0 @@ -From ebf600843432f73a05a9848d60cecd219ca2e01f Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= -Date: Fri, 21 Feb 2025 01:14:39 -0500 -Subject: [PATCH] glx: don't call GL functions directly, use the current - dispatch instead - -With glvnd, GL functions will not be publicly exported from libGLX_mesa -and we don't even need them privately defined. - -Reviewed-by: Adam Jackson -Part-of: ---- - src/glx/drisw_glx.c | 6 ++++-- - src/glx/meson.build | 2 +- - src/glx/xfont.c | 46 +++++++++++++++++++++++---------------------- - 3 files changed, 29 insertions(+), 25 deletions(-) - -diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c -index 45837a81f37..58cc0e7d09a 100644 ---- a/src/glx/drisw_glx.c -+++ b/src/glx/drisw_glx.c -@@ -43,6 +43,8 @@ - #include "kopper_interface.h" - #include "loader_dri_helper.h" - #include "dri_util.h" -+#include "mapi/glapi/glapi.h" -+#include "mesa/main/dispatch.h" - - static int xshm_error = 0; - static int xshm_opcode = -1; -@@ -540,7 +542,7 @@ driswSwapBuffers(__GLXDRIdrawable * pdraw, - (void) remainder; - - if (flush) { -- glFlush(); -+ CALL_Flush(GET_DISPATCH(), ()); - } - - if (psc->kopper) -@@ -556,7 +558,7 @@ drisw_copy_sub_buffer(__GLXDRIdrawable * pdraw, - int x, int y, int width, int height, Bool flush) - { - if (flush) { -- glFlush(); -+ CALL_Flush(GET_DISPATCH(), ()); - } - - driswCopySubBuffer(pdraw->dri_drawable, x, y, width, height); -diff --git a/src/glx/meson.build b/src/glx/meson.build -index b52b91c5269..3315a7843fa 100644 ---- a/src/glx/meson.build -+++ b/src/glx/meson.build -@@ -113,7 +113,7 @@ if with_platform_windows - endif - libglx = static_library( - 'glx', -- [files_libglx, glx_generated], -+ [files_libglx, glx_generated, main_dispatch_h], - include_directories : [inc_include, inc_src, inc_glapi, inc_loader, inc_loader_x11, - inc_gallium, inc_mesa, inc_st_dri, inc_gallium_aux], - c_args : [ -diff --git a/src/glx/xfont.c b/src/glx/xfont.c -index d58b02f189a..f1ca7bba032 100644 ---- a/src/glx/xfont.c -+++ b/src/glx/xfont.c -@@ -36,6 +36,8 @@ - #ifdef GLX_DIRECT_RENDERING - - #include "glxclient.h" -+#include "mapi/glapi/glapi.h" -+#include "mesa/main/dispatch.h" - - /* Implementation. */ - -@@ -197,22 +199,22 @@ DRI_glXUseXFont(struct glx_context *CC, Font font, int first, int count, int lis - #endif - - /* Save the current packing mode for bitmaps. */ -- glGetIntegerv(GL_UNPACK_SWAP_BYTES, &swapbytes); -- glGetIntegerv(GL_UNPACK_LSB_FIRST, &lsbfirst); -- glGetIntegerv(GL_UNPACK_ROW_LENGTH, &rowlength); -- glGetIntegerv(GL_UNPACK_SKIP_ROWS, &skiprows); -- glGetIntegerv(GL_UNPACK_SKIP_PIXELS, &skippixels); -- glGetIntegerv(GL_UNPACK_ALIGNMENT, &alignment); -+ CALL_GetIntegerv(GET_DISPATCH(), (GL_UNPACK_SWAP_BYTES, &swapbytes)); -+ CALL_GetIntegerv(GET_DISPATCH(), (GL_UNPACK_LSB_FIRST, &lsbfirst)); -+ CALL_GetIntegerv(GET_DISPATCH(), (GL_UNPACK_ROW_LENGTH, &rowlength)); -+ CALL_GetIntegerv(GET_DISPATCH(), (GL_UNPACK_SKIP_ROWS, &skiprows)); -+ CALL_GetIntegerv(GET_DISPATCH(), (GL_UNPACK_SKIP_PIXELS, &skippixels)); -+ CALL_GetIntegerv(GET_DISPATCH(), (GL_UNPACK_ALIGNMENT, &alignment)); - - /* Enforce a standard packing mode which is compatible with - fill_bitmap() from above. This is actually the default mode, - except for the (non)alignment. */ -- glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE); -- glPixelStorei(GL_UNPACK_LSB_FIRST, GL_FALSE); -- glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); -- glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); -- glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); -- glPixelStorei(GL_UNPACK_ALIGNMENT, 1); -+ CALL_PixelStorei(GET_DISPATCH(), (GL_UNPACK_SWAP_BYTES, GL_FALSE)); -+ CALL_PixelStorei(GET_DISPATCH(), (GL_UNPACK_LSB_FIRST, GL_FALSE)); -+ CALL_PixelStorei(GET_DISPATCH(), (GL_UNPACK_ROW_LENGTH, 0)); -+ CALL_PixelStorei(GET_DISPATCH(), (GL_UNPACK_SKIP_ROWS, 0)); -+ CALL_PixelStorei(GET_DISPATCH(), (GL_UNPACK_SKIP_PIXELS, 0)); -+ CALL_PixelStorei(GET_DISPATCH(), (GL_UNPACK_ALIGNMENT, 1)); - - pixmap = XCreatePixmap(dpy, RootWindow(dpy, screen), 10, 10, 1); - values.foreground = BlackPixel(dpy, DefaultScreen(dpy)); -@@ -260,18 +262,18 @@ DRI_glXUseXFont(struct glx_context *CC, Font font, int first, int count, int lis - bm_width = (width + 7) / 8; - bm_height = height; - -- glNewList(list, GL_COMPILE); -+ CALL_NewList(GET_DISPATCH(), (list, GL_COMPILE)); - if (valid && (bm_width > 0) && (bm_height > 0)) { - - memset(bm, '\0', bm_width * bm_height); - fill_bitmap(dpy, screen, gc, bm_width, bm_height, x, y, c, bm); - -- glBitmap(width, height, x0, y0, dx, dy, bm); -+ CALL_Bitmap(GET_DISPATCH(), (width, height, x0, y0, dx, dy, bm)); - } - else { -- glBitmap(0, 0, 0.0, 0.0, dx, dy, NULL); -+ CALL_Bitmap(GET_DISPATCH(), (0, 0, 0.0, 0.0, dx, dy, NULL)); - } -- glEndList(); -+ CALL_EndList(GET_DISPATCH(), ()); - } - - free(bm); -@@ -279,12 +281,12 @@ DRI_glXUseXFont(struct glx_context *CC, Font font, int first, int count, int lis - XFreeGC(dpy, gc); - - /* Restore saved packing modes. */ -- glPixelStorei(GL_UNPACK_SWAP_BYTES, swapbytes); -- glPixelStorei(GL_UNPACK_LSB_FIRST, lsbfirst); -- glPixelStorei(GL_UNPACK_ROW_LENGTH, rowlength); -- glPixelStorei(GL_UNPACK_SKIP_ROWS, skiprows); -- glPixelStorei(GL_UNPACK_SKIP_PIXELS, skippixels); -- glPixelStorei(GL_UNPACK_ALIGNMENT, alignment); -+ CALL_PixelStorei(GET_DISPATCH(), (GL_UNPACK_SWAP_BYTES, swapbytes)); -+ CALL_PixelStorei(GET_DISPATCH(), (GL_UNPACK_LSB_FIRST, lsbfirst)); -+ CALL_PixelStorei(GET_DISPATCH(), (GL_UNPACK_ROW_LENGTH, rowlength)); -+ CALL_PixelStorei(GET_DISPATCH(), (GL_UNPACK_SKIP_ROWS, skiprows)); -+ CALL_PixelStorei(GET_DISPATCH(), (GL_UNPACK_SKIP_PIXELS, skippixels)); -+ CALL_PixelStorei(GET_DISPATCH(), (GL_UNPACK_ALIGNMENT, alignment)); - } - - #endif --- -2.51.0 - diff --git a/SOURCES/0001-util-disk_cache-Re-enable-multi-file-cache-by-defaul.patch b/SOURCES/0001-util-disk_cache-Re-enable-multi-file-cache-by-defaul.patch deleted file mode 100644 index 96fc39d..0000000 --- a/SOURCES/0001-util-disk_cache-Re-enable-multi-file-cache-by-defaul.patch +++ /dev/null @@ -1,184 +0,0 @@ -From b51cf39cf40db4bfde0950483756ec09f6c21b39 Mon Sep 17 00:00:00 2001 -From: Dmitry Osipenko -Date: Tue, 25 Mar 2025 23:27:13 +0300 -Subject: [PATCH] util/disk_cache: Re-enable multi-file cache by default -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Over past months a performance issue was found with the Mesa-DB cache -implementation that results in a too slow cache startup time when cache is -full. A better indexing strategy will need to be invented to mitigate the -issue. Until then, let's default back to the multi-file cache. - -Suggested-by: Michel Dänzer -Acked-by: Timothy Arceri -Signed-off-by: Dmitry Osipenko -Part-of: ---- - docs/envvars.rst | 32 +++++++++++++++++++++++--------- - src/util/disk_cache.c | 10 ++++++---- - src/util/tests/cache_test.cpp | 11 +++++++++++ - 3 files changed, 40 insertions(+), 13 deletions(-) - -diff --git a/docs/envvars.rst b/docs/envvars.rst -index 7247158cc50..3ea8415ca25 100644 ---- a/docs/envvars.rst -+++ b/docs/envvars.rst -@@ -200,10 +200,11 @@ Core Mesa environment variables - .. envvar:: MESA_SHADER_CACHE_DIR - - if set, determines the directory to be used for the on-disk cache of -- compiled shader programs. If this variable is not set, then the cache -- will be stored in ``$XDG_CACHE_HOME/mesa_shader_cache_db`` (if that -- variable is set), or else within ``.cache/mesa_shader_cache_db`` within -- the user's home directory. -+ compiled shader programs. If set then the cache will be stored in -+ ``$MESA_SHADER_CACHE_DIR/mesa_shader_cache``. If this variable is not -+ set, then the cache will be stored in -+ ``$XDG_CACHE_HOME/mesa_shader_cache`` (if that variable is set), or else -+ within ``.cache/mesa_shader_cache`` within the user's home directory. - - .. envvar:: MESA_SHADER_CACHE_SHOW_STATS - -@@ -226,11 +227,12 @@ Core Mesa environment variables - - .. envvar:: MESA_DISK_CACHE_MULTI_FILE - -- if set to 1, enables the multi file on-disk shader cache implementation -- instead of the default Mesa-DB cache implementation. -- This implementation increases the overall disk usage. -- If :envvar:`MESA_SHADER_CACHE_DIR` is not set, the cache will be stored -- in ``$XDG_CACHE_HOME/mesa_shader_cache`` (if that variable is set) -+ if set to 1 (set by default), enables the multi file on-disk -+ shader cache implementation. This implementation increases the overall -+ disk usage. -+ If :envvar:`MESA_SHADER_CACHE_DIR` is set, the cache will be stored in -+ ``$MESA_SHADER_CACHE_DIR/mesa_shader_cache``, or else within -+ ``$XDG_CACHE_HOME/mesa_shader_cache`` (if that variable is set) - or else within ``.cache/mesa_shader_cache`` within the user's home - directory. - -@@ -245,6 +247,18 @@ Core Mesa environment variables - and ``filename1_idx.foz``. A limit of 8 DBs can be loaded and this limit - is shared with :envvar:`MESA_DISK_CACHE_READ_ONLY_FOZ_DBS_DYNAMIC_LIST`. - -+.. envvar:: MESA_DISK_CACHE_DATABASE -+ -+ if set to 1, enables the Mesa-DB single file on-disk shader cache -+ implementation instead of the default multi-file cache implementation. -+ Like :envvar:`MESA_DISK_CACHE_SINGLE_FILE`, Mesa-DB reduces overall -+ disk usage but Mesa-DB supports cache size limits via -+ :envvar:`MESA_SHADER_CACHE_MAX_SIZE`. If -+ :envvar:`MESA_SHADER_CACHE_DIR` is not set, the cache will be stored -+ in ``$XDG_CACHE_HOME/mesa_shader_cache_db`` (if that variable is set) -+ or else within ``.cache/mesa_shader_cache_db`` within the user's home -+ directory. -+ - .. envvar:: MESA_DISK_CACHE_DATABASE_NUM_PARTS - - specifies number of mesa-db cache parts, default is 50. -diff --git a/src/util/disk_cache.c b/src/util/disk_cache.c -index 391f8cfdc1d..d62ba853179 100644 ---- a/src/util/disk_cache.c -+++ b/src/util/disk_cache.c -@@ -223,17 +223,19 @@ disk_cache_create(const char *gpu_name, const char *driver_id, - uint64_t max_size = 0; - char *max_size_str; - -- if (debug_get_bool_option("MESA_DISK_CACHE_SINGLE_FILE", false)) -+ if (debug_get_bool_option("MESA_DISK_CACHE_SINGLE_FILE", false)) { - cache_type = DISK_CACHE_SINGLE_FILE; -- else if (debug_get_bool_option("MESA_DISK_CACHE_MULTI_FILE", false)) -- cache_type = DISK_CACHE_MULTI_FILE; -- else { -+ } else if (debug_get_bool_option("MESA_DISK_CACHE_DATABASE", false)) { - cache_type = DISK_CACHE_DATABASE; - /* Since switching the default cache to , remove the - * old cache folder if it hasn't been modified for more than 7 days. - */ - if (!getenv("MESA_SHADER_CACHE_DIR") && !getenv("MESA_GLSL_CACHE_DIR") && disk_cache_enabled()) - disk_cache_delete_old_cache(); -+ } else if (debug_get_bool_option("MESA_DISK_CACHE_MULTI_FILE", true)) { -+ cache_type = DISK_CACHE_MULTI_FILE; -+ } else { -+ return NULL; - } - - max_size_str = getenv("MESA_SHADER_CACHE_MAX_SIZE"); -diff --git a/src/util/tests/cache_test.cpp b/src/util/tests/cache_test.cpp -index f181178c809..d1772f3240f 100644 ---- a/src/util/tests/cache_test.cpp -+++ b/src/util/tests/cache_test.cpp -@@ -819,7 +819,9 @@ TEST_F(Cache, Database) - #ifndef ENABLE_SHADER_CACHE - GTEST_SKIP() << "ENABLE_SHADER_CACHE not defined."; - #else -+ setenv("MESA_DISK_CACHE_MULTI_FILE", "false", 1); - setenv("MESA_DISK_CACHE_DATABASE_NUM_PARTS", "1", 1); -+ setenv("MESA_DISK_CACHE_DATABASE", "true", 1); - - test_disk_cache_create(mem_ctx, CACHE_DIR_NAME_DB, driver_id); - -@@ -845,6 +847,7 @@ TEST_F(Cache, Database) - - test_put_big_sized_entry_to_empty_cache(driver_id); - -+ setenv("MESA_DISK_CACHE_DATABASE", "false", 1); - unsetenv("MESA_DISK_CACHE_DATABASE_NUM_PARTS"); - - err = rmrf_local(CACHE_TEST_TMP); -@@ -872,6 +875,7 @@ TEST_F(Cache, Combined) - #else - setenv("MESA_DISK_CACHE_SINGLE_FILE", "true", 1); - setenv("MESA_DISK_CACHE_MULTI_FILE", "true", 1); -+ setenv("MESA_DISK_CACHE_DATABASE", "false", 1); - - #ifdef SHADER_CACHE_DISABLE_BY_DEFAULT - setenv("MESA_SHADER_CACHE_DISABLE", "false", 1); -@@ -942,6 +946,7 @@ TEST_F(Cache, Combined) - - setenv("MESA_DISK_CACHE_SINGLE_FILE", "false", 1); - setenv("MESA_DISK_CACHE_MULTI_FILE", "false", 1); -+ setenv("MESA_DISK_CACHE_DATABASE", "true", 1); - - /* Create MESA-DB cache with enabled retrieval from the read-only - * cache. */ -@@ -1010,6 +1015,7 @@ TEST_F(Cache, Combined) - disk_cache_destroy(cache_mesa_db); - - /* Create default multi-file cache. */ -+ setenv("MESA_DISK_CACHE_DATABASE", "false", 1); - setenv("MESA_DISK_CACHE_MULTI_FILE", "true", 1); - - /* Enable read-only cache. */ -@@ -1068,7 +1074,9 @@ TEST_F(Cache, Combined) - - disk_cache_destroy(cache_multifile); - -+ unsetenv("MESA_DISK_CACHE_SINGLE_FILE"); - unsetenv("MESA_DISK_CACHE_MULTI_FILE"); -+ unsetenv("MESA_DISK_CACHE_DATABASE"); - - int err = rmrf_local(CACHE_TEST_TMP); - EXPECT_EQ(err, 0) << "Removing " CACHE_TEST_TMP " again"; -@@ -1325,13 +1333,16 @@ TEST_F(Cache, DatabaseMultipartEviction) - #ifndef ENABLE_SHADER_CACHE - GTEST_SKIP() << "ENABLE_SHADER_CACHE not defined."; - #else -+ setenv("MESA_DISK_CACHE_MULTI_FILE", "false", 1); - setenv("MESA_DISK_CACHE_DATABASE_NUM_PARTS", "3", 1); -+ setenv("MESA_DISK_CACHE_DATABASE", "true", 1); - - test_disk_cache_create(mem_ctx, CACHE_DIR_NAME_DB, driver_id); - - test_multipart_eviction(driver_id); - - unsetenv("MESA_DISK_CACHE_DATABASE_NUM_PARTS"); -+ unsetenv("MESA_DISK_CACHE_DATABASE"); - - int err = rmrf_local(CACHE_TEST_TMP); - EXPECT_EQ(err, 0) << "Removing " CACHE_TEST_TMP " again"; --- -2.52.0 - diff --git a/SOURCES/0002-zink-use-device-select-layer-settings-to-disable-dev.patch b/SOURCES/0002-zink-use-device-select-layer-settings-to-disable-dev.patch new file mode 100644 index 0000000..319e4b3 --- /dev/null +++ b/SOURCES/0002-zink-use-device-select-layer-settings-to-disable-dev.patch @@ -0,0 +1,106 @@ +From 30c754624ab73b180c66658701814ec5e3d12a31 Mon Sep 17 00:00:00 2001 +From: Dave Airlie +Date: Wed, 5 Nov 2025 11:02:26 +1000 +Subject: [PATCH 2/2] zink: use device select layer settings to disable device + selection + +In the case where we have a device that we want to choose after +probing, there is no point in asking the device select layer to do +any reordering at all. + +This helps avoid a deadlock inside compositors where we don't need +device selection anyways. +--- + src/gallium/drivers/zink/zink_instance.py | 18 ++++++++++++++++++ + src/gallium/drivers/zink/zink_screen.c | 9 ++++++++- + 2 files changed, 26 insertions(+), 1 deletion(-) + +diff --git a/src/gallium/drivers/zink/zink_instance.py b/src/gallium/drivers/zink/zink_instance.py +index 1ab36bee2ca..c0e813be164 100644 +--- a/src/gallium/drivers/zink/zink_instance.py ++++ b/src/gallium/drivers/zink/zink_instance.py +@@ -37,6 +37,7 @@ import platform + # - nonstandard: Disables validation (cross-checking with vk.xml) if True. + EXTENSIONS = [ + Extension("VK_EXT_debug_utils"), ++ Extension("VK_EXT_layer_settings"), + Extension("VK_KHR_get_physical_device_properties2"), + Extension("VK_KHR_external_memory_capabilities"), + Extension("VK_KHR_external_semaphore_capabilities"), +@@ -62,8 +63,10 @@ LAYERS = [ + conditions=["zink_debug & ZINK_DEBUG_VALIDATION"]), + Layer("VK_LAYER_LUNARG_standard_validation", + conditions=["zink_debug & ZINK_DEBUG_VALIDATION", "!have_layer_KHRONOS_validation"]), ++ Layer("VK_LAYER_MESA_device_select") + ] + ++ + REPLACEMENTS = { + "VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES2_EXTENSION_NAME" : "VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME" + } +@@ -87,6 +90,7 @@ struct zink_screen; + + struct zink_instance_info { + uint32_t loader_version; ++ bool no_device_select; + + %for ext in extensions: + bool have_${ext.name_with_vendor()}; +@@ -261,6 +265,20 @@ zink_create_instance(struct zink_screen *screen, struct zink_instance_info *inst + ici.ppEnabledLayerNames = layers; + ici.enabledLayerCount = num_layers; + ++ VkLayerSettingEXT ds_layer = {0}; ++ VkLayerSettingsCreateInfoEXT lsci = {0}; ++ uint32_t no_device_select_value = instance_info->no_device_select; ++ if (have_EXT_layer_settings && have_layer_MESA_device_select) { ++ ds_layer.pLayerName = "MESA_device_select"; ++ ds_layer.pSettingName = "no_device_select"; ++ ds_layer.type = VK_LAYER_SETTING_TYPE_BOOL32_EXT; ++ ds_layer.valueCount = 1; ++ ds_layer.pValues = &no_device_select_value; ++ lsci.sType = VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT; ++ lsci.settingCount = 1; ++ lsci.pSettings = &ds_layer; ++ ici.pNext = &lsci; ++ } + GET_PROC_ADDR_INSTANCE_LOCAL(screen, NULL, CreateInstance); + assert(vk_CreateInstance); + +diff --git a/src/gallium/drivers/zink/zink_screen.c b/src/gallium/drivers/zink/zink_screen.c +index 7ec86d0090a..34eee2ba113 100644 +--- a/src/gallium/drivers/zink/zink_screen.c ++++ b/src/gallium/drivers/zink/zink_screen.c +@@ -1576,6 +1576,12 @@ zink_destroy_screen(struct pipe_screen *pscreen) + glsl_type_singleton_decref(); + } + ++static bool ++zink_picks_device(int dev_major, uint64_t adapter_luid) ++{ ++ return (dev_major > 0 && dev_major < 255) || adapter_luid; ++} ++ + static int + zink_get_display_device(const struct zink_screen *screen, uint32_t pdev_count, + const VkPhysicalDevice *pdevs, int64_t dev_major, +@@ -1647,7 +1653,7 @@ choose_pdev(struct zink_screen *screen, int64_t dev_major, int64_t dev_minor, ui + bool cpu = debug_get_bool_option("LIBGL_ALWAYS_SOFTWARE", false) || + debug_get_bool_option("D3D_ALWAYS_SOFTWARE", false); + +- if (cpu || (dev_major > 0 && dev_major < 255) || adapter_luid) { ++ if (cpu || zink_picks_device(dev_major, adapter_luid)) { + uint32_t pdev_count; + int idx; + VkPhysicalDevice *pdevs; +@@ -3309,6 +3315,7 @@ zink_internal_create_screen(const struct pipe_screen_config *config, int64_t dev + simple_mtx_lock(&instance_lock); + if (++instance_refcount == 1) { + instance_info.loader_version = zink_get_loader_version(screen); ++ instance_info.no_device_select = zink_picks_device(dev_major, adapter_luid); + instance = zink_create_instance(screen, &instance_info); + } + if (!instance) { +-- +2.51.1 + diff --git a/SOURCES/e4eb5e80c316c0af3fff310ca89e1175d81556c1.patch b/SOURCES/e4eb5e80c316c0af3fff310ca89e1175d81556c1.patch deleted file mode 100644 index 5cf4073..0000000 --- a/SOURCES/e4eb5e80c316c0af3fff310ca89e1175d81556c1.patch +++ /dev/null @@ -1,144 +0,0 @@ -From e4eb5e80c316c0af3fff310ca89e1175d81556c1 Mon Sep 17 00:00:00 2001 -From: Nikita Popov -Date: Thu, 27 Feb 2025 15:44:27 +0100 -Subject: [PATCH] clover: Don't include libclc headers - -Per https://github.com/llvm/llvm-project/issues/119967 these -headers are internal implementation details of libclc and were -never supposed to be installed. They are not available anymore -since LLVM 20. Instead opencl-c.h should be used. - -There already ise a code path for including opencl-c.h, so always -use it. - -This didn't work for me out of the box, because the build system -currently hardcodes the clang resource directory, which is incorrect -for Fedora at least. Fix this by using GetResourcePath + -CLANG_RESOURCE_DIR provided by clang instead. This is basically -the same as what is done in clc_helper.c - -I've still retained the old behavior as a fallback just in case -(e.g. if clang is linked statically?) - -Reviewed-by: Karol Herbst -Part-of: ---- - .../frontends/clover/llvm/invocation.cpp | 53 +++++++++++++------ - src/gallium/frontends/clover/meson.build | 5 +- - 2 files changed, 39 insertions(+), 19 deletions(-) - -diff --git a/src/gallium/frontends/clover/llvm/invocation.cpp b/src/gallium/frontends/clover/llvm/invocation.cpp -index 3cbb05baecf67..ca030b404d791 100644 ---- a/src/gallium/frontends/clover/llvm/invocation.cpp -+++ b/src/gallium/frontends/clover/llvm/invocation.cpp -@@ -24,6 +24,8 @@ - // OTHER DEALINGS IN THE SOFTWARE. - // - -+#include -+ - #include - #include - #include -@@ -39,6 +41,8 @@ - #include - #include - #include -+#include -+#include - - #if LLVM_VERSION_MAJOR >= 20 - #include -@@ -323,6 +327,30 @@ namespace { - return c; - } - -+ std::string getResourceDirectory() { -+ Dl_info info; -+ if (dladdr((void *)clang::CompilerInvocation::CreateFromArgs, &info) == 0) { -+ return FALLBACK_CLANG_RESOURCE_DIR; -+ } -+ -+ char *libclang_path = realpath(info.dli_fname, NULL); -+ if (libclang_path == nullptr) { -+ return FALLBACK_CLANG_RESOURCE_DIR; -+ } -+ -+ // GetResourcePath is a way to retrieve the actual libclang resource dir based on a given -+ // binary or library. -+ std::string clang_resource_dir = -+#if LLVM_VERSION_MAJOR >= 20 -+ clang::driver::Driver::GetResourcesPath(std::string(libclang_path)); -+#else -+ clang::driver::Driver::GetResourcesPath(std::string(libclang_path), CLANG_RESOURCE_DIR); -+#endif -+ free(libclang_path); -+ -+ return clang_resource_dir; -+ } -+ - std::unique_ptr - compile(LLVMContext &ctx, clang::CompilerInstance &c, - const std::string &name, const std::string &source, -@@ -331,25 +359,18 @@ namespace { - c.getFrontendOpts().ProgramAction = clang::frontend::EmitLLVMOnly; - c.getHeaderSearchOpts().UseBuiltinIncludes = true; - c.getHeaderSearchOpts().UseStandardSystemIncludes = true; -- c.getHeaderSearchOpts().ResourceDir = CLANG_RESOURCE_DIR; - -- if (use_libclc) { -- // Add libclc generic search path -- c.getHeaderSearchOpts().AddPath(LIBCLC_INCLUDEDIR, -- clang::frontend::Angled, -- false, false); -+ std::string clang_resource_dir = getResourceDirectory(); -+ c.getHeaderSearchOpts().ResourceDir = clang_resource_dir; - -- // Add libclc include -- c.getPreprocessorOpts().Includes.push_back("clc/clc.h"); -- } else { -- // Add opencl-c generic search path -- c.getHeaderSearchOpts().AddPath(CLANG_RESOURCE_DIR, -- clang::frontend::Angled, -- false, false); -+ // Add opencl-c generic search path -+ std::string clang_include_path = clang_resource_dir + "/include"; -+ c.getHeaderSearchOpts().AddPath(clang_include_path, -+ clang::frontend::Angled, -+ false, false); - -- // Add opencl include -- c.getPreprocessorOpts().Includes.push_back("opencl-c.h"); -- } -+ // Add opencl include -+ c.getPreprocessorOpts().Includes.push_back("opencl-c.h"); - - // Add definition for the OpenCL version - const auto dev_version = dev.device_version(); -diff --git a/src/gallium/frontends/clover/meson.build b/src/gallium/frontends/clover/meson.build -index e569b86a1bea7..56a9894f0dbb1 100644 ---- a/src/gallium/frontends/clover/meson.build -+++ b/src/gallium/frontends/clover/meson.build -@@ -10,7 +10,6 @@ clover_opencl_cpp_args = [ - '-DCL_USE_DEPRECATED_OPENCL_2_0_APIS', - '-DCL_USE_DEPRECATED_OPENCL_2_1_APIS', - '-DCL_USE_DEPRECATED_OPENCL_2_2_APIS', -- '-DLIBCLC_INCLUDEDIR="@0@/"'.format(dep_clc.get_variable(pkgconfig : 'includedir')), - '-DLIBCLC_LIBEXECDIR="@0@/"'.format(dep_clc.get_variable(pkgconfig : 'libexecdir')) - ] - clover_incs = [inc_include, inc_src, inc_gallium, inc_gallium_aux] -@@ -43,9 +42,9 @@ libclllvm = static_library( - cpp_args : [ - clover_cpp_args, - clover_opencl_cpp_args, -- '-DCLANG_RESOURCE_DIR="@0@"'.format(join_paths( -+ '-DFALLBACK_CLANG_RESOURCE_DIR="@0@"'.format(join_paths( - dep_llvm.get_variable(cmake : 'LLVM_LIBRARY_DIR', configtool: 'libdir'), 'clang', -- dep_llvm.version(), 'include', -+ dep_llvm.version() - )), - ], - gnu_symbol_visibility : 'hidden', --- -GitLab - diff --git a/SOURCES/gnome-shell-glthread-disable.patch b/SOURCES/gnome-shell-glthread-disable.patch deleted file mode 100644 index b2caeb8..0000000 --- a/SOURCES/gnome-shell-glthread-disable.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -up mesa-22.3.0-rc4/src/util/00-mesa-defaults.conf.dma mesa-22.3.0-rc4/src/util/00-mesa-defaults.conf ---- mesa-22.3.0-rc4/src/util/00-mesa-defaults.conf.dma 2022-11-25 10:32:32.175879868 +1000 -+++ mesa-22.3.0-rc4/src/util/00-mesa-defaults.conf 2022-11-25 10:32:43.743067470 +1000 -@@ -653,6 +653,7 @@ TODO: document the other workarounds. - - - -