diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/capture/kms.c | 2 | ||||
-rw-r--r-- | src/capture/portal.c | 2 | ||||
-rw-r--r-- | src/capture/xcomposite.c | 2 | ||||
-rw-r--r-- | src/main.cpp | 3 | ||||
-rw-r--r-- | src/utils.c | 4 |
5 files changed, 7 insertions, 6 deletions
diff --git a/src/capture/kms.c b/src/capture/kms.c index 27ddec4..ba062f8 100644 --- a/src/capture/kms.c +++ b/src/capture/kms.c @@ -227,7 +227,7 @@ static int gsr_capture_kms_start(gsr_capture *cap, AVCodecContext *video_codec_c video_codec_context->height = FFALIGN(self->params.output_resolution.y, 2); } - self->fast_path_failed = self->params.egl->gpu_info.vendor == GSR_GPU_VENDOR_AMD && !gl_driver_version_greater_than(self->params.egl, 24, 0, 9); + self->fast_path_failed = self->params.egl->gpu_info.vendor == GSR_GPU_VENDOR_AMD && !gl_driver_version_greater_than(&self->params.egl->gpu_info, 24, 0, 9); if(self->fast_path_failed) fprintf(stderr, "gsr warning: gsr_capture_kms_start: your amd driver (mesa) version is known to be buggy (<= version 24.0.9), falling back to opengl copy\n"); diff --git a/src/capture/portal.c b/src/capture/portal.c index a441299..9161671 100644 --- a/src/capture/portal.c +++ b/src/capture/portal.c @@ -310,7 +310,7 @@ static int gsr_capture_portal_start(gsr_capture *cap, AVCodecContext *video_code video_codec_context->height = FFALIGN(self->params.output_resolution.y, 2); } - self->fast_path_failed = self->params.egl->gpu_info.vendor == GSR_GPU_VENDOR_AMD && !gl_driver_version_greater_than(self->params.egl, 24, 0, 9); + self->fast_path_failed = self->params.egl->gpu_info.vendor == GSR_GPU_VENDOR_AMD && !gl_driver_version_greater_than(&self->params.egl->gpu_info, 24, 0, 9); if(self->fast_path_failed) fprintf(stderr, "gsr warning: gsr_capture_kms_start: your amd driver (mesa) version is known to be buggy (<= version 24.0.9), falling back to opengl copy\n"); diff --git a/src/capture/xcomposite.c b/src/capture/xcomposite.c index 66c700d..d10807e 100644 --- a/src/capture/xcomposite.c +++ b/src/capture/xcomposite.c @@ -124,7 +124,7 @@ static int gsr_capture_xcomposite_start(gsr_capture *cap, AVCodecContext *video_ video_codec_context->height = FFALIGN(self->params.output_resolution.y, 2); } - self->fast_path_failed = self->params.egl->gpu_info.vendor == GSR_GPU_VENDOR_AMD && !gl_driver_version_greater_than(self->params.egl, 24, 0, 9); + self->fast_path_failed = self->params.egl->gpu_info.vendor == GSR_GPU_VENDOR_AMD && !gl_driver_version_greater_than(&self->params.egl->gpu_info, 24, 0, 9); if(self->fast_path_failed) fprintf(stderr, "gsr warning: gsr_capture_kms_start: your amd driver (mesa) version is known to be buggy (<= version 24.0.9), falling back to opengl copy\n"); diff --git a/src/main.cpp b/src/main.cpp index 994ddef..6b07a76 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1894,7 +1894,7 @@ static bool is_xwayland(Display *display) { 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; + return (prime_render_offload && strcmp(prime_render_offload, "1") == 0) || getenv("DRI_PRIME"); } static void disable_prime_run() { @@ -1902,6 +1902,7 @@ static void disable_prime_run() { unsetenv("__NV_PRIME_RENDER_OFFLOAD_PROVIDER"); unsetenv("__GLX_VENDOR_LIBRARY_NAME"); unsetenv("__VK_LAYER_NV_optimus"); + unsetenv("DRI_PRIME"); } static gsr_window* gsr_window_create(Display *display, bool wayland) { diff --git a/src/utils.c b/src/utils.c index 9295541..1feff9d 100644 --- a/src/utils.c +++ b/src/utils.c @@ -417,8 +417,8 @@ static bool version_greater_than(int major, int minor, int patch, int other_majo return (major > other_major) || (major == other_major && minor > other_minor) || (major == other_major && minor == other_minor && patch > other_patch); } -bool gl_driver_version_greater_than(const gsr_egl *egl, int major, int minor, int patch) { - return version_greater_than(egl->gpu_info.driver_major, egl->gpu_info.driver_minor, egl->gpu_info.driver_patch, major, minor, patch); +bool gl_driver_version_greater_than(const gsr_gpu_info *gpu_info, int major, int minor, int patch) { + return version_greater_than(gpu_info->driver_major, gpu_info->driver_minor, gpu_info->driver_patch, major, minor, patch); } bool try_card_has_valid_plane(const char *card_path) { |