aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-08-15 12:08:16 +0200
committerdec05eba <dec05eba@protonmail.com>2024-08-15 12:08:16 +0200
commitc1debaa838795c1d628ad9295f2c1b8498ea4f4a (patch)
tree5a11aaae441d553a516c26aa22dbc8a42ba8f227
parent85d59ea2c8c8e64e55247b967d1469ad92e63e6b (diff)
Disable prime-run + portal for now
-rw-r--r--TODO4
-rw-r--r--src/main.cpp27
2 files changed, 22 insertions, 9 deletions
diff --git a/TODO b/TODO
index 7ecc530..d79eace 100644
--- a/TODO
+++ b/TODO
@@ -156,4 +156,6 @@ Explicit sync is done with the drm property IN_FENCE_FD (see https://drmdb.emers
The update fps appear to be lower when recording a monitor instead of using portal on intel. Does this reflect in game framerate?
-Recording a monitor belonging to another gpu might be possible by using GL_TEXTURE_EXTERNAL_OES instead for the texture. \ No newline at end of file
+Recording a monitor belonging to another gpu might be possible by using GL_TEXTURE_EXTERNAL_OES instead for the texture.
+
+Fix glitches when using prime-run with desktop portal. It happens when moving a window around. It's probably a syncing issue. \ No newline at end of file
diff --git a/src/main.cpp b/src/main.cpp
index 8c09c7b..19a885f 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1654,6 +1654,18 @@ static bool is_xwayland(Display *display) {
return xwayland_found;
}
+static bool is_using_prime_run() {
+ const char *prime_render_offload = getenv("__NV_PRIME_RENDER_OFFLOAD");
+ return prime_render_offload && strcmp(prime_render_offload, "1") == 0;
+}
+
+static void disable_prime_run() {
+ unsetenv("__NV_PRIME_RENDER_OFFLOAD");
+ unsetenv("__NV_PRIME_RENDER_OFFLOAD_PROVIDER");
+ unsetenv("__GLX_VENDOR_LIBRARY_NAME");
+ unsetenv("__VK_LAYER_NV_optimus");
+}
+
static void list_system_info(bool wayland) {
printf("display_server %s\n", wayland ? "wayland" : "x11");
}
@@ -1767,10 +1779,7 @@ static void info_command() {
// Disable prime-run and similar options as it doesn't work, the monitor to capture has to be run on the same device.
// This is fine on wayland since nvidia uses drm interface there and the monitor query checks the monitors connected
// to the drm device.
- unsetenv("__NV_PRIME_RENDER_OFFLOAD");
- unsetenv("__NV_PRIME_RENDER_OFFLOAD_PROVIDER");
- unsetenv("__GLX_VENDOR_LIBRARY_NAME");
- unsetenv("__VK_LAYER_NV_optimus");
+ disable_prime_run();
}
gsr_egl egl;
@@ -2459,10 +2468,12 @@ int main(int argc, char **argv) {
// Disable prime-run and similar options as it doesn't work, the monitor to capture has to be run on the same device.
// This is fine on wayland since nvidia uses drm interface there and the monitor query checks the monitors connected
// to the drm device.
- unsetenv("__NV_PRIME_RENDER_OFFLOAD");
- unsetenv("__NV_PRIME_RENDER_OFFLOAD_PROVIDER");
- unsetenv("__GLX_VENDOR_LIBRARY_NAME");
- unsetenv("__VK_LAYER_NV_optimus");
+ disable_prime_run();
+ }
+
+ if(strcmp(window_str, "portal") == 0 && is_using_prime_run()) {
+ fprintf(stderr, "Warning: use of prime-run with -w portal option is currently not supported. Disabling prime-run\n");
+ disable_prime_run();
}
if(video_codec_is_hdr(video_codec) && !wayland) {