Commit Graph

306 Commits

Author SHA1 Message Date
Chia-I Wu 25328509c9 egl: Move fallback routines to eglfallbacks.c.
We do not want them to be all over the places.
2010-10-22 18:38:30 +08:00
Chia-I Wu 5664a98386 egl: Parse image attributes with _eglParseImageAttribList.
Avoid code duplications.
2010-10-22 18:35:09 +08:00
Chia-I Wu 713c8734f4 egl: Move attributes in _EGLImage to _EGLImageAttribs.
The opaque nature of EGLImage implies that extensions almost always
define their own attributes.  Move attributes in _EGLImage to
_EGLImageAttribs and add a helper function to parse attribute lists.
2010-10-22 17:15:45 +08:00
Chia-I Wu 0ed96efc1b egl_glx: Drop the use of [SG]ET_CONFIG_ATTRIB.
_EGLConfig can be directly dereferenced now.  Since egl_glx is the last
user of the macros, drop the macros too.
2010-10-22 16:26:25 +08:00
Chia-I Wu 3fa21881b1 egl: Access config attributes directly.
Replace SET_CONFIG_ATTRIB/GET_CONFIG_ATTRIB by direct dereferences.
2010-10-14 17:16:14 +08:00
Chia-I Wu 282e514240 egl: Use attribute names as the _EGLConfig member names.
This makes _EGLConfig more accessible and scales better when new
attributes are added.
2010-10-14 17:14:44 +08:00
Nicolas Kaiser 3b7b1db661 egl: remove duplicated include
Remove duplicated include.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:21 -06:00
Chia-I Wu 6b2f1561ad egl: Check extensions.
Do not call into the driver if the extension for the called function is
not enabled.
2010-09-30 16:55:07 +08:00
Chia-I Wu e7424d7240 st/egl: Rename kms backend to drm.
The main use of the backend is to support EGL_MESA_drm_display.  drm
should be a better name.
2010-09-19 17:19:03 +08:00
Chia-I Wu ea9e5dbbc2 egl: Simplify _eglBindContext.
Remove the hard-to-get-right _eglBindContextToSurfaces.  As well as fix
an assertion failure from b90a3e7d8b when
such call sequence is hit

  eglMakeCurrent(dpy, surf1, surf1, ctx1);
  eglMakeCurrent(dpy, surf2, surf2, ctx2);
  eglMakeCurrent(dpy, surf1, surf1, ctx1);
2010-09-10 18:41:14 +08:00
Kristian Høgsberg 6eda3f311b eglglx: Convert glx visuals/fbconfigs straight to EGL configs
In other words, skip the __GLcontextModes middle man.
2010-09-09 15:00:18 -04:00
Chia-I Wu 916c8ed2c8 egl: Use _EGL_CHECK_DISPLAY in eglCreateContext.
_EGL_CHECK_DISPLAY checks the display and returns from eglCreateContext
on error.
2010-09-10 00:18:23 +08:00
Chia-I Wu 08a482e7a9 egl: Display may be NULL in _eglLookup*.
This fixes several NULL dereferences.
2010-09-10 00:18:14 +08:00
Kristian Høgsberg b7a8893a24 egl: Add EGL_MESA_drm_image extension
Create EGLImages from DRM buffer handles.
2010-08-25 09:17:47 -04:00
Chia-I Wu 5eb33596a0 egl: Fix context API check and be verbose.
The API of the context was not checked against EGL_RENDERABLE_TYPE when there
was no attribute list.  Move the check to _eglInitContext, and be verbose about
common mistakes (EGL_RENDERABLE_TYPE not set, EGL_CONTEXT_CLIENT_VERSION not
set, or eglBindAPI not called).
2010-08-20 19:22:51 +08:00
Chia-I Wu ce2cae4130 egl: Add egl.def for win32 build.
Without the .def file, function names are decorated and cannot be
queried by GetProcAddress easily.
2010-08-20 19:22:50 +08:00
Chia-I Wu f508c0c097 egl: Allow core functions to be queried.
When _EGL_GET_CORE_ADDRESSES is defined, eglGetProcAddress can be used to query
core functions.  This is non-standard, but some apps expect it.
2010-08-20 19:22:35 +08:00
Chia-I Wu ce29e86458 st/egl: Fix win32 build.
Add new source files to SConscripts.
2010-08-19 14:07:29 +08:00
Chia-I Wu 2b2c5c4f5c egl: Add support for EGL_KHR_fence_sync.
Individual drivers still need to support and enable the extension.
2010-08-17 00:06:19 +08:00
Chia-I Wu 4eebea74a8 egl: Add support for EGL_KHR_reusable_sync.
Individual drivers still need to support and enable the extension.
2010-08-17 00:06:19 +08:00
Vinson Lee db71bdc31c egl: Fix '_eglAddAtExitCall' implicit declaration warning. 2010-07-31 13:28:32 -07:00
Chia-I Wu 6c7e0b95a4 egl: Add checks for EGL_MESA_screen_surface.
This allows Mesa EGL to be compiled with eglext.h that does not define
EGL_MESA_screen_surface.
2010-07-31 17:49:32 +08:00
Kristian Høgsberg 2c343af098 egl: Fix deref before NULL-check 2010-07-28 23:54:16 -04:00
Kristian Høgsberg b90a3e7d8b egl: EGL_KHR_surfaceless_* extensions
These extensions allow an application to make a context current by
passing EGL_NO_SURFACE for the write and read surface in the call to
eglMakeCurrent.  The motivation is that applications that only want to
render to client API targets (such as OpenGL framebuffer objects)
should not need to create a throw-away EGL surface just to get a
current context.
2010-07-28 23:07:00 -04:00
Chia-I Wu d7284b45e2 egl: Return the correct array size in _eglFlattenArray.
The function is used by _eglGetConfigs and _eglGetScreens.  The array
size should not be limited by the buffer size when the buffer is NULL.

This fixes fdo bug #29052.
2010-07-15 10:05:46 +08:00
Vinson Lee ff318c45ec egl: Remove unnecessary headers. 2010-07-06 16:02:49 -07:00
Chia-I Wu f2aa361f3b egl: Rework driver loading.
Driver loading is now splitted into two stages.  In the first stage, an
_EGLModule is created for each driver: user driver, default drivers, and
all files in the search directories that start with "egl_".  Modules are
not loaded at this stage.

In the second stage, each module is loaded to initialize a display.  The
process stops at the first module that can initialize the display.

If eglGetProcAddress is called before eglInitialize, the same code path
will be taken to find the first module that supports
EGL_DEFAULT_DISPLAY.  Because we do not want to initialize the display,
drv->Probe is used instead in this case.
2010-07-06 16:16:39 +08:00
nobled c43ab4fe1f egl: Always use EGLAPIENTRY in api function prototypes
Fixes the build on Windows.
2010-07-03 16:36:43 +08:00
Chia-I Wu a8815b754d egl: Update MaxSize when a dynamic array is grown. 2010-06-30 18:52:00 +08:00
Chia-I Wu 98ebc8165c egl: Make _eglUnloadDrivers no-op on Windows.
Windows unloads DLLs before atexit.  Make _eglUnloadDrivers no-op on
Windows for now.
2010-06-30 18:32:48 +08:00
Chia-I Wu 8b0c6c4a8d egl: Store screens in a dynamic array. 2010-06-30 18:32:48 +08:00
Chia-I Wu 6717a313f2 egl: Store configs in a dynamic array. 2010-06-30 18:32:48 +08:00
Chia-I Wu 106466783f egl: Add dynamic array.
Dynamic arrays will be used to store configs and screens of a display.
2010-06-30 18:32:48 +08:00
Chia-I Wu 4cb853402b egl: Remove st/egl probe code.
It is no longer needed.
2010-06-29 17:16:20 +08:00
Chia-I Wu afcea9b115 egl: Do not call drv->Initialize with global mutex locked. 2010-06-29 17:16:20 +08:00
Chia-I Wu a81ef14228 st/egl: Build a single EGL driver.
This change makes st/egl build a single egl_gallium.so and multiple
st_<API>.so and pipe_<HW>.so.  When a display is initialized, the
corresponding pipe driver will be loaded.  When a context is created,
the corresponding state tracker will be loaded.

Unlike DRI drivers, no ABI compatibility is maintained.  egl_gallium,
pipe drivers and state trackers should always be distributed as a single
package.  As such, there is only a single src/gallium/targets/egl/ that
builds everything for the package.
2010-06-29 17:16:20 +08:00
Chia-I Wu ea05299ce5 st/egl: One driver per hardware.
Merge multiple egl_<platform>_<pipe>.so into a single
egl_gallium_<pipe>.so.  The environment variable EGL_PLATFORM is now
used to modify the return value of _eglGetNativePlatform.
2010-06-29 17:16:19 +08:00
Chia-I Wu 78d70ddbbd egl: Add support for EGL_MESA_drm_display.
The extension defines eglGetDRMDisplay that creates an EGLDisplay from a
DRM fd.  Calling eglCreateWindowSurace or eglCreatePixmapSurface with
such displays will generate EGL_BAD_NATIVE_WINDOW or
EGL_BAD_NATIVE_PIXMAP.
2010-06-23 15:14:59 +08:00
Chia-I Wu f22665df95 egl: Introduce platform displays internally.
This commit introduces type-safe platform displays internally.  A
platform display consists of a generic pointer and an enum that
specifies the platform.

An EGLDisplay is created from a platform display.  Native displays
become platform displays whose platform is determined by
_eglGetNativePlatform().  Platform windows and pixmaps may also be
introduced if needed.
2010-06-23 15:14:59 +08:00
Chia-I Wu da39d5d3b4 egl: s/EGL_DISPLAY/EGL_PLATFORM/.
A platform is already used to mean a window system in EGL.  No need to
use a different term.
2010-06-17 16:30:26 +08:00
Chia-I Wu 6f690caddc egl: s/_EGL_PLATFORM/_EGL_OS/ and s/POSIX/UNIX/.
A platform means a native window system in EGL.  Use OS that follows
Gallium instead.
2010-06-17 16:05:18 +08:00
Chia-I Wu 1e6c10f4be egl: Use SConscript for Windows build.
Fix several portability issues and add SConscript for Windows build.
2010-05-31 13:27:41 +08:00
Chia-I Wu ba26631d0d Define PUBLIC to dllexport on MSVC.
Define PUBLIC to __declspec(dllexport) when _MVC_VER is defined.
2010-05-31 11:31:07 +08:00
Chia-I Wu d2cb999045 Always define int32_t in compiler headers.
eglplatform.h no longer defines int32_t.
2010-05-31 11:00:01 +08:00
Kristian Høgsberg 6e9da8ab60 egl: Return NULL if we fail to load a default driver 2010-05-27 09:59:27 -04:00
Kristian Høgsberg 5dc0f49084 egl: Implement EGL_NOK_texture_from_pixmap
This extension allows a color buffer to be used for both rendering and
texturing.  EGL allows the use of color buffers of pbuffer drawables
for texturing, this extension extends this to allow the use of color
buffers of pixmaps too.
2010-05-14 14:47:54 -04:00
Kristian Høgsberg 554e4fc26a egl: Only allow valid config attributes in _eglParseConfigAttribList()
Passing 0x3030, 0 in the chooser list didn't get caught.
2010-05-14 14:47:54 -04:00
Vinson Lee 12297f1f98 egl: Silence uninitialized variable warnings. 2010-05-14 08:59:42 -07:00
Kristian Høgsberg 52c554a79d egl: Implement EGL_NOK_swap_region
This extension adds a new function which provides an alternative to
eglSwapBuffers. eglSwapBuffersRegionNOK accepts two new parameters in
addition to those in eglSwapBuffers. The new parameters consist of a
pointer to a list of 4-integer blocks defining rectangles (x, y,
width, height) and an integer specifying the number of rectangles in
the list.
2010-05-13 20:30:45 -04:00
Kristian Høgsberg 681fd73f1e egl: Allow a prioritized list of default drivers
When there is no user driver or any matching display drivers we fall
back to the default driver.  This patch lets us have a list of default
drivers instead of just one.  The drivers are loaded in turn and we
attempt to initialize the display.  If it fails we unload the driver
and move on to the next one.

Compared to the display driver mechanism, this avoids loading a number
of drivers and then only using one.  Also, we call Initialize to see
if the driver will work instead of relying on Probe.  To know for sure
that a driver will work, Probe really have to do a full Initialize, so
we will just use Initialize directly.
2010-05-13 16:14:07 -04:00