[Mesa-dev] [PATCH] EGL/mesa: Initial write up fot MESA_query_driver

Emil Velikov emil.l.velikov at gmail.com
Fri Jan 11 13:47:13 UTC 2019


Hi Veluri,

On 2018/12/23, Veluri Mithun wrote:
> - Try to retrieve driver name from dri2_egl_display
> 
I would add a note that GLVND based Mesa and GLVND itself aren't updated.
Might be a good idea to add an inline comment or two.

> Signed-off-by: Veluri Mithun <velurimithun38 at gmail.com>
> ---
>  docs/specs/EGL_MESA_query_driver.txt | 54 ++++++++++++++++++++++++++++
>  src/egl/main/eglapi.c                | 13 +++++++
>  src/egl/main/egldriver.c             |  8 +++++
>  src/egl/main/egldriver.h             |  3 ++
>  src/egl/main/eglentrypoint.h         |  1 +
>  5 files changed, 79 insertions(+)
>  create mode 100644 docs/specs/EGL_MESA_query_driver.txt
> 
> diff --git a/docs/specs/EGL_MESA_query_driver.txt
> b/docs/specs/EGL_MESA_query_driver.txt
> new file mode 100644
> index 0000000000..bec7d4a15d
> --- /dev/null
> +++ b/docs/specs/EGL_MESA_query_driver.txt
> @@ -0,0 +1,54 @@
> +Name
> +
> +    MESA_query_driver
> +
> +Name Strings
> +
> +    EGL_MESA_query_driver
> +
> +Contact
> +
> +    Rob Clark      <robdclark 'at' gmail.com>
> +    Nicolai Hähnle <Nicolai.Haehnle 'at' amd.com>
> +
Either my client seems to have gone crazy here or Nicolai's name is off?

> +Contibutors
> +
> +    Veluri Mithun <velurimithun38 'at' gmail.com>
> +
> +Status
> +
> +    XXX - Not complete yet!!! (draft)
> +
> +Version
> +
> +    Version 1, 2018-11-05
> +
> +Number
> +
> +    EGL Extension ###
> +
> +Dependencies
> +
> +    EGL 1.4 is required.
> +
> +Overview
> +
> +    When an application has to query the name of a DRI driver and for
> +    obtaining driver's option list (UTF-8 encoded XML) of a DRI
> +    driver the below functions are useful.
> +
> +New Procedures and Functions
> +
> +    const char* eglGetDriverConfig(EGLDisplay *disp, EGLDeviceEXT device,
> +                                   const char *driverName);
We don't need the device here. What would happen if we give an invalid
combination of display/drivername?

> +    const char* eglGetDisplayDriverName(EGLDisplay *disp);
> +
Analogous to the above, we want some clarification what would happen when the
functions fail. Do we expect some error code to be set?

Without such information applications don't known what to do as a follow-up.

[snip]

> +#include "egl_dri2.h"
> 
>  static mtx_t _eglModuleMutex = _MTX_INITIALIZER_NP;
>  static _EGLDriver *_eglDriver;
> @@ -125,3 +126,10 @@ _eglUnloadDrivers(void)
>     free(_eglDriver);
>     _eglDriver = NULL;
>  }
> +
> +const char *
> +_eglGetDriverName(_EGLDisplay *disp)
> +{
> +    struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
> +    return dri2_dpy->driver_name;
> +}

One cannot use backend specific functions (dri2,haiku) here. I'd would suggest
adding new internal API to the struct _egl_api and use them.


WRT the Config API - it should will be almost identical to the GLX one in
src/glx/dri_glx.c.

The major differences will be:
 - basic check that the display + driver name combo is valid
 - the display/driver is already known and opened, so we can drop the 
driver_config_cache, driOpenDriver() and dlsym("__driConfigOptions") fallback.


HTH
Emil


More information about the mesa-dev mailing list