Commit ab9c8e30 authored by Bastien Nocera's avatar Bastien Nocera

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.
parent 60e619b8
...@@ -115,12 +115,14 @@ get_gtk_gles_renderer (void) ...@@ -115,12 +115,14 @@ get_gtk_gles_renderer (void)
static gboolean static gboolean
is_discrete_gpu_check (void) is_discrete_gpu_check (void)
{ {
const char *dri_prime; const char *dri_prime, *nv_prime, *glx_vendor_name;
dri_prime = g_getenv ("DRI_PRIME"); dri_prime = g_getenv ("DRI_PRIME");
if (!dri_prime) nv_prime = g_getenv ("__NV_PRIME_RENDER_OFFLOAD");
return FALSE; glx_vendor_name = g_getenv ("__GLX_VENDOR_LIBRARY_NAME");
if (*dri_prime != '1') if (!dri_prime &&
!nv_prime &&
!glx_vendor_name)
return FALSE; return FALSE;
return TRUE; return TRUE;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment