diff options
Diffstat (limited to 'files/nixpkgs-patches')
| -rw-r--r-- | files/nixpkgs-patches/30720.diff | 106 | ||||
| -rw-r--r-- | files/nixpkgs-patches/399388.diff | 294 | ||||
| -rw-r--r-- | files/nixpkgs-patches/minus_screenshot.diff | 12 |
3 files changed, 0 insertions, 412 deletions
diff --git a/files/nixpkgs-patches/30720.diff b/files/nixpkgs-patches/30720.diff deleted file mode 100644 index 4c80212..0000000 --- a/files/nixpkgs-patches/30720.diff +++ /dev/null @@ -1,106 +0,0 @@ -diff --git a/src/amd/compiler/aco_scheduler.cpp b/src/amd/compiler/aco_scheduler.cpp -index 0bfce41101e5a1a3d84632fee58f99ae398cdcc9..f3c1555c1e749b00080dfaf882a59f7ae42357d6 100644 ---- a/src/amd/compiler/aco_scheduler.cpp -+++ b/src/amd/compiler/aco_scheduler.cpp -@@ -12,17 +12,17 @@ - #include <algorithm> - #include <vector> - --#define SMEM_WINDOW_SIZE (350 - ctx.num_waves * 35) --#define VMEM_WINDOW_SIZE (1024 - ctx.num_waves * 64) -+#define SMEM_WINDOW_SIZE (256 - ctx.occupancy_factor * 16) -+#define VMEM_WINDOW_SIZE (1024 - ctx.occupancy_factor * 64) - #define LDS_WINDOW_SIZE 64 - #define POS_EXP_WINDOW_SIZE 512 --#define SMEM_MAX_MOVES (64 - ctx.num_waves * 4) --#define VMEM_MAX_MOVES (256 - ctx.num_waves * 16) -+#define SMEM_MAX_MOVES (128 - ctx.occupancy_factor * 8) -+#define VMEM_MAX_MOVES (256 - ctx.occupancy_factor * 16) - #define LDSDIR_MAX_MOVES 10 - #define LDS_MAX_MOVES 32 - /* creating clauses decreases def-use distances, so make it less aggressive the lower num_waves is */ --#define VMEM_CLAUSE_MAX_GRAB_DIST (ctx.num_waves * 2) --#define VMEM_STORE_CLAUSE_MAX_GRAB_DIST (ctx.num_waves * 4) -+#define VMEM_CLAUSE_MAX_GRAB_DIST (ctx.occupancy_factor * 2) -+#define VMEM_STORE_CLAUSE_MAX_GRAB_DIST (ctx.occupancy_factor * 4) - #define POS_EXP_MAX_MOVES 512 - - namespace aco { -@@ -115,7 +115,7 @@ struct MoveState { - - struct sched_ctx { - amd_gfx_level gfx_level; -- int16_t num_waves; -+ int16_t occupancy_factor; - int16_t last_SMEM_stall; - int last_SMEM_dep_idx; - MoveState mv; -@@ -745,7 +745,7 @@ schedule_SMEM(sched_ctx& ctx, Block* block, Instruction* current, int idx) - /* only move VMEM instructions below descriptor loads. be more aggressive at higher num_waves - * to help create more vmem clauses */ - if ((candidate->isVMEM() || candidate->isFlatLike()) && -- (cursor.insert_idx - cursor.source_idx > (ctx.num_waves * 4) || -+ (cursor.insert_idx - cursor.source_idx > (ctx.occupancy_factor * 4) || - current->operands[0].size() == 4)) - break; - /* don't move descriptor loads below buffer loads */ -@@ -847,7 +847,7 @@ schedule_SMEM(sched_ctx& ctx, Block* block, Instruction* current, int idx) - } - - ctx.last_SMEM_dep_idx = found_dependency ? up_cursor.insert_idx : 0; -- ctx.last_SMEM_stall = 10 - ctx.num_waves - k; -+ ctx.last_SMEM_stall = 10 - ctx.occupancy_factor - k; - } - - void -@@ -1247,35 +1247,30 @@ schedule_program(Program* program) - RegisterDemand demand; - for (Block& block : program->blocks) - demand.update(block.register_demand); -- demand.vgpr += program->config->num_shared_vgprs / 2; - - sched_ctx ctx; - ctx.gfx_level = program->gfx_level; - ctx.mv.depends_on.resize(program->peekAllocationId()); - ctx.mv.RAR_dependencies.resize(program->peekAllocationId()); - ctx.mv.RAR_dependencies_clause.resize(program->peekAllocationId()); -- /* Allowing the scheduler to reduce the number of waves to as low as 5 -- * improves performance of Thrones of Britannia significantly and doesn't -- * seem to hurt anything else. */ -- unsigned wave_fac = program->dev.physical_vgprs / 256; -- if (program->num_waves <= 5 * wave_fac) -- ctx.num_waves = program->num_waves; -- else if (demand.vgpr >= 29) -- ctx.num_waves = 5 * wave_fac; -- else if (demand.vgpr >= 25) -- ctx.num_waves = 6 * wave_fac; -- else -- ctx.num_waves = 7 * wave_fac; -- ctx.num_waves = std::max<uint16_t>(ctx.num_waves, program->min_waves); -- ctx.num_waves = std::min<uint16_t>(ctx.num_waves, program->num_waves); -- ctx.num_waves = max_suitable_waves(program, ctx.num_waves); -- -- assert(ctx.num_waves >= program->min_waves); -- ctx.mv.max_registers = get_addr_regs_from_waves(program, ctx.num_waves); -+ -+ const int wave_factor = program->gfx_level >= GFX10 ? 2 : 1; -+ const float reg_file_multiple = program->dev.physical_vgprs / (256.0 * wave_factor); -+ const int wave_minimum = std::max<int>(program->min_waves, 4 * wave_factor * reg_file_multiple); -+ -+ /* If we already have less waves than the minimum, don't reduce them further. -+ * Otherwise, sacrifice some waves and use more VGPRs, in order to improve scheduling. -+ */ -+ int vpgr_demand = std::max<int>(24, demand.vgpr) + 12 * reg_file_multiple; -+ int target_waves = std::max(wave_minimum, program->dev.physical_vgprs / vpgr_demand); -+ target_waves = max_suitable_waves(program, std::min<int>(program->num_waves, target_waves)); -+ assert(target_waves >= program->min_waves); -+ -+ ctx.mv.max_registers = get_addr_regs_from_waves(program, target_waves); - ctx.mv.max_registers.vgpr -= 2; - - /* VMEM_MAX_MOVES and such assume pre-GFX10 wave count */ -- ctx.num_waves = std::max<uint16_t>(ctx.num_waves / wave_fac, 1); -+ ctx.occupancy_factor = target_waves / wave_factor; - - /* NGG culling shaders are very sensitive to position export scheduling. - * Schedule less aggressively when early primitive export is used, and diff --git a/files/nixpkgs-patches/399388.diff b/files/nixpkgs-patches/399388.diff deleted file mode 100644 index 4815efe..0000000 --- a/files/nixpkgs-patches/399388.diff +++ /dev/null @@ -1,294 +0,0 @@ -diff --git a/pkgs/development/libraries/mesa/common.nix b/pkgs/development/libraries/mesa/common.nix -index adfbe426cc00de..471080fd75a071 100644 ---- a/pkgs/development/libraries/mesa/common.nix -+++ b/pkgs/development/libraries/mesa/common.nix -@@ -5,14 +5,14 @@ - # nix build .#legacyPackages.x86_64-darwin.mesa .#legacyPackages.aarch64-darwin.mesa - rec { - pname = "mesa"; -- version = "25.0.5"; -+ version = "25.1.0-rc3"; - - src = fetchFromGitLab { - domain = "gitlab.freedesktop.org"; - owner = "mesa"; - repo = "mesa"; - rev = "mesa-${version}"; -- hash = "sha256-zYZgvuRnqhPbVmxmdmq4rLng20gMiAvJYD0o4jN5McI="; -+ hash = "sha256-X1T4dqQSHhnoRXXjjyWrRu4u8RJ5h+PFBQYf/gUInm4="; - }; - - meta = { -diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix -index f691f2d3bf8cbb..00a4d7964ed27e 100644 ---- a/pkgs/development/libraries/mesa/default.nix -+++ b/pkgs/development/libraries/mesa/default.nix -@@ -16,6 +16,7 @@ - libdrm, - libgbm, - libglvnd, -+ libpng, - libunwind, - libva-minimal, - libvdpau, -@@ -103,8 +104,10 @@ - ], - vulkanLayers ? [ - "device-select" -- "overlay" - "intel-nullhw" -+ "overlay" -+ "screenshot" -+ "vram-report-limit" - ], - mesa, - mesa-gl-headers, -@@ -161,7 +164,6 @@ stdenv.mkDerivation { - - patches = [ - ./opencl.patch -- ./system-gbm.patch - ]; - - postPatch = '' -@@ -223,7 +225,6 @@ stdenv.mkDerivation { - (lib.mesonBool "libgbm-external" true) - - (lib.mesonBool "gallium-nine" false) # Direct3D9 in Wine, largely supplanted by DXVK -- (lib.mesonBool "osmesa" false) # deprecated upstream - - # Only used by xf86-video-vmware, which has more features than VMWare's KMS driver, - # so we're keeping it for now. Should be removed when that's no longer the case. -@@ -277,6 +278,7 @@ stdenv.mkDerivation { - libdrm - libgbm - libglvnd -+ libpng - libunwind - libva-minimal - libvdpau -@@ -350,7 +352,7 @@ stdenv.mkDerivation { - postInstall = '' - moveToOutput bin/intel_clc $cross_tools - moveToOutput bin/mesa_clc $cross_tools -- moveToOutput bin/vtn_bindgen $cross_tools -+ moveToOutput bin/vtn_bindgen2 $cross_tools - - moveToOutput "lib/lib*OpenCL*" $opencl - # Construct our own .icd file that contains an absolute path. -diff --git a/pkgs/development/libraries/mesa/opencl.patch b/pkgs/development/libraries/mesa/opencl.patch -index 8444237d3d5418..9d40da82f85649 100644 ---- a/pkgs/development/libraries/mesa/opencl.patch -+++ b/pkgs/development/libraries/mesa/opencl.patch -@@ -13,8 +13,8 @@ index c150bff74ff..37fa7f0531b 100644 - - diff --git a/meson_options.txt b/meson_options.txt - index 82324617884..4bde97a8568 100644 ----- a/meson_options.txt --+++ b/meson_options.txt -+--- a/meson.options -++++ b/meson.options - @@ -738,3 +738,10 @@ option( - 'none', 'dri2' - ], -diff --git a/pkgs/development/libraries/mesa/system-gbm.patch b/pkgs/development/libraries/mesa/system-gbm.patch -deleted file mode 100644 -index 7f16ff7469c757..00000000000000 ---- a/pkgs/development/libraries/mesa/system-gbm.patch -+++ /dev/null -@@ -1,195 +0,0 @@ --commit 69914d79c3d86b0aee80665c51074cf8cc55f660 --Author: K900 <me@0upti.me> --Date: 2025-03-05 13:14:02 +0300 -- -- meson: support building with system libgbm -- -- This is the next step towards making libgbm just a loader. -- --diff --git a/meson.build b/meson.build --index 4766ce838ba..300a6bb0cc8 100644 ----- a/meson.build --+++ b/meson.build --@@ -2377,7 +2377,7 @@ summary(egl_summary, section: 'EGL', bool_yn: true, list_sep: ' ') -- -- gbm_summary = {'Enabled': with_gbm} -- if with_gbm --- gbm_summary += {'Backends path': gbm_backends_path} --+ gbm_summary += {'External libgbm': get_option('libgbm-external'), 'Backends path': gbm_backends_path} -- endif -- summary(gbm_summary, section: 'GBM', bool_yn: true, list_sep: ' ') -- --diff --git a/meson_options.txt b/meson_options.txt --index 2622cf1d235..7bf8ae8a1c5 100644 ----- a/meson_options.txt --+++ b/meson_options.txt --@@ -329,6 +329,13 @@ option( -- description : 'Build support for gbm platform' -- ) -- --+option( --+ 'libgbm-external', --+ type: 'boolean', --+ value: false, --+ description: 'Whether to use external libgbm (default: use in-tree copy)' --+) --+ -- option( -- 'gbm-backends-path', -- type : 'string', --diff --git a/src/egl/meson.build b/src/egl/meson.build --index a02b83419c4..ae4b0c5e063 100644 ----- a/src/egl/meson.build --+++ b/src/egl/meson.build --@@ -108,9 +108,8 @@ if with_dri -- endif -- if with_gbm and not with_platform_android -- files_egl += files('drivers/dri2/platform_drm.c') --- link_for_egl += libgbm --- incs_for_egl += [inc_gbm, include_directories('../gbm/main')] --- deps_for_egl += dep_libdrm --+ incs_for_egl += [include_directories('../gbm/backends/dri')] --+ deps_for_egl += [dep_libdrm, dep_gbm] -- endif -- if with_platform_wayland -- deps_for_egl += [dep_wayland_client, dep_wayland_server, dep_wayland_egl_headers] --diff --git a/src/gallium/targets/dril/dril_target.c b/src/gallium/targets/dril/dril_target.c --index 339e9376c3d..f1a0bb18ed8 100644 ----- a/src/gallium/targets/dril/dril_target.c --+++ b/src/gallium/targets/dril/dril_target.c --@@ -25,7 +25,7 @@ -- #include <dlfcn.h> -- #include <EGL/egl.h> -- #include <EGL/eglext.h> ---#include "gbm/main/gbm.h" --+#include <gbm.h> -- #include "drm-uapi/drm_fourcc.h" -- -- #define EGL_PLATFORM_GBM_MESA 0x31D7 --diff --git a/src/gallium/targets/dril/meson.build b/src/gallium/targets/dril/meson.build --index 7cfa982ffe1..22b955b9074 100644 ----- a/src/gallium/targets/dril/meson.build --+++ b/src/gallium/targets/dril/meson.build --@@ -51,10 +51,10 @@ dril_dri = shared_library( -- link_depends : dril_link_depends, -- link_with : [ -- libgallium, --- libgbm, -- ], -- dependencies : [ -- idep_mesautil, --+ dep_gbm, -- ], -- # Will be deleted during installation, see install_megadrivers.py -- install : true, --diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c --index a51e3cb3b8d..f1a5e0f7649 100644 ----- a/src/gbm/backends/dri/gbm_dri.c --+++ b/src/gbm/backends/dri/gbm_dri.c --@@ -43,7 +43,7 @@ -- -- #include "mesa_interface.h" -- #include "gbm_driint.h" ---#include "gbmint.h" --+#include <gbm_backend_abi.h> -- #include "loader_dri_helper.h" -- #include "kopper_interface.h" -- #include "loader.h" --diff --git a/src/gbm/backends/dri/gbm_driint.h b/src/gbm/backends/dri/gbm_driint.h --index 9b324aeaf12..9c7588e5726 100644 ----- a/src/gbm/backends/dri/gbm_driint.h --+++ b/src/gbm/backends/dri/gbm_driint.h --@@ -31,7 +31,7 @@ -- #include <xf86drm.h> -- #include <string.h> -- #include <sys/mman.h> ---#include "gbmint.h" --+#include <gbm_backend_abi.h> -- #include "c11/threads.h" -- -- #include <GL/gl.h> /* mesa_interface needs GL types */ --diff --git a/src/gbm/backends/dri/meson.build b/src/gbm/backends/dri/meson.build --index 9b5d13e9db8..84a40656980 100644 ----- a/src/gbm/backends/dri/meson.build --+++ b/src/gbm/backends/dri/meson.build --@@ -11,10 +11,10 @@ endif -- shared_library( -- 'dri_gbm', -- files('gbm_dri.c', 'gbm_driint.h'), --- include_directories : [incs_gbm, incs_gbm_dri, inc_st_dri, inc_gallium_aux], --+ include_directories : [inc_gallium, incs_gbm_dri, inc_loader, inc_st_dri, inc_gallium_aux], -- link_args : [ld_args_gc_sections], -- link_with : [libloader, libgallium_dri], --- dependencies : [deps_gbm_dri, dep_dl, dep_libdrm, idep_mesautil, idep_xmlconfig], --+ dependencies : [deps_gbm_dri, dep_dl, dep_gbm, dep_libdrm, idep_mesautil, idep_xmlconfig], -- gnu_symbol_visibility : 'hidden', -- install : true, -- install_dir: join_paths(get_option('libdir'), 'gbm'), --diff --git a/src/gbm/meson.build b/src/gbm/meson.build --index eaed028d049..97e8d5fa044 100644 ----- a/src/gbm/meson.build --+++ b/src/gbm/meson.build --@@ -15,10 +15,6 @@ args_gbm = [ -- ] -- incs_gbm = [include_directories('main'), inc_loader, inc_gallium] -- ---if with_dri2 --- subdir('backends/dri') ---endif --- -- libgbm_name = 'gbm' -- -- if with_platform_android and get_option('platform-sdk-version') >= 30 --@@ -43,7 +39,7 @@ if with_tests -- test('gbm-abi-check', abi_check, suite : ['gbm']) -- endif -- ---install_headers('main/gbm.h') --+install_headers('main/gbm.h', 'main/gbm_backend_abi.h') -- -- pkg.generate( -- name : 'gbm', --@@ -67,3 +63,8 @@ if with_symbols_check -- suite : ['gbm'], -- ) -- endif --+ --+dep_gbm = declare_dependency( --+ link_with : libgbm, --+ include_directories : inc_gbm, --+) --diff --git a/src/meson.build b/src/meson.build --index d443d2b41bb..74250ed2148 100644 ----- a/src/meson.build --+++ b/src/meson.build --@@ -127,11 +127,17 @@ endif -- if with_glx == 'dri' -- subdir('glx') -- endif --+ -- if with_gbm --- subdir('gbm') --+ if get_option('libgbm-external') --+ dep_gbm = dependency('gbm') --+ else --+ subdir('gbm') --+ endif -- else --- inc_gbm = [] --+ dep_gbm = null_dep -- endif --+ -- if with_egl -- subdir('egl') -- endif --@@ -141,6 +147,10 @@ if with_gallium and with_gbm -- endif -- endif -- --+if with_gbm and with_dri2 --+ subdir('gbm/backends/dri') --+endif --+ -- # This must be after at least mesa, glx, and gallium, since libgl will be -- # defined in one of those subdirs depending on the glx provider. -- if with_glx != 'disabled' and not with_glvnd diff --git a/files/nixpkgs-patches/minus_screenshot.diff b/files/nixpkgs-patches/minus_screenshot.diff deleted file mode 100644 index 1c014d9..0000000 --- a/files/nixpkgs-patches/minus_screenshot.diff +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix -index d113b66cb..ea7f072c8 100644 ---- a/pkgs/development/libraries/mesa/default.nix -+++ b/pkgs/development/libraries/mesa/default.nix -@@ -105,7 +105,6 @@ - "device-select" - "intel-nullhw" - "overlay" -- "screenshot" - "vram-report-limit" - ], - mesa, |