diff options
Diffstat (limited to 'files/nixpkgs-patches')
| -rw-r--r-- | files/nixpkgs-patches/30720.diff | 106 | ||||
| -rw-r--r-- | files/nixpkgs-patches/399384.diff | 21 | ||||
| -rw-r--r-- | files/nixpkgs-patches/399388.diff | 269 | ||||
| -rw-r--r-- | files/nixpkgs-patches/f57f3d99091a105cbd9484c33264558785efc4be.diff | 64 | ||||
| -rw-r--r-- | files/nixpkgs-patches/minus_screenshot.diff | 12 |
5 files changed, 408 insertions, 64 deletions
diff --git a/files/nixpkgs-patches/30720.diff b/files/nixpkgs-patches/30720.diff new file mode 100644 index 0000000..4c80212 --- /dev/null +++ b/files/nixpkgs-patches/30720.diff @@ -0,0 +1,106 @@ +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/399384.diff b/files/nixpkgs-patches/399384.diff new file mode 100644 index 0000000..f5737f5 --- /dev/null +++ b/files/nixpkgs-patches/399384.diff @@ -0,0 +1,21 @@ +diff --git a/pkgs/development/libraries/mesa/common.nix b/pkgs/development/libraries/mesa/common.nix +index 496f74440aad98..91624d6d4bfc03 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.3"; ++ version = "25.0.4"; + + src = fetchFromGitLab { + domain = "gitlab.freedesktop.org"; + owner = "mesa"; + repo = "mesa"; + rev = "mesa-${version}"; +- hash = "sha256-OM/T6pkq4vgEYZ7TlLRVsyMknLxQC9L+iOPF20ToZi8="; ++ hash = "sha256-TiMd1YVQxOlrmdwDQDoTFh6nbVMfnW75ISfzoUQgKHU="; + }; + + meta = { diff --git a/files/nixpkgs-patches/399388.diff b/files/nixpkgs-patches/399388.diff new file mode 100644 index 0000000..41f6ebe --- /dev/null +++ b/files/nixpkgs-patches/399388.diff @@ -0,0 +1,269 @@ +diff --git a/pkgs/development/libraries/mesa/common.nix b/pkgs/development/libraries/mesa/common.nix +index 91624d6d4bfc03..0332e1a5b22bb6 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.4"; ++ version = "25.1.0-rc1"; + + src = fetchFromGitLab { + domain = "gitlab.freedesktop.org"; + owner = "mesa"; + repo = "mesa"; + rev = "mesa-${version}"; +- hash = "sha256-TiMd1YVQxOlrmdwDQDoTFh6nbVMfnW75ISfzoUQgKHU="; ++ hash = "sha256-vQrTGGhIfy41uaCQ4rg+ZlCp43qI1wMK6QIrGKr4+Ts="; + }; + + meta = { +diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix +index 255cda5a742372..4994c83e680676 100644 +--- a/pkgs/development/libraries/mesa/default.nix ++++ b/pkgs/development/libraries/mesa/default.nix +@@ -103,8 +103,10 @@ + ], + vulkanLayers ? [ + "device-select" +- "overlay" + "intel-nullhw" ++ "overlay" ++ "screenshot" ++ "vram-report-limit" + ], + mesa, + mesa-gl-headers, +@@ -161,7 +163,6 @@ stdenv.mkDerivation { + + patches = [ + ./opencl.patch +- ./system-gbm.patch + ]; + + postPatch = '' +@@ -223,7 +224,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. +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/f57f3d99091a105cbd9484c33264558785efc4be.diff b/files/nixpkgs-patches/f57f3d99091a105cbd9484c33264558785efc4be.diff deleted file mode 100644 index 86100d5..0000000 --- a/files/nixpkgs-patches/f57f3d99091a105cbd9484c33264558785efc4be.diff +++ /dev/null @@ -1,64 +0,0 @@ -diff --git a/docs/changelog.rst b/docs/changelog.rst -index 502ee01193..b20c1a39f0 100644 ---- a/docs/changelog.rst -+++ b/docs/changelog.rst -@@ -110,6 +110,9 @@ Detailed list of changes - - Fix a regression in version 0.40.0 causing a crash when the underline - thickness of the font is zero (:iss:`8443`) - -+- Fix a regression in version 0.40.0 causing a hang on resizing with a wide -+ character at the right edge of a line that needs to be moved onto the next -+ line (:iss:`8464`) - - 0.40.1 [2025-03-18] - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -diff --git a/kitty/resize.c b/kitty/resize.c -index 78980b7886..280495fab3 100644 ---- a/kitty/resize.c -+++ b/kitty/resize.c -@@ -228,7 +228,7 @@ multiline_copy_src_to_dest(Rewrap *r) { - - static void - fast_copy_src_to_dest(Rewrap *r) { -- CPUCell *c; index_type mc_width; -+ CPUCell *c; - while (r->src.x < r->src_x_limit) { - if (r->dest.x >= dest_xnum) { - next_dest_line(r, true); -@@ -238,17 +238,10 @@ fast_copy_src_to_dest(Rewrap *r) { - } - } - index_type num = MIN(r->src_x_limit - r->src.x, dest_xnum - r->dest.x); -- if (num && (c = &r->src.line.cpu_cells[r->src.x + num - 1])->is_multicell && c->x != (mc_width = mcd_x_limit(c)) - 1) { -+ if (num && (c = &r->src.line.cpu_cells[r->src.x + num - 1])->is_multicell && c->x != mcd_x_limit(c) - 1) { - // we have a split multicell at the right edge of the copy region -- if (num > mc_width) num = MIN(r->src_x_limit - r->src.x - mc_width, num); -- else { -- if (mc_width > dest_xnum) { -- multiline_copy_src_to_dest(r); -- return; -- } -- r->dest.x = dest_xnum; -- continue; -- } -+ multiline_copy_src_to_dest(r); -+ return; - } - copy_range(&r->src.line, r->src.x, &r->dest.line, r->dest.x, num); - update_tracked_cursors(r, num, r->src.y, r->dest.y, r->src_x_limit); -diff --git a/kitty_tests/multicell.py b/kitty_tests/multicell.py -index 63e9892b81..94c2010c9f 100644 ---- a/kitty_tests/multicell.py -+++ b/kitty_tests/multicell.py -@@ -98,6 +98,11 @@ def assert_line(text, y=None): - def assert_cursor_at(x, y): - self.ae((s.cursor.x, s.cursor.y), (x, y)) - -+ s = self.create_screen(cols=8, lines=4) -+ s.draw('飛青進服三上') -+ s.resize(s.lines, 5) -+ self.ae('飛青', str(s.line(0))) -+ - s = self.create_screen(cols=6, lines=6) - - # Test basic multicell drawing diff --git a/files/nixpkgs-patches/minus_screenshot.diff b/files/nixpkgs-patches/minus_screenshot.diff new file mode 100644 index 0000000..1c014d9 --- /dev/null +++ b/files/nixpkgs-patches/minus_screenshot.diff @@ -0,0 +1,12 @@ +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, |