[Mesa-dev] [PATCH mesa] egl: set UseFallback if LIBGL_ALWAYS_SOFTWARE is set

Gurchetan Singh gurchetansingh at chromium.org
Wed Oct 18 22:41:55 UTC 2017


Reviewed-by: Gurchetan Singh <gurchetansingh at chromium.org>

On Wed, Oct 18, 2017 at 9:09 AM, Eric Engestrom <eric.engestrom at imgtec.com>
wrote:

> Suggested-by: Emil Velikov <emil.l.velikov at gmail.com>
> Signed-off-by: Eric Engestrom <eric.engestrom at imgtec.com>
> ---
>  src/egl/drivers/dri2/platform_surfaceless.c | 3 +--
>  src/egl/drivers/dri2/platform_wayland.c     | 3 +--
>  src/egl/drivers/dri2/platform_x11.c         | 2 +-
>  src/egl/main/egldriver.c                    | 5 ++++-
>  4 files changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/src/egl/drivers/dri2/platform_surfaceless.c
> b/src/egl/drivers/dri2/platform_surfaceless.c
> index 2af4a40b1a6b87edb9d2..977b046016665aa99148 100644
> --- a/src/egl/drivers/dri2/platform_surfaceless.c
> +++ b/src/egl/drivers/dri2/platform_surfaceless.c
> @@ -36,7 +36,6 @@
>  #include "egl_dri2.h"
>  #include "egl_dri2_fallbacks.h"
>  #include "loader.h"
> -#include "util/debug.h"
>
>  static __DRIimage*
>  surfaceless_alloc_image(struct dri2_egl_display *dri2_dpy,
> @@ -325,7 +324,7 @@ dri2_initialize_surfaceless(_EGLDriver *drv,
> _EGLDisplay *disp)
>     dri2_dpy->fd = -1;
>     disp->DriverData = (void *) dri2_dpy;
>
> -   if (!env_var_as_boolean("LIBGL_ALWAYS_SOFTWARE", false)) {
> +   if (!disp->Options.UseFallback) {
>        driver_loaded = surfaceless_probe_device(disp, false);
>        if (!driver_loaded)
>           _eglLog(_EGL_WARNING,
> diff --git a/src/egl/drivers/dri2/platform_wayland.c
> b/src/egl/drivers/dri2/platform_wayland.c
> index 14db55ca747b07fa23f5..b38eb1c3354cfb0c5015 100644
> --- a/src/egl/drivers/dri2/platform_wayland.c
> +++ b/src/egl/drivers/dri2/platform_wayland.c
> @@ -42,7 +42,6 @@
>  #include "egl_dri2.h"
>  #include "egl_dri2_fallbacks.h"
>  #include "loader.h"
> -#include "util/debug.h"
>  #include "util/u_vector.h"
>  #include "eglglobals.h"
>
> @@ -1972,7 +1971,7 @@ dri2_initialize_wayland(_EGLDriver *drv,
> _EGLDisplay *disp)
>  {
>     EGLBoolean initialized = EGL_FALSE;
>
> -   if (!env_var_as_boolean("LIBGL_ALWAYS_SOFTWARE", false))
> +   if (!disp->Options.UseFallback)
>        initialized = dri2_initialize_wayland_drm(drv, disp);
>
>     if (!initialized)
> diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/
> platform_x11.c
> index 9c20ea8f8a98c4c2b6bd..5bcdb2dac748cc0e9901 100644
> --- a/src/egl/drivers/dri2/platform_x11.c
> +++ b/src/egl/drivers/dri2/platform_x11.c
> @@ -1460,7 +1460,7 @@ dri2_initialize_x11(_EGLDriver *drv, _EGLDisplay
> *disp)
>  {
>     EGLBoolean initialized = EGL_FALSE;
>
> -   if (!env_var_as_boolean("LIBGL_ALWAYS_SOFTWARE", false)) {
> +   if (!disp->Options.UseFallback) {
>  #ifdef HAVE_DRI3
>        if (!env_var_as_boolean("LIBGL_DRI3_DISABLE", false))
>           initialized = dri2_initialize_x11_dri3(drv, disp);
> diff --git a/src/egl/main/egldriver.c b/src/egl/main/egldriver.c
> index 33f8f57aeb11e06f92f2..1ff37850e05f729dd35a 100644
> --- a/src/egl/main/egldriver.c
> +++ b/src/egl/main/egldriver.c
> @@ -44,6 +44,8 @@
>  #include "egldriver.h"
>  #include "egllog.h"
>
> +#include "util/debug.h"
> +
>  static mtx_t _eglModuleMutex = _MTX_INITIALIZER_NP;
>  static _EGLDriver *_eglDriver;
>
> @@ -86,7 +88,8 @@ _eglMatchDriver(_EGLDisplay *dpy)
>     assert(!dpy->Initialized);
>
>     /* set options */
> -   dpy->Options.UseFallback = EGL_FALSE;
> +   dpy->Options.UseFallback =
> +      env_var_as_boolean("LIBGL_ALWAYS_SOFTWARE", false);
>
>     best_drv = _eglMatchAndInitialize(dpy);
>     if (!best_drv) {
> --
> Cheers,
>   Eric
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20171018/27cfab80/attachment.html>


More information about the mesa-dev mailing list