aboutsummaryrefslogtreecommitdiffstats
path: root/src/egl/main/egldriver.c
Commit message (Collapse)AuthorAgeFilesLines
* egl: add copyright noticesChia-I Wu2011-07-021-0/+30
| | | | | The list of copyright holders could be incomplete. Please update directly or notify me if your name is missing.
* egl: Make the transition to built-in drivers more smooth.Chia-I Wu2011-01-301-5/+24
| | | | | | When the user sets EGL_DRIVER to egl_dri2 (or egl_glx), make sure the built-in driver is used. The user might leave the outdated egl_dri2.so (or egl_glx.so) on the filesystem and we do not want to load it.
* egl: Improve driver selection.Chia-I Wu2011-01-131-0/+5
| | | | | | | | | | | | | | | | | | | | | | | The idea is to be able to match a driver using the following order try egl_gallium with hw renderer try egl_dri2 try egl_gallium with sw renderer try egl_glx given the module list egl_gallium egl_dri2 egl_glx For that, UseFallback initialization option is added. The module list is matched twice: with the option unset and with the option set. In the first pass, egl_gallium skips its sw renderer and egl_glx rejects to initialize since UseFallback is not set. In the second pass, egl_gallium skips its hw renderer and egl_dri2 rejects to initialize since UseFallback is set. The process stops at the first driver that initializes the display.
* egl: Simplify driver matching.Chia-I Wu2011-01-131-73/+48
| | | | | | Add initialization options that drv->API.Initialize should support. Replace drv->Probe by TestOnly initialization option and simplify _eglMatchDriver.
* egl: Cleanup _EGLDisplay initialization.Chia-I Wu2011-01-131-5/+3
| | | | | Reorder/rename and document the fields that should be set by the driver during initialization. Drop the major/minor arguments from drv->API.Initialize.
* egl: When EGL_DRIVER is set, do not add other drivers.Chia-I Wu2011-01-121-5/+14
| | | | | Setting EGL_DRIVER forces the driver to be loaded, as documented. There should be no fallbacks.
* scons: Updates for targets/egl-static.Chia-I Wu2011-01-121-0/+3
| | | | | | | | Update SConscripts to re-enable or add support for EGL on windows and x11 platforms respectively. targets/egl-gdi is replaced by targets/egl-static, where "-static" means pipe drivers and state trackers are linked to statically by egl_gallium, and egl_gallium is a built-in driver of libEGL. There is no more egl_gallium.dll on Windows.
* targets/egl-static: New EGL target for scons.Chia-I Wu2011-01-121-6/+14
| | | | | This target is based on and replaces egl-gdi. It is suitable for both windows and x11.
* egl: Make egl_dri2 and egl_glx built-in drivers.Chia-I Wu2011-01-101-85/+50
| | | | | These two drivers are small in size. Making them built-in should simplify packaging.
* egl: Do not unload drivers.Chia-I Wu2010-12-121-5/+11
| | | | | | When the driver is the last reference to libEGL.so, unloading it will cause libEGL.so to be unmapped and give problems. Disable the unloading for now. Still have to figure out the right timing to unload drivers.
* egl: Rework _eglGetSearchPath.Chia-I Wu2010-11-021-19/+46
| | | | | So that the directory part of EGL_DRIVER, if exists, is prepended to the search path. This commit also adds a sanity check to _eglLog.
* egl: Move fallback routines to eglfallbacks.c.Chia-I Wu2010-10-221-79/+0
| | | | We do not want them to be all over the places.
* egl: remove duplicated includeNicolas Kaiser2010-09-301-1/+0
| | | | | | Remove duplicated include. Signed-off-by: Brian Paul <[email protected]>
* egl: Add support for EGL_KHR_reusable_sync.Chia-I Wu2010-08-171-0/+9
| | | | Individual drivers still need to support and enable the extension.
* egl: Add checks for EGL_MESA_screen_surface.Chia-I Wu2010-07-311-1/+0
| | | | | This allows Mesa EGL to be compiled with eglext.h that does not define EGL_MESA_screen_surface.
* egl: Remove unnecessary headers.Vinson Lee2010-07-061-1/+0
|
* egl: Rework driver loading.Chia-I Wu2010-07-061-154/+334
| | | | | | | | | | | | | | | 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.
* egl: Make _eglUnloadDrivers no-op on Windows.Chia-I Wu2010-06-301-0/+4
| | | | | Windows unloads DLLs before atexit. Make _eglUnloadDrivers no-op on Windows for now.
* egl: Remove st/egl probe code.Chia-I Wu2010-06-291-48/+0
| | | | It is no longer needed.
* egl: Do not call drv->Initialize with global mutex locked.Chia-I Wu2010-06-291-3/+9
|
* st/egl: Build a single EGL driver.Chia-I Wu2010-06-291-82/+3
| | | | | | | | | | | | 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.
* st/egl: One driver per hardware.Chia-I Wu2010-06-291-36/+6
| | | | | | 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.
* egl: Introduce platform displays internally.Chia-I Wu2010-06-231-0/+10
| | | | | | | | | | | 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.
* egl: s/EGL_DISPLAY/EGL_PLATFORM/.Chia-I Wu2010-06-171-8/+11
| | | | | A platform is already used to mean a window system in EGL. No need to use a different term.
* egl: s/_EGL_PLATFORM/_EGL_OS/ and s/POSIX/UNIX/.Chia-I Wu2010-06-171-12/+12
| | | | | A platform means a native window system in EGL. Use OS that follows Gallium instead.
* egl: Use SConscript for Windows build.Chia-I Wu2010-05-311-4/+6
| | | | Fix several portability issues and add SConscript for Windows build.
* egl: Return NULL if we fail to load a default driverKristian Høgsberg2010-05-271-1/+1
|
* egl: Allow a prioritized list of default driversKristian Høgsberg2010-05-131-16/+32
| | | | | | | | | | | | | | 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.
* egl: Drop broken _EGL_PLATFORM_NO_OS codeKristian Høgsberg2010-05-131-32/+0
| | | | | It would do strlen(library_suffix()) in _eglLoaderFile(), with library_suffix() returning NULL. So obviuosly not used or tested.
* egl: Don't try to load driver basename if the platform needs a suffixKristian Høgsberg2010-05-131-3/+5
| | | | That is, don't dlopen(egl_glx) when we know we need to append .so.
* egl: Add _eglSearchPathForEach.Chia-I Wu2010-05-081-0/+15
| | | | The function can be used by a driver to check each search path of EGL.
* egl: Silence warnings when compiled with -pedantic.Chia-I Wu2010-02-191-1/+7
| | | | Just follow gcc's advices here.
* egl: Revisit global data locking.Chia-I Wu2010-02-171-1/+14
| | | | | Lock the global mutex in _eglPreloadDrivers and _eglAllocScreenHandle. Add comments to why certain pathes do not need locking.
* egl: fix wrong argument. Use loader_data instead of loaderIgor Oliveira2010-02-041-1/+1
|
* egl: Rename _eglPreloadForEach callbacks.Chia-I Wu2010-02-031-12/+12
| | | | | | | Rename _eglPreloadFile to _eglLoaderFile, and _eglPreloadFile to _eglLoaderFile. There are several _eglPreload* functions. The callbacks do not belong to them and it should be better to give them a different prefix.
* egl: Fix a potential segfault in driver suffix matching.Chia-I Wu2010-02-031-3/+5
| | | | | The driver suffix might be NULL on some platforms. Perform the matching only when there is a suffix.
* egl: Remove unnecessary #ifdef's.Chia-I Wu2010-02-031-8/+0
| | | | | There were some refactorings with the addition of EGL_DRIVERS_PATH. They made some platform #ifdef's unnecessary.
* egl: Ignore certain environment variables when setuid/setgid.Chia-I Wu2010-02-031-2/+16
| | | | | Specifically, ignore EGL_DRIVERS_PATH when an application is setuid/setgid. And ignore EGL_DRIVER when there is a slash in it.
* egl: Add EGL_DRIVERS_PATH environment variable.Chia-I Wu2010-02-031-99/+191
| | | | | | | | | EGL_DRIVERS_PATH gives a list of colon-separated directories. The given directories will be searched when preloading drivers. This is based on Mike Stroyan's patch, which honors the variable in _eglPreloadDisplayDrivers. It is extended to honor the variable also in _eglPreloadUserDriver and _eglPreloadDefaultDriver in this version.
* egl: Remove unnecessary headers.Vinson Lee2010-01-311-1/+0
|
* egl: Clean up header inclusions.Chia-I Wu2010-01-301-0/+1
| | | | Mainly to remove eglcurrent.h and egldisplay.h from eglglobals.h.
* egl: Remove _eglOpenDriver and _eglCloseDriver.Chia-I Wu2010-01-261-22/+1
| | | | | _eglCloseDriver is no-op and _eglOpenDriver does nothing but call _eglMatchDriver. Export _eglMatchDriver directly.
* egl: Add support for EGL_KHR_image.Chia-I Wu2010-01-251-0/+6
| | | | Individual drivers still need to implement the API hooks.
* egl: Add and use make_library_path.Chia-I Wu2010-01-241-27/+49
| | | | | | Add a platform specific function to turn a library name to a library path. It is used to convert EGL_DRIVER or the default driver to a library path that can be loaded.
* egl: Remove _eglFindAPIs.Chia-I Wu2010-01-241-52/+0
| | | | | This function is not used and should have been removed by last commit. My mistake.
* egl: Remove egl_softpipe.Chia-I Wu2010-01-221-1/+1
| | | | | | With the addition egl_x11_swrast, egl_softpipe is sort of deprecated. The new driver serves the same purpose as egl_softpipe does. It is based on egl_g3d and provides more features.
* egl: Add a simple cache for driver probe.Chia-I Wu2010-01-201-0/+48
| | | | | | In current design, multiple drivers will probe the same display and the best driver is determined. The cache can be used by the drivers to store and share the probed data.
* egl: Improve driver matching.Chia-I Wu2010-01-201-16/+19
| | | | | Make drv->Probe return a score so that the matching can be done by finding the driver with the highest score.
* egl: Rename _EGL_PLATFORM_X to _EGL_PLATFORM_POSIX.Chia-I Wu2010-01-201-8/+8
| | | | | The macro is used to determine if dlfcn.h or dirent.h is available. POSIX is a better name than X in such case.
* egl: Remove unused driver and display functions.Chia-I Wu2010-01-201-114/+0
| | | | Remove _eglPreloadDriver, _eglLookupDriver, and _eglSplitDisplayString.