[Mesa-dev] [PATCH mesa 05/10] glx: turn LIBGL_ALWAYS_INDIRECT into a boolean

Emil Velikov emil.l.velikov at gmail.com
Mon Sep 11 17:43:58 UTC 2017


On 8 September 2017 at 13:40, Eric Engestrom <eric.engestrom at imgtec.com> wrote:
> Instead of setting based on set/unset, allow users to use boolean values.
> In the docs, use `ALWAYS=true` instead of `ALWAYS=1` as it's clearer IMO.
>
> Signed-off-by: Eric Engestrom <eric.engestrom at imgtec.com>
> ---
>  docs/envvars.html | 2 +-
>  docs/libGL.txt    | 2 +-
>  src/glx/glxext.c  | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/docs/envvars.html b/docs/envvars.html
> index b70528fa46..aeb5ff2847 100644
> --- a/docs/envvars.html
> +++ b/docs/envvars.html
> @@ -29,7 +29,7 @@
>  <li>LIBGL_DEBUG - If defined debug information will be printed to stderr.
>     If set to 'verbose' additional information will be printed.
>  <li>LIBGL_DRIVERS_PATH - colon-separated list of paths to search for DRI drivers
> -<li>LIBGL_ALWAYS_INDIRECT - forces an indirect rendering context/connection.
> +<li>LIBGL_ALWAYS_INDIRECT - if set to `true`, forces an indirect rendering context/connection.
>  <li>LIBGL_ALWAYS_SOFTWARE - if set to `true`, always use software rendering
>  <li>LIBGL_NO_DRAWARRAYS - if set do not use DrawArrays GLX protocol (for debugging)
>  <li>LIBGL_SHOW_FPS - print framerate to stdout based on the number of glXSwapBuffers
> diff --git a/docs/libGL.txt b/docs/libGL.txt
> index 839e330cf0..b69b8c07fc 100644
> --- a/docs/libGL.txt
> +++ b/docs/libGL.txt
> @@ -59,7 +59,7 @@ to learn if it is thread safe.
>  Indirect Rendering
>
>  You can force indirect rendering mode by setting the LIBGL_ALWAYS_INDIRECT
> -environment variable.  Hardware acceleration will not be used.
> +environment variable to `true`.  Hardware acceleration will not be used.
>
>
>
> diff --git a/src/glx/glxext.c b/src/glx/glxext.c
> index 3415277bbe..35e582cb22 100644
> --- a/src/glx/glxext.c
> +++ b/src/glx/glxext.c
> @@ -907,7 +907,7 @@ __glXInitialize(Display * dpy)
>     dpyPriv->glXDrawHash = __glxHashCreate();
>
>  #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
> -   glx_direct = (getenv("LIBGL_ALWAYS_INDIRECT") == NULL);
> +   glx_direct = env_var_as_boolean("LIBGL_ALWAYS_INDIRECT", false);
This should also be !env_var_as_boolean... ?

-Emil


More information about the mesa-dev mailing list