Compare commits

...

No commits in common. "c8" and "a9-beta" have entirely different histories.
c8 ... a9-beta

21 changed files with 1738 additions and 832 deletions

14
.gitignore vendored
View File

@ -1,3 +1,11 @@
SOURCES/dataclasses-0.8.tar.gz SOURCES/libclc-21.1.3.src.tar.xz
SOURCES/mesa-23.1.4.tar.xz SOURCES/mesa-25.2.7.tar.xz
SOURCES/meson-0.61.4.tar.gz 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

View File

@ -1,3 +1,11 @@
ef25d3e9e2523805baa314a4adcb915ae901740e SOURCES/dataclasses-0.8.tar.gz 3dcfd76b6097774d3c8f2bb05e920c12fb5e18f0 SOURCES/libclc-21.1.3.src.tar.xz
8a48c0e1fbda2c9563ddcf95b05012ab00a8a692 SOURCES/mesa-23.1.4.tar.xz 43e42024911f1fc54044d703efb5f0cb050db44e SOURCES/mesa-25.2.7.tar.xz
b0ab169abd8ec87ce773a02b2c7d6a8664b8db00 SOURCES/meson-0.61.4.tar.gz 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

View File

@ -0,0 +1,59 @@
From 102d282d8add081f5f1aab35974218f151744ac5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= <jose.exposito89@gmail.com>
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

View File

@ -1,127 +0,0 @@
From 2d4fe5f229791fde52846b3f583c12508b5109d6 Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied@redhat.com>
Date: Fri, 25 Aug 2023 12:43:44 +1000
Subject: [PATCH] clover/llvm: move to modern pass manager.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This seems like it should work, but I haven't tested it yet.
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24879>
---
.../frontends/clover/llvm/invocation.cpp | 64 +++++++++++++++----
1 file changed, 51 insertions(+), 13 deletions(-)
diff --git a/src/gallium/frontends/clover/llvm/invocation.cpp b/src/gallium/frontends/clover/llvm/invocation.cpp
index 7a50fea3323..43d26fe1abb 100644
--- a/src/gallium/frontends/clover/llvm/invocation.cpp
+++ b/src/gallium/frontends/clover/llvm/invocation.cpp
@@ -27,13 +27,17 @@
#include <llvm/IR/DiagnosticPrinter.h>
#include <llvm/IR/DiagnosticInfo.h>
#include <llvm/IR/LLVMContext.h>
+#include <llvm/IR/Module.h>
#include <llvm/Support/raw_ostream.h>
-#include <llvm/Transforms/IPO/PassManagerBuilder.h>
+#include <llvm/Transforms/IPO/Internalize.h>
#include <llvm-c/Target.h>
#ifdef HAVE_CLOVER_SPIRV
#include <LLVMSPIRVLib/LLVMSPIRVLib.h>
#endif
+#include <llvm-c/TargetMachine.h>
+#include <llvm-c/Transforms/PassBuilder.h>
+#include <llvm/Support/CBindingWrapping.h>
#include <clang/CodeGen/CodeGenAction.h>
#include <clang/Lex/PreprocessorOptions.h>
#include <clang/Frontend/TextDiagnosticBuffer.h>
@@ -439,10 +443,10 @@ clover::llvm::compile_program(const std::string &source,
namespace {
void
- optimize(Module &mod, unsigned optimization_level,
+ optimize(Module &mod,
+ const std::string& ir_target,
+ unsigned optimization_level,
bool internalize_symbols) {
- ::llvm::legacy::PassManager pm;
-
// By default, the function internalizer pass will look for a function
// called "main" and then mark all other functions as internal. Marking
// functions as internal enables the optimizer to perform optimizations
@@ -458,19 +462,53 @@ namespace {
if (internalize_symbols) {
std::vector<std::string> names =
map(std::mem_fn(&Function::getName), get_kernels(mod));
- pm.add(::llvm::createInternalizePass(
+ internalizeModule(mod,
[=](const ::llvm::GlobalValue &gv) {
return std::find(names.begin(), names.end(),
gv.getName()) != names.end();
- }));
+ });
}
- ::llvm::PassManagerBuilder pmb;
- pmb.OptLevel = optimization_level;
- pmb.LibraryInfo = new ::llvm::TargetLibraryInfoImpl(
- ::llvm::Triple(mod.getTargetTriple()));
- pmb.populateModulePassManager(pm);
- pm.run(mod);
+
+ const char *opt_str = NULL;
+ LLVMCodeGenOptLevel level;
+ switch (optimization_level) {
+ case 0:
+ default:
+ opt_str = "default<O0>";
+ level = LLVMCodeGenLevelNone;
+ break;
+ case 1:
+ opt_str = "default<O1>";
+ level = LLVMCodeGenLevelLess;
+ break;
+ case 2:
+ opt_str = "default<O2>";
+ level = LLVMCodeGenLevelDefault;
+ break;
+ case 3:
+ opt_str = "default<O3>";
+ level = LLVMCodeGenLevelAggressive;
+ break;
+ }
+
+ const target &target = ir_target;
+ LLVMTargetRef targ;
+ char *err_message;
+
+ if (LLVMGetTargetFromTriple(target.triple.c_str(), &targ, &err_message))
+ return;
+ LLVMTargetMachineRef tm =
+ LLVMCreateTargetMachine(targ, target.triple.c_str(),
+ target.cpu.c_str(), "", level,
+ LLVMRelocDefault, LLVMCodeModelDefault);
+
+ if (!tm)
+ return;
+ LLVMPassBuilderOptionsRef opts = LLVMCreatePassBuilderOptions();
+ LLVMRunPasses(wrap(&mod), opt_str, tm, opts);
+
+ LLVMDisposeTargetMachine(tm);
}
std::unique_ptr<Module>
@@ -500,7 +538,7 @@ clover::llvm::link_program(const std::vector<binary> &binaries,
auto c = create_compiler_instance(dev, dev.ir_target(), options, r_log);
auto mod = link(*ctx, *c, binaries, r_log);
- optimize(*mod, c->getCodeGenOpts().OptimizationLevel, !create_library);
+ optimize(*mod, dev.ir_target(), c->getCodeGenOpts().OptimizationLevel, !create_library);
static std::atomic_uint seq(0);
const std::string id = "." + mod->getModuleIdentifier() + "-" +
--
2.42.0

View File

@ -0,0 +1,149 @@
From b0158d174d297276397b21a6657ea0ef14652183 Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied@redhat.com>
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

View File

@ -0,0 +1,74 @@
From 17ab0f2ece0a45dd5df507a466ecf6f40d452e1a Mon Sep 17 00:00:00 2001
From: Lucas Fryzek <lfryzek@igalia.com>
Date: Wed, 3 Dec 2025 19:33:57 -0500
Subject: [PATCH 1/2] drisw: Modify drisw_swap_buffers_with_damage to swap
entire buffer
When swapping buffer with damage regions, to be strictly correct we
need to swap the entire back buffer to the front buffer. This needs to
be done in case the compositor does not support damage regions. This
means we need to ignore the input damage region and tell drisw to swap
the entire buffer.
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38817>
---
src/gallium/frontends/dri/drisw.c | 28 ++++++++--------------------
1 file changed, 8 insertions(+), 20 deletions(-)
diff --git a/src/gallium/frontends/dri/drisw.c b/src/gallium/frontends/dri/drisw.c
index 4359ca569e5..394b6986832 100644
--- a/src/gallium/frontends/dri/drisw.c
+++ b/src/gallium/frontends/dri/drisw.c
@@ -225,6 +225,13 @@ drisw_copy_to_front(struct pipe_context *pipe,
static void
drisw_swap_buffers_with_damage(struct dri_drawable *drawable, int nrects, const int *rects)
{
+ /* Damage regions still require us to update the whole front buffer
+ * in case the compositor doesn't obey them, so we will just ignore
+ * the passed in damage regions and swap the whole buffer
+ */
+ (void)nrects;
+ (void)rects;
+
struct dri_context *ctx = dri_get_current();
struct dri_screen *screen = drawable->screen;
struct pipe_resource *ptex;
@@ -242,25 +249,6 @@ drisw_swap_buffers_with_damage(struct dri_drawable *drawable, int nrects, const
if (ptex) {
struct pipe_fence_handle *fence = NULL;
- struct pipe_box stack_boxes[64];
- if (nrects > ARRAY_SIZE(stack_boxes))
- nrects = 0;
- if (nrects) {
- for (unsigned int i = 0; i < nrects; i++) {
- const int *rect = &rects[i * 4];
-
- int w = MIN2(rect[2], ptex->width0);
- int h = MIN2(rect[3], ptex->height0);
- int x = CLAMP(rect[0], 0, ptex->width0);
- int y = CLAMP(ptex->height0 - rect[1] - h, 0, ptex->height0);
-
- if (h > ptex->height0 - y)
- h = ptex->height0 - y;
-
- u_box_2d(x, y, w, h, &stack_boxes[i]);
- }
- }
-
if (ctx->pp)
pp_run(ctx->pp, ptex, ptex, drawable->textures[ST_ATTACHMENT_DEPTH_STENCIL]);
@@ -279,7 +267,7 @@ drisw_swap_buffers_with_damage(struct dri_drawable *drawable, int nrects, const
screen->base.screen->fence_finish(screen->base.screen, ctx->st->pipe,
fence, OS_TIMEOUT_INFINITE);
screen->base.screen->fence_reference(screen->base.screen, &fence, NULL);
- drisw_copy_to_front(ctx->st->pipe, drawable, ptex, nrects, nrects ? stack_boxes : NULL);
+ drisw_copy_to_front(ctx->st->pipe, drawable, ptex, 0, NULL);
drawable->buffer_age = 1;
/* TODO: remove this if the framebuffer state doesn't change. */
--
2.52.0

View File

@ -0,0 +1,36 @@
From c016346b50e9085b531f9bcbd7cfd63d3806a3e1 Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied@redhat.com>
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 <dadschoorse@gmail.com>
Cc: mesa-stable
Fixes: e28cfb2bada2 ("gallivm: handle u8/u16 const loads properly on big-endian.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39813>
---
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

View File

@ -1,41 +0,0 @@
From 9ba416cdc67073cdda9a73fe9d37304b82bdd526 Mon Sep 17 00:00:00 2001
From: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Date: Fri, 12 May 2023 09:58:26 +0200
Subject: [PATCH] llvmpipe: only include old Transform includes when needed
This fixes building with recent LLVM where these 2 .h files
were removed.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8671
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22980>
---
src/gallium/auxiliary/gallivm/lp_bld_init.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.c b/src/gallium/auxiliary/gallivm/lp_bld_init.c
index 24d082398e9..9e0d6a5f643 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_init.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_init.c
@@ -42,14 +42,14 @@
#include <llvm/Config/llvm-config.h>
#include <llvm-c/Analysis.h>
-#include <llvm-c/Transforms/Scalar.h>
-#if LLVM_VERSION_MAJOR >= 7
-#include <llvm-c/Transforms/Utils.h>
-#endif
#include <llvm-c/BitWriter.h>
#if GALLIVM_USE_NEW_PASS == 1
#include <llvm-c/Transforms/PassBuilder.h>
#elif GALLIVM_HAVE_CORO == 1
+#include <llvm-c/Transforms/Scalar.h>
+#if LLVM_VERSION_MAJOR >= 7
+#include <llvm-c/Transforms/Utils.h>
+#endif
#if LLVM_VERSION_MAJOR <= 8 && (DETECT_ARCH_AARCH64 || DETECT_ARCH_ARM || DETECT_ARCH_S390 || DETECT_ARCH_MIPS64)
#include <llvm-c/Transforms/IPO.h>
#endif
--
2.42.0

View File

@ -1,28 +0,0 @@
From 460d2c46a903fed295a1528c8b6273dd6b0e0d19 Mon Sep 17 00:00:00 2001
From: thfrwn <11335318+rfht@users.noreply.github.com>
Date: Fri, 9 Feb 2024 17:00:55 -0500
Subject: [PATCH] mesa: fix off-by-one for newblock allocation in dlist_alloc
Cc: mesa-stable
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27556>
---
src/mesa/main/dlist.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index b0184a24e20..9213641699a 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -1220,7 +1220,7 @@ dlist_alloc(struct gl_context *ctx, OpCode opcode, GLuint bytes, bool align8)
ctx->ListState.CurrentPos++;
}
- if (ctx->ListState.CurrentPos + numNodes + contNodes > BLOCK_SIZE) {
+ if (ctx->ListState.CurrentPos + numNodes + contNodes >= BLOCK_SIZE) {
/* This block is full. Allocate a new block and chain to it */
Node *newblock;
Node *n = ctx->ListState.CurrentBlock + ctx->ListState.CurrentPos;
--
2.45.2

View File

@ -1,37 +0,0 @@
From f7434d7576032cf97e3c74ef09912f59617a4bad Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied@redhat.com>
Date: Fri, 14 Jun 2024 12:22:58 +1000
Subject: [PATCH] nouveau/nvc0: increase overallocation on shader bo to 2K
I've been seeing a bunch of read page faults at the end of the
shader allocation, nvk uses a full page at the end to overallocate
so align with that and see if it goes away.
ahulliet and skeggsb both said 2k was used.
Cc: mesa-stable
Reviewed-by: Arthur Huillet <ahuillet@nvidia.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29722>
---
src/gallium/drivers/nouveau/nvc0/nvc0_screen.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff -up mesa-23.1.4/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c.dma mesa-23.1.4/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
--- mesa-23.1.4/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c.dma 2023-07-21 22:42:42.000000000 +1000
+++ mesa-23.1.4/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c 2024-08-16 12:49:13.532998512 +1000
@@ -886,10 +886,11 @@ nvc0_screen_resize_text_area(struct nvc0
nouveau_heap_free(&screen->lib_code);
nouveau_heap_destroy(&screen->text_heap);
- /* XXX: getting a page fault at the end of the code buffer every few
- * launches, don't use the last 256 bytes to work around them - prefetch ?
+ /*
+ * Shader storage needs a 2K (from NVIDIA) overallocations at the end
+ * to avoid prefetch bugs.
*/
- nouveau_heap_init(&screen->text_heap, 0, size - 0x100);
+ nouveau_heap_init(&screen->text_heap, 0, size - 0x800);
/* update the code segment setup */
if (screen->eng3d->oclass < GV100_3D_CLASS) {

View File

@ -0,0 +1,72 @@
From 48799005d7f3b099cb2e93d09ce6dc211f619887 Mon Sep 17 00:00:00 2001
From: Lucas Fryzek <lfryzek@igalia.com>
Date: Wed, 3 Dec 2025 19:19:56 -0500
Subject: [PATCH 2/2] Revert "drisw: Copy entire buffer ignoring damage
regions"
This reverts commit 755e795e4c0d2660129c14998425f7dd3299bdf9.
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38817>
---
src/gallium/winsys/sw/dri/dri_sw_winsys.c | 38 +++++++++++++++++------
1 file changed, 29 insertions(+), 9 deletions(-)
diff --git a/src/gallium/winsys/sw/dri/dri_sw_winsys.c b/src/gallium/winsys/sw/dri/dri_sw_winsys.c
index 7d18b6138ea..0b2c8754ec5 100644
--- a/src/gallium/winsys/sw/dri/dri_sw_winsys.c
+++ b/src/gallium/winsys/sw/dri/dri_sw_winsys.c
@@ -352,21 +352,41 @@ dri_sw_displaytarget_display(struct sw_winsys *ws,
struct dri_sw_winsys *dri_sw_ws = dri_sw_winsys(ws);
struct dri_sw_displaytarget *dri_sw_dt = dri_sw_displaytarget(dt);
struct dri_drawable *dri_drawable = (struct dri_drawable *)context_private;
- unsigned width, height;
+ unsigned width, height, x = 0, y = 0;
unsigned blsize = util_format_get_blocksize(dri_sw_dt->format);
bool is_shm = dri_sw_dt->shmid != -1;
/* Set the width to 'stride / cpp'.
*
* PutImage correctly clips to the width of the dst drawable.
*/
- width = dri_sw_dt->stride / blsize;
- height = dri_sw_dt->height;
- if (is_shm)
- dri_sw_ws->lf->put_image_shm(dri_drawable, dri_sw_dt->shmid, dri_sw_dt->data, 0, 0,
- 0, 0, width, height, dri_sw_dt->stride);
- else
- dri_sw_ws->lf->put_image(dri_drawable, dri_sw_dt->data, width, height);
- return;
+ if (!nboxes) {
+ width = dri_sw_dt->stride / blsize;
+ height = dri_sw_dt->height;
+ if (is_shm)
+ dri_sw_ws->lf->put_image_shm(dri_drawable, dri_sw_dt->shmid, dri_sw_dt->data, 0, 0,
+ 0, 0, width, height, dri_sw_dt->stride);
+ else
+ dri_sw_ws->lf->put_image(dri_drawable, dri_sw_dt->data, width, height);
+ return;
+ }
+ for (unsigned i = 0; i < nboxes; i++) {
+ unsigned offset = dri_sw_dt->stride * box[i].y;
+ unsigned offset_x = box[i].x * blsize;
+ char *data = dri_sw_dt->data + offset;
+ x = box[i].x;
+ y = box[i].y;
+ width = box[i].width;
+ height = box[i].height;
+ if (is_shm) {
+ /* don't add x offset for shm, the put_image_shm will deal with it */
+ dri_sw_ws->lf->put_image_shm(dri_drawable, dri_sw_dt->shmid, dri_sw_dt->data, offset, offset_x,
+ x, y, width, height, dri_sw_dt->stride);
+ } else {
+ data += offset_x;
+ dri_sw_ws->lf->put_image2(dri_drawable, data,
+ x, y, width, height, dri_sw_dt->stride);
+ }
+ }
}
static void
--
2.52.0

View File

@ -0,0 +1,106 @@
From 30c754624ab73b180c66658701814ec5e3d12a31 Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied@redhat.com>
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

View File

@ -1,23 +0,0 @@
VERSION ?= 23.1.4
SANITIZE ?= 1
DIRNAME = mesa-${VERSION}
all: archive
clean:
rm -rf $(DIRNAME)/
rm -f mesa-${VERSION}.tar.xz
clone: clean
curl -O https://archive.mesa3d.org/mesa-${VERSION}.tar.xz
tar xf mesa-${VERSION}.tar.xz
sanitize: clone vl_mpeg12_decoder.c vl_decoder.c
ifdef SANITIZE
cat < vl_mpeg12_decoder.c > $(DIRNAME)/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
cat < vl_decoder.c > $(DIRNAME)/src/gallium/auxiliary/vl/vl_decoder.c
endif
archive: clone sanitize
tar caf ${DIRNAME}.tar.xz ${DIRNAME}

View File

@ -1,12 +0,0 @@
diff -up mesa-23.1.4/meson.build.dma mesa-23.1.4/meson.build
--- mesa-23.1.4/meson.build.dma 2023-07-28 10:15:41.807945483 +1000
+++ mesa-23.1.4/meson.build 2023-07-28 10:15:46.465030794 +1000
@@ -835,7 +835,7 @@ if get_option('allow-kcmp') \
pre_args += '-DALLOW_KCMP'
endif
-prog_python = import('python').find_installation('python3')
+prog_python = import('python').find_installation('python3.6')
has_mako = run_command(
prog_python, '-c',
'''

View File

@ -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.
<application name="gnome-shell" executable="gnome-shell">
<option name="adaptive_sync" value="false" />
<option name="v3d_nonmsaa_texture_size_limit" value="true" />
+ <option name="mesa_glthread" value="false"/>
</application>
<application name="Desktop — Plasma" executable="plasmashell">
<option name="adaptive_sync" value="false" />

View File

@ -1,13 +0,0 @@
diff -up mesa-21.3.0/src/gallium/frontends/lavapipe/lvp_device.cdma mesa-21.3.0/src/gallium/frontends/lavapipe/lvp_device.c
--- mesa-21.3.0/src/gallium/frontends/lavapipe/lvp_device.cdma 2021-11-18 06:16:20.000000000 +1000
+++ mesa-21.3.0/src/gallium/frontends/lavapipe/lvp_device.c 2021-11-18 07:03:17.652283186 +1000
@@ -213,6 +213,9 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_Creat
if (pAllocator == NULL)
pAllocator = vk_default_allocator();
+ if (!getenv("RH_SW_VULKAN"))
+ return VK_ERROR_INITIALIZATION_FAILED;
+
instance = vk_zalloc(pAllocator, sizeof(*instance), 8,
VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);
if (!instance)

View File

@ -1,30 +0,0 @@
diff -up mesa-23.1.4/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c.da mesa-23.1.4/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c
--- mesa-23.1.4/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c.da 2025-01-10 13:14:31.119630821 +1000
+++ mesa-23.1.4/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c 2025-01-10 13:15:11.917433170 +1000
@@ -149,6 +149,7 @@ nvc0_validate_fb(struct nvc0_context *nv
unsigned ms_mode = NVC0_3D_MULTISAMPLE_MODE_MS1;
unsigned nr_cbufs = fb->nr_cbufs;
bool serialize = false;
+ bool cbuf_is_linear = false;
nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_3D_FB);
@@ -203,8 +204,7 @@ nvc0_validate_fb(struct nvc0_context *nv
PUSH_DATA(push, 0);
nvc0_resource_fence(nvc0, res, NOUVEAU_BO_WR);
-
- assert(!fb->zsbuf);
+ cbuf_is_linear = true;
}
if (res->status & NOUVEAU_BUFFER_STATUS_GPU_READING)
@@ -216,7 +216,7 @@ nvc0_validate_fb(struct nvc0_context *nv
BCTX_REFN(nvc0->bufctx_3d, 3D_FB, res, WR);
}
- if (fb->zsbuf) {
+ if (fb->zsbuf && !cbuf_is_linear) {
struct nv50_miptree *mt = nv50_miptree(fb->zsbuf->texture);
struct nv50_surface *sf = nv50_surface(fb->zsbuf);
int unk = mt->base.base.target == PIPE_TEXTURE_2D;

View File

@ -1,11 +0,0 @@
diff -up mesa-22.3.3/src/gallium/drivers/radeonsi/driinfo_radeonsi.h.dma mesa-22.3.3/src/gallium/drivers/radeonsi/driinfo_radeonsi.h
--- mesa-22.3.3/src/gallium/drivers/radeonsi/driinfo_radeonsi.h.dma 2023-01-25 06:17:54.993167334 +1000
+++ mesa-22.3.3/src/gallium/drivers/radeonsi/driinfo_radeonsi.h 2023-01-25 06:17:57.363203425 +1000
@@ -1,7 +1,6 @@
// DriConf options specific to radeonsi
DRI_CONF_SECTION_PERFORMANCE
DRI_CONF_ADAPTIVE_SYNC(true)
-DRI_CONF_MESA_GLTHREAD(true)
DRI_CONF_SECTION_END
DRI_CONF_SECTION_DEBUG

View File

@ -1,20 +0,0 @@
#include "vl_decoder.h"
bool
vl_profile_supported(struct pipe_screen *screen, enum pipe_video_profile profile,
enum pipe_video_entrypoint entrypoint)
{
return false;
}
int
vl_level_supported(struct pipe_screen *screen, enum pipe_video_profile profile)
{
return 0;
}
struct pipe_video_codec *
vl_create_decoder(struct pipe_context *pipe,
const struct pipe_video_codec *templat)
{
return NULL;
}

View File

@ -1,7 +0,0 @@
#include "vl_mpeg12_decoder.h"
struct pipe_video_codec *
vl_create_mpeg12_decoder(struct pipe_context *context,
const struct pipe_video_codec *templat)
{
return NULL;
}

File diff suppressed because it is too large Load Diff