From 12cb109137ee7debbd08545848248f1489567e0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A7alo=20Duarte?= Date: Wed, 2 Aug 2023 14:47:19 +0100 Subject: [PATCH] Nix: fix nvidia patch for dual gpu system * this fix it most important for laptops with dgpu * remove post patch line wlroots.nix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gonçalo Duarte --- nix/patches/wlroots-nvidia.patch | 13 +++++++++++++ nix/wlroots.nix | 9 --------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/nix/patches/wlroots-nvidia.patch b/nix/patches/wlroots-nvidia.patch index 130eb041..01bdd342 100644 --- a/nix/patches/wlroots-nvidia.patch +++ b/nix/patches/wlroots-nvidia.patch @@ -1,3 +1,16 @@ +diff --git a/render/gles2/renderer.c b/render/gles2/renderer.c +index 9fe934f7..9662d4ee 100644 +--- a/render/gles2/renderer.c ++++ b/render/gles2/renderer.c +@@ -176,7 +176,7 @@ static bool gles2_bind_buffer(struct wlr_renderer *wlr_renderer, + assert(wlr_egl_is_current(renderer->egl)); + + push_gles2_debug(renderer); +- glFlush(); ++ glFinish(); + glBindFramebuffer(GL_FRAMEBUFFER, 0); + pop_gles2_debug(renderer); + diff --git a/types/output/render.c b/types/output/render.c index 2e38919a..97f78608 100644 --- a/types/output/render.c diff --git a/nix/wlroots.nix b/nix/wlroots.nix index f416a7dc..794bb959 100644 --- a/nix/wlroots.nix +++ b/nix/wlroots.nix @@ -46,15 +46,6 @@ assert (lib.assertMsg (hidpiXWayland -> enableXWayland) '' ++ (lib.optionals nvidiaPatches [ ./patches/wlroots-nvidia.patch ]); - postPatch = - (old.postPatch or "") - + ( - if nvidiaPatches - then '' - substituteInPlace render/gles2/renderer.c --replace "glFlush();" "glFinish();" - '' - else "" - ); buildInputs = old.buildInputs ++ [hwdata libliftoff libdisplay-info]; NIX_CFLAGS_COMPILE = toString [