summaryrefslogtreecommitdiffstats
path: root/src/egl/main/eglapi.c
Commit message (Collapse)AuthorAgeFilesLines
* egl: Add EGL_FRAMEBUFFER_TARGET_ANDROID attributeRob Herring2016-04-011-0/+1
| | | | | | | | | This is used by Android to select an eglconfig compatible with HWComposer. Cc: [email protected] Signed-off-by: Rob Herring <[email protected]> [Emil Velikov: add the _eglIsConfigAttribValid check] Signed-off-by: Emil Velikov <[email protected]>
* egl: remove remnants of MESA_drm_displayEmil Velikov2016-03-091-9/+0
| | | | | | | Last set in st/egl, unused in mesa-demos and superseded by EGL_KHR_platform_gbm. Signed-off-by: Emil Velikov <[email protected]>
* egl: remove final pieces of KHR_vg_parent_imageEmil Velikov2016-03-091-1/+0
| | | | | | Similar to previous commit - unused/unset for a long time. Signed-off-by: Emil Velikov <[email protected]>
* egl: move Null check to eglGetSyncAttribKHR to prevent SegfaultDongwon Kim2016-02-191-2/+8
| | | | | | | | | | | | | | Null-check on "*value" is currently done in _eglGetSyncAttrib, which is after eglGetSyncAttribKHR dereferences it. Move the check a layer up (in the beginning of eglGetSyncAttribKHR) to avoid segfaults. Cc: "11.0 11.1" <[email protected] Signed-off-by: Dongwon Kim <[email protected]> Reviewed-by: Marek Olšák <[email protected]> [Emil Velikov: tweak commit message, add stable tag] Reviewed-by: Emil Velikov <[email protected]>
* egl: remove ifdef $(egl_extension) compile guardsEmil Velikov2015-08-011-35/+1
| | | | | | All of these are already defined in the headers provided. Signed-off-by: Emil Velikov <[email protected]>
* egl: remove custom string functionsEmil Velikov2015-07-221-2/+1
| | | | | | | | Support for Windows has been removed for a while now, and virtually every POSIX compliant system provides strcasecmp, strdup and snprintf. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* egl: sort extension lists alphabeticallyMarek Olšák2015-07-031-27/+26
| | | | and add the missing KHR_gl_colorspace case.
* egl: expose EGL 1.5 if all requirements are metMarek Olšák2015-06-051-0/+15
| | | | | | | | There's no driver support yet, because EGL_KHR_gl_colorspace isn't implemented. Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* egl: return correct invalid-type error from eglCreateSyncMarek Olšák2015-06-051-8/+19
| | | | | Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* egl: add new platform functions (v2)Marek Olšák2015-06-051-0/+54
| | | | | | | | These are just wrappers around the existing extension functions. v2: return BAD_ALLOC if _eglConvertAttribsToInt fails Reviewed-by: Chad Versace <[email protected]>
* egl: add eglCreateImage (v2)Marek Olšák2015-06-051-0/+42
| | | | | | | v2: - use calloc - return BAD_ALLOC if calloc fails Reviewed-by: Chad Versace <[email protected]>
* egl: add eglGetSyncAttrib (v2)Marek Olšák2015-06-051-3/+22
| | | | | | | | | v2: - don't modify "value" in eglGetSyncAttribKHR after an error - rename _egl_api::GetSyncAttribKHR -> GetSyncAttrib - rename GetSyncAttribKHR_t -> GetSyncAttrib_t - rename _eglGetSyncAttribKHR to _eglGetSyncAttrib Reviewed-by: Chad Versace <[email protected]>
* egl: add eglWaitSyncMarek Olšák2015-06-051-0/+12
| | | | | Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* egl: add EGL 1.5 functions that don't need any changes from extensionsMarek Olšák2015-06-051-12/+16
| | | | | | | Declare the functions without the suffix, so that the core names are exported. Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* egl: use EGL 1.5 types without suffixesMarek Olšák2015-06-051-20/+20
| | | | | Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* egl: combine VersionMajor and VersionMinor into one variableMarek Olšák2015-06-051-5/+4
| | | | | Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* egl: set the EGL version in common codeMarek Olšák2015-06-051-0/+7
| | | | | Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* egl: remove remaining EGL_MESA_copy_context skeletonEmil Velikov2015-05-141-1/+0
| | | | | | | | | | With earlier commit (7a58262e58d egl: Remove skeleton implementation of EGL_MESA_screen_surface) we've removed the skeleton implementation of eglCopyContextMESA(). Just like EGL_MESA_screen_surface this extension was never implemented in mesa. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Adam Jackson <[email protected]>
* egl/main: fix EGL_KHR_get_all_proc_addressesEmil Velikov2015-05-141-3/+3
| | | | | | | | | | | | | | | | The extension requires that the address of the core functions should be available via eglGetProcAddress. Currently the list is guarded by _EGL_GET_CORE_ADDRESSES, which was only set for the scons (windows) build. Unconditionally enable it for all the builds (automake, android and haiku) considering that the extension is not platform specific and is always enabled. v2: Drop the _EGL_GET_CORE_ADDRESSES macro altogether. Cc: [email protected] Signed-off-by: Emil Velikov <[email protected]>
* egl: more define fixes for EGL_MESA_image_dma_buf_exportMarc-André Lureau2015-05-141-1/+1
| | | | | | s/EGL_MESA_dma_buf_image_export/EGL_MESA_image_dma_buf_export as defined by the spec Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* egl/main: expose only core EGL functions staticallyEmil Velikov2015-05-141-133/+132
| | | | | | | | | | | | | | | | | | | | | | | | | | | The EGL 1.3, 1.4 and 1.5 spec (as quoted below) explicitly mentions that providing static symbols for functions provided by EGL extensions is not portable. Considering that relatively recently we've seen a non-mesa desktop EGL implementation, the fact that we opt for such behaviour has gone unnoticed. From the EGL 1.5 specification: For functions that are queryable with eglGetProcAddress, implementations may choose to also export those functions statically from the object libraries implementing those functions. However, portable clients cannot rely on this behavior. To encourage devs against writing such non-portable code, let's hide the symbols similar to the official binary driver from NVIDIA. v2: Quote the EGL 1.5 spec, as suggested by Chad. Cc: Brian Paul <[email protected]> Cc: Chad Versace <[email protected]> Cc: Daniel Kurtz <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* egl: Remove skeleton implementation of EGL_MESA_screen_surfaceAdam Jackson2015-05-111-278/+0
| | | | | | | | No backend wires this up to anything, and the extension spec has been marked obsolete for 4+ years. Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Adam Jackson <[email protected]>
* egl: image_dma_buf_export - use KHR 64-bit typeDave Airlie2015-05-051-1/+1
| | | | | | | | After talking to Jon Leech he suggested this should be fine. update spec to the version in the registry. Signed-off-by: Dave Airlie <[email protected]>
* egl/dri2: implement EGL_KHR_cl_event2 (v2)Marek Olšák2015-04-301-3/+27
| | | | v2: fix the SYNC_CONDITION query
* egl/dri2: implement EGL_KHR_wait_syncMarek Olšák2015-04-301-0/+28
|
* egl/dri2: implement EGL_KHR_fence_syncMarek Olšák2015-04-301-5/+29
|
* egl: misc fixes for EGL_MESA_image_dma_buf_exportMarc-André Lureau2015-04-291-1/+1
| | | | | | | Fix define and a function argument name introduced in commit 8f7338f284cdb1fef64c85e3293d2200d0cc6387 Signed-off-by: Dave Airlie <[email protected]>
* egl: add initial EGL_MESA_image_dma_buf_export v2.4Dave Airlie2015-04-011-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | At the moment to get an EGL image to a dma-buf file descriptor, you have to use EGL_MESA_drm_image, and then use libdrm to convert this to a file descriptor. This extension just provides an API modelled on EGL_MESA_drm_image, to return a dma-buf file descriptor. v2: update spec for new API proposal add internal queries to get the fourcc back from intel driver. v2.1: add gallium pieces. v2.2: add offsets to spec and API, rename fd->fds, stride->strides in API. rewrite spec a bit more, add some q/a v2.3: add modifiers to query interface and 64-bit type for that (Daniel Stone) specifiy what happens to num fds vs num planes differences. (Chad Versace) v2.4: fix grammar (Daniel Stone) Signed-off-by: Dave Airlie <[email protected]>
* egl: don't fill client apis string forever.Dave Airlie2015-03-191-0/+1
| | | | | | | | | We never reset the string on eglTerminate, so it grows for ever on multiple eglInitialise. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Matt Turner <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* egl: Remove eglQueryString virtual dispatch.Matt Turner2015-03-171-3/+12
| | | | Reviewed-by: Chad Versace <[email protected]>
* egl: Create queryable strings in eglInitialize().Matt Turner2015-03-131-0/+112
| | | | | | | | | | | | | | | | | | | | | | | Creating/recreating the strings in eglQueryString() is extra work and isn't thread-safe, as exhibited by shader-db's run.c using libepoxy. Multiple threads in run.c call eglReleaseThread() around the same time. libepoxy calls eglQueryString() to determine whether eglReleaseThread() exists, and our EGL implementation passes a pointer to the version string to libepoxy while simultaneously overwriting the string, leading to a failure in libepoxy. Moreover, the EGL spec says (emphasis mine): "eglQueryString returns a pointer to a *static*, zero-terminated string" This patch moves some auxiliary functions from eglmisc.c to eglapi.c so that they may be used to create the extension, API, and version strings once during eglInitialize(). The auxiliary functions are renamed from _eglUpdate* to _eglCreate*, and some checks made unnecessary by calling the functions from eglInitialize() are removed. Reviewed-by: Chad Versace <[email protected]>
* egl/main: use c11/threads' mutex directlyEmil Velikov2015-03-111-6/+8
| | | | | | | Remove the inline wrappers/abstraction layer. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* Revert "egl/main: use c11/threads' mutex directly"Emil Velikov2015-03-061-8/+6
| | | | | | This reverts commit 6cee785c69a5c8d2d32b6807f9c502117f5a74b0. Not meant to go in yet. Lacking review.
* egl/main: use c11/threads' mutex directlyEmil Velikov2015-03-061-6/+8
| | | | | | Remove the inline wrappers/abstraction layer. Signed-off-by: Emil Velikov <[email protected]>
* egl/main: replace __FUNCTION__ with __func__Emil Velikov2015-03-051-3/+3
| | | | | | | | | | | The latter is a C99 standard, and our current wrapper c99_compat.h should handle non-compliant compilers. Drop the c99_compat.h inclusion from eglcompiler.h altogether, as it's no longer required. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* egl/main: replace INLINE with inlineEmil Velikov2015-03-051-9/+10
| | | | | | | | | | Drop the custom keyword in favour of the C99 one. All the places using it now directly include c99_compat.h which should handle things on platforms which lack it. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* egl: Add Haiku code and supportAlexander von Gluck IV2014-12-231-0/+2
| | | | | | | * This is the cleaned up work of the Haiku GCI student Adrián Arroyo Calle [email protected] * Several patches were consolidated to prevent unnecessary touching of non-related code
* egl: Expose EGL_KHR_get_all_proc_addresses and its client extensionChad Versace2014-12-071-0/+17
| | | | | | | | | Mesa already implements the behavior of EGL_KHR_get_all_proc_addresses and EGL_KHR_client_get_all_proc_addresses. This patch just exposes the extension strings. See: https://www.khronos.org/registry/egl/extensions/KHR/EGL_KHR_get_all_proc_addresses.txt Signed-off-by: Chad Versace <[email protected]>
* egl: Check for NULL native_window in eglCreateWindowSurfaceSinclair Yeh2014-06-031-0/+4
| | | | | | | | | | | | | | | We have customers using NULL as a way to test the robustness of the API. Without this check, EGL will segfault trying to dereference dri2_surf->wl_win->private because wl_win is NULL. This fix adds a check and sets EGL_BAD_NATIVE_WINDOW v2: Incorporated feedback from idr - moved the check to a higher level function. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Chad Versace <[email protected]> Cc: "10.1 10.2" <[email protected]>
* egl/main: Fix eglMakeCurrent when releasing context from current thread.Beren Minor2014-06-021-2/+6
| | | | | | | | | | | | | | EGL 1.4 Specification says that eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT) can be used to release the current thread's ownership on the surfaces and context. MESA's egl implementation was only accepting the parameters when the KHR_surfaceless_context extension is supported. [chadv] Add quote from the EGL 1.4 spec. Cc: "10,1, 10.2" <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* egl: Add EGL_CHROMIUM_sync_control extension.Sarah Sharp2014-05-201-0/+23
| | | | | | | | | | | | | | | | | | | | | Chromium defined a new GL extension (that isn't registered with Khronos). We need to add an EGL extension for it, so we can migrate ChromeOS on Intel systems to use EGL instead of GLX. http://git.chromium.org/gitweb/?p=chromium/src/third_party/khronos.git;a=commitdiff;h=27cbfdab35c601f70aa150581ad1448d0401f447 The EGL_CHROMIUM_sync_control extension is similar to the GLX extension OML_sync_control, but only defines one function, eglGetSyncValuesCHROMIUM, which is equivalent to glXGetSyncValuesOML. http://www.opengl.org/registry/specs/OML/glx_sync_control.txt Signed-off-by: Sarah Sharp <[email protected]> Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Cc: Jamey Sharp <[email protected]> Cc: Ian Romanick <[email protected]> Cc: Stéphane Marchesin <[email protected]>
* egl/main: Enable Linux platform extensionsChad Versace2014-03-171-22/+110
| | | | | | | | | | | | | | | | Enable EGL_EXT_platform_base and the Linux platform extensions layered atop it: EGL_EXT_platform_x11, EGL_EXT_platform_wayland, and EGL_MESA_platform_gbm. Tested with Piglit's EGL_EXT_platform_base tests under an X11 session. To enable running the Wayland and GBM tests, windowed Weston was running and the kernel had render nodes enabled. I regression tested my EGL_EXT_platform_base patch set with Piglit on Ivybridge under X11/EGL, standalone Weston, and GBM with rendernodes. No regressions found. Signed-off-by: Chad Versace <[email protected]>
* egl/main: Stop using EGLNative types internallyChad Versace2014-03-171-5/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Internally, much of the EGL code uses EGLNativeDisplayType, EGLNativeWindowType, and EGLPixmapType. However, the EGLNative type often does not match the variable's actual type. The concept of EGLNative types are a bad match for Linux, as explained below. And the EGL platform extensions don't use EGLNative types at all. Those extensions attempt to solve cross-platform issues by moving the EGL API away from the EGLNative types. The core of the problem is that eglplatform.h can define each EGLNative type once only, but Linux supports multiple EGL platforms. To work around the problem, Mesa's eglplatform.h contains multiple definitions of each EGLNative type, selected by feature macros. Mesa expects EGL clients to set the feature macro approrpiately. But the feature macros don't work when a single codebase must be built with support for multiple EGL platforms, *such as Mesa itself*. When building libEGL, autotools chooses the EGLNative typedefs based on the first element of '--with-egl-platforms'. For example, '--with-egl-platforms=x11,drm,wayland' defines the following: typedef Display* EGLNativeDisplayType; typedef Window EGLNativeWindowType; typedef Pixmap EGLNativePixmapType; Clearly, this doesn't work well for Wayland and GBM. Mesa works around the problem by casting the EGLNative types to different things in different files. For sanity's sake, and to prepare for the EGL platform extensions, this patch removes from egl/main and egl/dri2 all internal use of the EGLNative types. It replaces them with 'void*' and checks each explicit cast with a static assertion. Also, the patch touches egl_gallium the minimal amount to keep it compatible with eglapi.h. Signed-off-by: Chad Versace <[email protected]>
* Add the EGL_MESA_configless_context extensionNeil Roberts2014-03-121-1/+1
| | | | | | | | | | | | | | | | | | | | This extension provides a way for an application to render to multiple surfaces with different buffer formats without having to use multiple contexts. An EGLContext can be created without an EGLConfig by passing EGL_NO_CONFIG_MESA. In that case there are no restrictions on the surfaces that can be used with the context apart from that they must be using the same EGLDisplay. _mesa_initialze_context can now take a NULL gl_config which will mark the context as ‘configless’. It will memset the visual to zero in that case. Previously the i965 and i915 drivers were explicitly creating a zeroed visual whenever 0 is passed for the EGLConfig. Mesa needs to be aware that the context is configless because it affects the initial value to use for glDrawBuffer. The first time the context is bound it will set the initial value for configless contexts depending on whether the framebuffer used is double-buffered. Reviewed-by: Kristian Høgsberg <[email protected]>
* eglCreateContext: Remove the check for whether config == 0Neil Roberts2014-03-121-5/+2
| | | | | | | | | | | | | | | | In eglCreateContext there is a check for whether the config parameter is zero and in this case it will avoid reporting an error if the EGL_KHR_surfacless_context extension is supported. However there is nothing in that extension which says you can create a context without a config and Mesa breaks if you try this so it is probably better to leave it reporting an error. The original check was added in b90a3e7d8b1bc based on the API-specific extensions EGL_KHR_surfaceless_opengl/gles1/gles2. This was later changed to refer to EGL_KHR_surfacless_context in b50703aea5. Perhaps the original extensions specified a configless context but the new one does not. Reviewed-by: Kristian Høgsberg <[email protected]>
* s/Tungsten Graphics/VMware/José Fonseca2014-01-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tungsten Graphics Inc. was acquired by VMware Inc. in 2008. Leaving the old copyright name is creating unnecessary confusion, hence this change. This was the sed script I used: $ cat tg2vmw.sed # Run as: # # git reset --hard HEAD && find include scons src -type f -not -name 'sed*' -print0 | xargs -0 sed -i -f tg2vmw.sed # # Rename copyrights s/Tungsten Gra\(ph\|hp\)ics,\? [iI]nc\.\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./g /Copyright/s/Tungsten Graphics\(,\? [iI]nc\.\)\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./ s/TUNGSTEN GRAPHICS/VMWARE/g # Rename emails s/[email protected]/[email protected]/ s/[email protected]/[email protected]/g s/jrfonseca-at-tungstengraphics-dot-com/jfonseca-at-vmware-dot-com/ s/jrfonseca\[email protected]/[email protected]/g s/keithw\[email protected]/[email protected]/g s/[email protected]/[email protected]/g s/thomas-at-tungstengraphics-dot-com/thellstom-at-vmware-dot-com/ s/[email protected]/[email protected]/ # Remove dead links s@Tungsten Graphics (http://www.tungstengraphics.com)@Tungsten Graphics@g # C string src/gallium/state_trackers/vega/api_misc.c s/"Tungsten Graphics, Inc"/"VMware, Inc"/ Reviewed-by: Brian Paul <[email protected]>
* wayland: Add an extension to create wl_buffers from EGLImagesNeil Roberts2013-12-041-0/+25
| | | | | | | | | | | | | | | | | | This adds an extension called EGL_WL_create_wayland_buffer_from_image which adds the following single function: struct wl_buffer * eglCreateWaylandBufferFromImageWL(EGLDisplay dpy, EGLImageKHR image); The function creates a wl_buffer which shares its contents with the given EGLImage. The expected use case for this is in a nested Wayland compositor which is using subsurfaces to present buffers from its clients. Using this extension it can attach the client buffers directly to the subsurface without having to blit the contents into an intermediate buffer. The compositing can then be done in the parent compositor. The extension is only implemented in the Wayland EGL platform because of course it wouldn't make sense anywhere else.
* egl: Enable EGL_EXT_client_extensionsChad Versace2013-11-261-1/+7
| | | | | | | | | | | | | | Insert two fields into _egl_global to hold the client extensions and statically initialize them: ClientExtensions // a struct of bools ClientExtensionString Post-patch, Mesa supports exactly one client extension, EGL_EXT_client_extensions. Signed-off-by: Chad Versace <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* egl: Update to Wayland 1.2 server APIAnder Conselvan de Oliveira2013-08-071-1/+1
| | | | | | | | | | Since Wayland 1.2, struct wl_buffer and a few functions are deprecated. References to wl_buffer are replaced with wl_resource and some getter functions and calls to deprecated functions are replaced with the proper new API. The latter changes are related to resource versioning. Signed-off-by: Ander Conselvan de Oliveira <[email protected]>
* egl: definitions for EXT_image_dma_buf_importTopi Pohjolainen2013-08-021-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As specified in: http://www.khronos.org/registry/egl/extensions/EXT/EGL_EXT_image_dma_buf_import.txt Checking for the valid fourcc values is left for drivers avoiding dependency to drm header files here. v2: enforce EGL_NO_CONTEXT v3: declare the extension as EGL (not GLES) v4: do not update eglext.h manually but rely on update from Khronos instead v5: (Eric) report invalid context as EGL_BAD_PARAMETER instead of as EGL_BAD_CONTEXT v6: (Chad) fix the checking for valid hints. Before all values were rejected. v7: (Chad) comment style change from /** * Multi- * line into /* Multi- * line Signed-off-by: Topi Pohjolainen <[email protected]> Reviewed-by: Chad Versace <[email protected]>