diff options
author | Emil Velikov <[email protected]> | 2017-11-09 17:55:19 +0000 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2017-11-16 14:03:03 +0000 |
commit | 55245fe1c9925045198f2f0954eff8f2e5d42d7b (patch) | |
tree | 694aab9c28cd5aede16163675c8f8ef2a64ce792 /src/egl/drivers/dri2/egl_dri2.h | |
parent | 8ceccbf80dea7ac34cda68ec3117d80dd8922159 (diff) |
egl: Provide meaningfull error when built w/o requested platform
The current "No EGL platform enabled." is misleading and wrong.
We reach said code when $platform is missing.
To make this more obvious and clear provide wrappers in the header
file, making the code a bit easier to follow.
Signed-off-by: Emil Velikov <[email protected]>
Reviewed-by: Eric Engestrom <[email protected]>
Diffstat (limited to 'src/egl/drivers/dri2/egl_dri2.h')
-rw-r--r-- | src/egl/drivers/dri2/egl_dri2.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.h b/src/egl/drivers/dri2/egl_dri2.h index 0ec8f44dce2..9cccf05253a 100644 --- a/src/egl/drivers/dri2/egl_dri2.h +++ b/src/egl/drivers/dri2/egl_dri2.h @@ -400,20 +400,60 @@ _EGLImage * dri2_create_image_dma_buf(_EGLDisplay *disp, _EGLContext *ctx, EGLClientBuffer buffer, const EGLint *attr_list); +#ifdef HAVE_X11_PLATFORM EGLBoolean dri2_initialize_x11(_EGLDriver *drv, _EGLDisplay *disp); +#else +static inline EGLBoolean +dri2_initialize_x11(_EGLDriver *drv, _EGLDisplay *disp) +{ + return _eglError(EGL_NOT_INITIALIZED, "X11 platform not built"); +} +#endif +#ifdef HAVE_DRM_PLATFORM EGLBoolean dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp); +#else +static inline EGLBoolean +dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp) +{ + return _eglError(EGL_NOT_INITIALIZED, "GBM/DRM platform not built"); +} +#endif +#ifdef HAVE_WAYLAND_PLATFORM EGLBoolean dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp); +#else +static inline EGLBoolean +dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp) +{ + return _eglError(EGL_NOT_INITIALIZED, "Wayland platform not built"); +} +#endif +#ifdef HAVE_ANDROID_PLATFORM EGLBoolean dri2_initialize_android(_EGLDriver *drv, _EGLDisplay *disp); +#else +static inline EGLBoolean +dri2_initialize_android(_EGLDriver *drv, _EGLDisplay *disp) +{ + return _eglError(EGL_NOT_INITIALIZED, "Android platform not built"); +} +#endif +#ifdef HAVE_SURFACELESS_PLATFORM EGLBoolean dri2_initialize_surfaceless(_EGLDriver *drv, _EGLDisplay *disp); +#else +static inline EGLBoolean +dri2_initialize_surfaceless(_EGLDriver *drv, _EGLDisplay *disp) +{ + return _eglError(EGL_NOT_INITIALIZED, "Surfaceless platform not built"); +} +#endif void dri2_flush_drawable_for_swapbuffers(_EGLDisplay *disp, _EGLSurface *draw); |