mesa/src/egl/main
Emil Velikov 2f11957532 egl: keep the software device at the end of the list
By default, the user is likely to pick the first device so it should
not be the least performant (aka software) one.

v2: Drop odd comment (Marek)

Suggested-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de> (v1)
Reviewed-by: Marek Olšák <marek.olsak@amd.com> (v1)
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2019-06-05 13:35:21 -04:00
..
50_mesa.json
README.txt
egl.def
eglapi.c egl: handle the full attrib list in display::options 2019-06-05 13:35:21 -04:00
eglapi.h egl: use coherent variable names 2019-02-06 11:53:24 +00:00
eglarray.c
eglarray.h
eglconfig.c egl: use coherent variable names 2019-02-06 11:53:24 +00:00
eglconfig.h egl: use coherent variable names 2019-02-06 11:53:24 +00:00
eglcontext.c egl: Allow EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY in ES and GL 2019-05-17 15:13:15 -07:00
eglcontext.h egl: use coherent variable names 2019-02-06 11:53:24 +00:00
eglcurrent.c egl: hard-code destroy function instead of passing it around as a pointer 2019-05-02 14:44:16 +00:00
eglcurrent.h
egldefines.h
egldevice.c egl: keep the software device at the end of the list 2019-06-05 13:35:21 -04:00
egldevice.h egl: fix libdrm-less builds 2019-03-05 13:04:06 +00:00
egldispatchstubs.c
egldispatchstubs.h
egldisplay.c egl: fold X11 attrib handling like other platforms 2019-06-05 13:35:21 -04:00
egldisplay.h egl: remove Options::Platform handling 2019-06-05 13:35:21 -04:00
egldriver.c egl: use coherent variable names 2019-02-06 11:53:24 +00:00
egldriver.h egl: use coherent variable names 2019-02-06 11:53:24 +00:00
eglentrypoint.h
eglfallbacks.c
eglglobals.c
eglglobals.h
eglglvnd.c
eglimage.c egl: use coherent variable names 2019-02-06 11:53:24 +00:00
eglimage.h egl: use coherent variable names 2019-02-06 11:53:24 +00:00
egllog.c
egllog.h
eglsurface.c egl: store the native surface pointer in struct _egl_surface 2019-05-14 12:41:14 +00:00
eglsurface.h egl: store the native surface pointer in struct _egl_surface 2019-05-14 12:41:14 +00:00
eglsync.c egl: use coherent variable names 2019-02-06 11:53:24 +00:00
eglsync.h egl: use coherent variable names 2019-02-06 11:53:24 +00:00
egltypedefs.h

README.txt


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->API.Initialize and driver->API.Terminate _must_ be implemented
with driver-specific code (no default/fallback function is possible).


Shortly after, the driver->API.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->API.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.