From 38d19b4daf8c2e0c1bc6b695d2fc45b8193c17a1 Mon Sep 17 00:00:00 2001 From: Trolli Schmittlauch Date: Thu, 8 Feb 2024 22:14:41 +0100 Subject: [PATCH] direnv: prefer usage of nix-direnv over lorri --- home/home.nix | 3 +- ...e-alloc_range-error-handling-routine.patch | 47 +++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 hosts/framenix/0001-drm-buddy-Improve-alloc_range-error-handling-routine.patch diff --git a/home/home.nix b/home/home.nix index eab8c69..1640cff 100644 --- a/home/home.nix +++ b/home/home.nix @@ -119,7 +119,6 @@ let ]; nixHelpers = [ - lorri nixpkgs-review nixpkgs-fmt nix-top @@ -282,6 +281,7 @@ in programs.direnv = { enable = true; + nix-direnv.enable = true; enableZshIntegration = true; }; @@ -324,6 +324,7 @@ in systemd.user.startServices = true; + # for backwards compatibility services.lorri.enable = true; # media button control support from Bluetooth devices diff --git a/hosts/framenix/0001-drm-buddy-Improve-alloc_range-error-handling-routine.patch b/hosts/framenix/0001-drm-buddy-Improve-alloc_range-error-handling-routine.patch new file mode 100644 index 0000000..cc0d4a0 --- /dev/null +++ b/hosts/framenix/0001-drm-buddy-Improve-alloc_range-error-handling-routine.patch @@ -0,0 +1,47 @@ +From 6e77e6de7582f35138fa1c7523268602ecb2e0a0 Mon Sep 17 00:00:00 2001 +From: Arunpravin Paneer Selvam +Date: Tue, 6 Feb 2024 10:39:24 -0800 +Subject: [PATCH] drm/buddy: Improve alloc_range error handling routine + +If alloc_range() couldn't allocate the requuired size, +return -ENOSPC. + +Signed-off-by: Arunpravin Paneer Selvam +--- + drivers/gpu/drm/drm_buddy.c | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/drm_buddy.c b/drivers/gpu/drm/drm_buddy.c +index f57e6d74fb0e..d5aba6392da0 100644 +--- a/drivers/gpu/drm/drm_buddy.c ++++ b/drivers/gpu/drm/drm_buddy.c +@@ -483,9 +483,9 @@ static int __alloc_range(struct drm_buddy *mm, + struct list_head *blocks, + u64 *total_allocated_on_err) + { ++ u64 total_allocated = 0, allocated_size = 0; + struct drm_buddy_block *block; + struct drm_buddy_block *buddy; +- u64 total_allocated = 0; + LIST_HEAD(allocated); + u64 end; + int err; +@@ -539,6 +539,15 @@ static int __alloc_range(struct drm_buddy *mm, + } while (1); + + list_splice_tail(&allocated, blocks); ++ ++ list_for_each_entry(block, blocks, link) ++ allocated_size += drm_buddy_block_size(mm, block); ++ ++ if (allocated_size < size) { ++ err = -ENOSPC; ++ goto err_free; ++ } ++ + return 0; + + err_undo: +-- +2.25.1 +