[Mesa-dev] [PATCH mesa 1/2] egl: drop always-false TestOnly option

Eric Engestrom eric.engestrom at imgtec.com
Wed Oct 18 15:42:33 UTC 2017


Signed-off-by: Eric Engestrom <eric.engestrom at imgtec.com>
---
 src/egl/drivers/dri2/egl_dri2.c |  4 ----
 src/egl/main/eglapi.c           |  2 +-
 src/egl/main/egldisplay.h       |  1 -
 src/egl/main/egldriver.c        | 18 +++++++-----------
 src/egl/main/egldriver.h        |  2 +-
 5 files changed, 9 insertions(+), 18 deletions(-)

diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index b1df0cb1a9173f659690..0750dc1946988ed064de 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -901,10 +901,6 @@ dri2_initialize(_EGLDriver *drv, _EGLDisplay *disp)
    if (disp->Options.UseFallback)
       return EGL_FALSE;
 
-   /* Nothing to initialize for a test only display */
-   if (disp->Options.TestOnly)
-      return EGL_TRUE;
-
    switch (disp->Platform) {
 #ifdef HAVE_SURFACELESS_PLATFORM
    case _EGL_PLATFORM_SURFACELESS:
diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c
index 4a9b3fe3925f0f04af22..38fc9311cb8da3ed5f6f 100644
--- a/src/egl/main/eglapi.c
+++ b/src/egl/main/eglapi.c
@@ -583,7 +583,7 @@ eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor)
       RETURN_EGL_ERROR(NULL, EGL_BAD_DISPLAY, EGL_FALSE);
 
    if (!disp->Initialized) {
-      if (!_eglMatchDriver(disp, EGL_FALSE))
+      if (!_eglMatchDriver(disp))
          RETURN_EGL_ERROR(disp, EGL_NOT_INITIALIZED, EGL_FALSE);
 
       /* limit to APIs supported by core */
diff --git a/src/egl/main/egldisplay.h b/src/egl/main/egldisplay.h
index 9a0b9b672ac3d5eba8a3..da5339b7bf9ebf9f57bf 100644
--- a/src/egl/main/egldisplay.h
+++ b/src/egl/main/egldisplay.h
@@ -152,7 +152,6 @@ struct _egl_display
 
    /* options that affect how the driver initializes the display */
    struct {
-      EGLBoolean TestOnly;    /**< Driver should not set fields when true */
       EGLBoolean UseFallback; /**< Use fallback driver (sw or less features) */
       void *Platform;         /**< Platform-specific options */
    } Options;
diff --git a/src/egl/main/egldriver.c b/src/egl/main/egldriver.c
index 92ea6450944ac73472bb..003f74ed63d577fd2d0b 100644
--- a/src/egl/main/egldriver.c
+++ b/src/egl/main/egldriver.c
@@ -75,19 +75,17 @@ _eglMatchAndInitialize(_EGLDisplay *dpy)
 }
 
 /**
- * Match a display to a driver.  The display is initialized unless test_only is
- * true.  The matching is done by finding the first driver that can initialize
- * the display.
+ * Match a display to a driver.  The matching is done by finding the first
+ * driver that can initialize the display.
  */
 _EGLDriver *
-_eglMatchDriver(_EGLDisplay *dpy, EGLBoolean test_only)
+_eglMatchDriver(_EGLDisplay *dpy)
 {
    _EGLDriver *best_drv;
 
    assert(!dpy->Initialized);
 
    /* set options */
-   dpy->Options.TestOnly = test_only;
    dpy->Options.UseFallback = EGL_FALSE;
 
    best_drv = _eglMatchAndInitialize(dpy);
@@ -97,12 +95,10 @@ _eglMatchDriver(_EGLDisplay *dpy, EGLBoolean test_only)
    }
 
    if (best_drv) {
-      _eglLog(_EGL_DEBUG, "the best driver is %s%s",
-            best_drv->Name, (test_only) ? " (test only) " : "");
-      if (!test_only) {
-         dpy->Driver = best_drv;
-         dpy->Initialized = EGL_TRUE;
-      }
+      _eglLog(_EGL_DEBUG, "the best driver is %s",
+            best_drv->Name);
+      dpy->Driver = best_drv;
+      dpy->Initialized = EGL_TRUE;
    }
 
    return best_drv;
diff --git a/src/egl/main/egldriver.h b/src/egl/main/egldriver.h
index a3f9b9912844471c4445..ba12a060cab7f7c6c223 100644
--- a/src/egl/main/egldriver.h
+++ b/src/egl/main/egldriver.h
@@ -86,7 +86,7 @@ _eglInitDriver(_EGLDriver *driver);
 
 
 extern _EGLDriver *
-_eglMatchDriver(_EGLDisplay *dpy, EGLBoolean test_only);
+_eglMatchDriver(_EGLDisplay *dpy);
 
 
 extern __eglMustCastToProperFunctionPointerType
-- 
Cheers,
  Eric



More information about the mesa-dev mailing list