Skip to content

Commit

Permalink
nvidia: Kind of, maybe perhaps fix screenshares?
Browse files Browse the repository at this point in the history
  • Loading branch information
TLATER committed Jan 28, 2024
1 parent fdbf910 commit 14b2769
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nixos-config/sway.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
src = prev.fetchFromGitHub {
owner = "emersion";
repo = old.pname;
rev = "b5f387821800e32d4f82001504668d819f02bb4b";
hash = "sha256-TeTDJVFW0NHZpmTm8PAXTzbzk6kolvY7Vd55YQfJV20=";
rev = "1eaa02eb18ab783b64dc89f1681909dc30baa805";
hash = "sha256-vRMNkMFidNmSQkhz5n+EBg7IkRjMYqrhdhM80G3K3WI=";
};
});
})
Expand Down
1 change: 1 addition & 0 deletions nixos-config/yui/nvidia/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
wlroots_0_16 = final.wlroots_0_16.overrideAttrs (_: {
patches = [
./wlroots-nvidia.patch
./wlroots-screenshare.patch
];
});
})
Expand Down
29 changes: 29 additions & 0 deletions nixos-config/yui/nvidia/wlroots-screenshare.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
diff --git a/types/output/render.c b/types/output/render.c
index 5d4dccc1..7fea66e3 100644
--- a/types/output/render.c
+++ b/types/output/render.c
@@ -330,22 +330,8 @@ struct wlr_drm_format *output_pick_format(struct wlr_output *output,
}

uint32_t wlr_output_preferred_read_format(struct wlr_output *output) {
- struct wlr_renderer *renderer = output->renderer;
- assert(renderer != NULL);
-
- if (!renderer->impl->preferred_read_format || !renderer->impl->read_pixels) {
- return DRM_FORMAT_INVALID;
- }
-
- if (!output_attach_back_buffer(output, &output->pending, NULL)) {
- return false;
- }
-
- uint32_t fmt = renderer->impl->preferred_read_format(renderer);
-
- output_clear_back_buffer(output);
-
- return fmt;
+ // Hack for Nvidia screen sharing, might break other gpus (and maybe even some stuff in nvidia itself)
+ return DRM_FORMAT_XRGB8888;
}

bool output_is_direct_scanout(struct wlr_output *output,

0 comments on commit 14b2769

Please sign in to comment.