[gnome-session/wip/hadess/nvidia-renderer-name] g-s-check-acceleration: Detect when NVidia renderer name is requested
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-session/wip/hadess/nvidia-renderer-name] g-s-check-acceleration: Detect when NVidia renderer name is requested
- Date: Tue, 5 Nov 2019 13:40:18 +0000 (UTC)
commit ab9c8e3025c3b431898a321c6dd1d324141cf36c
Author: Bastien Nocera <hadess hadess net>
Date: Tue Nov 5 14:37:59 2019 +0100
g-s-check-acceleration: Detect when NVidia renderer name is requested
Those 2 new envvars could be set by gnome-control-center to print the
renderer for non-Mesa cards, in particular NVidia cards running the
nvidia proprietary driver.
tools/gnome-session-check-accelerated.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/tools/gnome-session-check-accelerated.c b/tools/gnome-session-check-accelerated.c
index 31f0a525..4d00e2e3 100644
--- a/tools/gnome-session-check-accelerated.c
+++ b/tools/gnome-session-check-accelerated.c
@@ -115,12 +115,14 @@ get_gtk_gles_renderer (void)
static gboolean
is_discrete_gpu_check (void)
{
- const char *dri_prime;
+ const char *dri_prime, *nv_prime, *glx_vendor_name;
dri_prime = g_getenv ("DRI_PRIME");
- if (!dri_prime)
- return FALSE;
- if (*dri_prime != '1')
+ nv_prime = g_getenv ("__NV_PRIME_RENDER_OFFLOAD");
+ glx_vendor_name = g_getenv ("__GLX_VENDOR_LIBRARY_NAME");
+ if (!dri_prime &&
+ !nv_prime &&
+ !glx_vendor_name)
return FALSE;
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]