mesa/src/egl/main
Eric Engestrom 4e65469c70 egl: drop unused _EGLDriver from WaitClient()
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6241>
2020-08-16 13:49:18 +00:00
..
50_mesa.json Revert "egl: put full path to libEGL_mesa.so in GLVND json" 2020-02-06 00:19:13 +00:00
egl.def
eglapi.c egl: drop unused _EGLDriver from WaitClient() 2020-08-16 13:49:18 +00:00
eglarray.c egl: _eglFilterArray's filter is always non-null 2017-02-16 15:27:20 +00:00
eglarray.h
eglconfig.c egl: const _eglDriver 2020-08-01 17:12:20 +00:00
eglconfig.h egl: const _eglDriver 2020-08-01 17:12:20 +00:00
eglcontext.c egl: const _eglDriver 2020-08-01 17:12:20 +00:00
eglcontext.h egl: const _eglDriver 2020-08-01 17:12:20 +00:00
eglcurrent.c mesa: Rename GLX_USE_TLS to USE_ELF_TLS. 2019-08-03 20:18:17 +02:00
eglcurrent.h egl: simplify _eglDebugReport* API 2017-09-19 19:07:16 +01:00
egldefines.h egl: remove unused include 2019-01-11 14:37:47 +00:00
egldevice.c egl: move fallthrough comment so gcc can see it 2020-07-02 12:11:30 +10:00
egldevice.h egl: add EGL_platform_device support 2019-06-05 13:35:21 -04:00
egldispatchstubs.c egl/glvnd: correctly report errors when vendor cannot be found 2018-11-05 20:53:05 +00:00
egldispatchstubs.h EGL: Implement the libglvnd interface for EGL (v3) 2017-04-17 13:03:58 +01:00
egldisplay.c egl: drop unused _EGLDriver from Create{Window,Pixmap,Pbuffer}Surface() & DestroySurface() 2020-08-16 13:49:17 +00:00
egldisplay.h egl: replace _EGLDriver param with _EGLDisplay->Driver in _eglReleaseDisplayResources() 2020-08-16 13:49:17 +00:00
egldriver.c egl: drop unused _EGLDriver from Initialize() 2020-08-16 13:49:17 +00:00
egldriver.h egl: drop unused _EGLDriver from WaitClient() 2020-08-16 13:49:18 +00:00
eglentrypoint.h Revert "egl: implement new functions from EGL_EXT_image_flush_external" 2019-11-14 07:46:04 +02:00
eglglobals.c egl: replace _eglInitDriver() with a simple variable 2020-07-30 23:24:30 +00:00
eglglobals.h egl: simplify client/platform extension handling 2020-04-21 22:20:24 +00:00
eglglvnd.c egl: simplify client/platform extension handling 2020-04-21 22:20:24 +00:00
eglimage.c Revert "egl: handle EGL_IMAGE_EXTERNAL_FLUSH_EXT" 2019-11-14 07:46:14 +02:00
eglimage.h Revert "egl: handle EGL_IMAGE_EXTERNAL_FLUSH_EXT" 2019-11-14 07:46:14 +02:00
egllog.c win32: unify strcasecmp definitions 2019-08-15 20:23:44 +02:00
egllog.h egl: remove no longer needed logger infra 2017-05-08 15:33:54 +01:00
eglsurface.c egl: drop unused _EGLDriver from SwapInterval() 2020-08-16 13:49:18 +00:00
eglsurface.h egl: drop unused _EGLDriver from SwapInterval() 2020-08-16 13:49:18 +00:00
eglsync.c egl: const _eglDriver 2020-08-01 17:12:20 +00:00
eglsync.h egl: const _eglDriver 2020-08-01 17:12:20 +00:00
egltypedefs.h egl: inline _EGLAPI into _EGLDriver 2020-07-21 00:59:43 +00:00
README.txt egl: inline _EGLAPI into _EGLDriver 2020-07-21 00:59:43 +00:00


Notes about the EGL library:


The EGL code here basically consists of two things:

1. An EGL API dispatcher.  This directly routes all the eglFooBar() API
   calls into driver-specific functions.

2. Fallbacks for EGL API functions.  A driver _could_ implement all the
   EGL API calls from scratch.  But in many cases, the fallbacks provided
   in libEGL (such as eglChooseConfig()) will do the job.



Bootstrapping:

When the apps calls eglInitialize() a device driver is selected and loaded
(look for _eglAddDrivers() and _eglLoadModule() in egldriver.c).

The built-in driver's entry point function is then called and given
a freshly allocated and initialised _EGLDriver, with default fallback
entrypoints set.

As part of initialization, the dispatch table in _EGLDriver->API must be
populated with all the EGL entrypoints. Some functions like
driver->Initialize and driver->Terminate _must_ be implemented
with driver-specific code (no default/fallback function is possible).


Shortly after, the driver->Initialize() function is executed.  Any additional
driver initialization that wasn't done in the driver entry point should be
done at this point.  Typically, this will involve setting up visual configs, etc.



Special Functions:

Certain EGL functions _must_ be implemented by the driver.  This includes:

eglCreateContext
eglCreateWindowSurface
eglCreatePixmapSurface
eglCreatePBufferSurface
eglMakeCurrent
eglSwapBuffers

Most of the EGLConfig-related functions can be implemented with the
defaults/fallbacks.  Same thing for the eglGet/Query functions.




Teardown:

When eglTerminate() is called, the driver->Terminate() function is
called.  The driver should clean up after itself.  eglTerminate() will
then close/unload the driver (shared library).




Subclassing:

The internal libEGL data structures such as _EGLDisplay, _EGLContext,
_EGLSurface, etc should be considered base classes from which drivers
will derive subclasses.