summaryrefslogtreecommitdiffstats
path: root/src/egl/main
Commit message (Collapse)AuthorAgeFilesLines
...
* egl: support EGL_LARGEST_PBUFFER in eglCreatePbufferSurface(...)Daniel Czarnowski2016-03-183-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | Patch provides a default for a set pbuffer surface size when EGL_LARGEST_PBUFFER is used by the client. MIN2 macro is moved to egldefines so that it can be shared. Fixes following Piglit test: egl-create-largest-pbuffer-surface From EGL 1.5 spec: "Use EGL_LARGEST_PBUFFER to get the largest available pbuffer when the allocation of the pbuffer would otherwise fail." Currently there exists no API to query largest available pixmap size using xlib or xcb so right now this seems most straightforward way to ensure that we fulfill above API and also we don't attempt to allocate 'too big' pixmap which might succeed on server side but not work in practice when driver starts to use it as a texture. v2: add more explanation about the change (Emil) Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Cc: "11.0 11.1" <mesa-stable@lists.freedesktop.org Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* egl: clean up typedef madness in the backend APIMarek Olšák2016-03-102-155/+155
| | | | | | let's use the dd.h format Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* egl: remove remnants of MESA_drm_displayEmil Velikov2016-03-092-10/+0
| | | | | | | Last set in st/egl, unused in mesa-demos and superseded by EGL_KHR_platform_gbm. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
* egl: remove final pieces of KHR_vg_parent_imageEmil Velikov2016-03-092-2/+0
| | | | | | Similar to previous commit - unused/unset for a long time. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
* egl: move Null check to eglGetSyncAttribKHR to prevent SegfaultDongwon Kim2016-02-192-5/+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" <mesa-stable@lists.freedesktop.org Signed-off-by: Dongwon Kim <dongwon.kim@intel.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> [Emil Velikov: tweak commit message, add stable tag] Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* egl: rework handling EGL_CONTEXT_FLAGSMatthew Waters2015-10-031-5/+44
| | | | | | | | | | | | | | | | | | As of version 15 of the EGL_KHR_create_context spec, debug contexts are allowed for ES contexts. We should allow creation instead of erroring. While we're here provide a more comprehensive checking for the other two flags - ROBUST_ACCESS_BIT_KHR and FORWARD_COMPATIBLE_BIT_KHR v2 [Emil Velikov] Rebase. Minor tweak in commit message. Cc: Boyan Ding <boyan.j.ding@gmail.com> Cc: Chad Versace <chad.versace@intel.com> Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91044 Signed-off-by: Matthew Waters <ystreet00@gmail.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
* egl: improve attribute checking for eglCreateContextFrank Binns2015-08-131-1/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | The EGL 1.4 spec states for eglCreateContext: "attribute EGL_CONTEXT_CLIENT_VERSION is only valid when the current rendering API is EGL_OPENGL_ES_API" Additionally, if the EGL_KHR_create_context EGL extension is supported (this is mandatory in EGL 1.5) then the EGL_CONTEXT_MAJOR_VERSION_KHR, which is an alias for EGL_CONTEXT_CLIENT_VERSION, and EGL_CONTEXT_MINOR_VERSION_KHR attributes are also accepted by eglCreateContext with the extension spec stating: "The values for attributes EGL_CONTEXT_MAJOR_VERSION_KHR and EGL_CONTEXT_MINOR_VERSION_KHR specify the requested client API version. They are only meaningful for OpenGL and OpenGL ES contexts, and specifying them for other types of contexts will generate an error." Add the necessary checks against the extension and rendering APIs when validating these attributes as part of eglCreateContext. Signed-off-by: Frank Binns <frank.binns@imgtec.com> Reviewed-by: Matt Turner <mattst88@gmail.com> [Emil Velikov: Add newline before the spec quote (Matt)] Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
* egl: don't allow eglGetConfigs to set num_configs param to a negative valueFrank Binns2015-08-131-0/+3
| | | | | | | | | | | | | | | | | | When a buffer is provided to eglGetConfigs it's supposed to set the value of the num_config parameter to the total number of configs that have been copied into this buffer. For some reason the EGL spec doesn't consider it to be an error to pass this function a buffer while specifying its size to be less than 0. Given this, one would expect this combination to result in the num_config parameter being set to 0 but this wasn't the case. This was due to the buffer size being copied straight into num_configs without being clamped to 0. This was causing the following dEQP EGL test to fail: dEQP-EGL.functional.query_config.get_configs.get_configs_bounds Signed-off-by: Frank Binns <frank.binns@imgtec.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
* egl: Add eglQuerySurface surface type check for EGL_LARGEST_PBUFFER attribFrank Binns2015-08-041-1/+2
| | | | | | | | | | | | | | | | | | | Calling eglQuerySurface on a window or pixmap with the EGL_LARGEST_PBUFFER attribute resulted in the contents of the 'value' parameter being modified. This is the wrong behaviour according to the EGL spec, which states: "Querying EGL_LARGEST_PBUFFER for a pbuffer surface returns the same attribute value specified when the surface was created with eglCreatePbufferSurface. For a window or pixmap surface, the contents of value are not modified." Avoid this from happening by checking that the surface type is EGL_PBUFFER_BIT before modifying the contents of the parameter. Cc: <mesa-stable@lists.freedesktop.org> Signed-off-by: Frank Binns <frank.binns@imgtec.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Eric Anholt <eric@anholt.net>
* egl: remove ifdef $(egl_extension) compile guardsEmil Velikov2015-08-013-65/+1
| | | | | | All of these are already defined in the headers provided. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
* egl: implement EGL_KHR_gl_colorspace (v2)Marek Olšák2015-07-223-1/+27
| | | | | | v2: add missing "break" Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
* egl: remove old makefile.sourcesEmil Velikov2015-07-221-29/+0
| | | | | Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Acked-by: Matt Turner <mattst88@gmail.com>
* android: rework the EGL buildEmil Velikov2015-07-221-84/+0
| | | | | | | | | | | | See previous two commits for details. v2: Don't forget git mv, bring back DRM_GRALLOC_TOP. Spotted by Varad. Cc: Chih-Wei Huang <cwhuang@android-x86.org> Cc: Eric Anholt <eric@anholt.net> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Acked-by: Matt Turner <mattst88@gmail.com> Tested-by: Varad Gautam <varadgautam@gmail.com>
* scons: rework the EGL buildEmil Velikov2015-07-221-32/+0
| | | | | | | | | The scons equivalent of the previous commit - just fold the almost identical driver + main Sconscripts. Cc: Alexander von Gluck IV <kallisti5@unixzen.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Acked-by: Matt Turner <mattst88@gmail.com>
* automake: rework the EGL buildEmil Velikov2015-07-221-95/+0
| | | | | | | | | | | Simplify things by merging the two makefiles. This way we can combine the duplicated HAVE_PLATFORM_ checks, and build the library without having a separate static library. v2: use $() when referencing variables, use correct define (Matt) Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
* egl: automake: remove unused HAVE_XCB_DRI2 defineEmil Velikov2015-07-221-1/+0
| | | | | Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
* egl: remove unused _EGL_DRIVER_SEARCH_DIR defineEmil Velikov2015-07-223-8/+2
| | | | | Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
* egl: remove final Windows specific workaroundEmil Velikov2015-07-224-10/+2
| | | | | Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
* egl: remove custom string functionsEmil Velikov2015-07-226-112/+5
| | | | | | | | 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 <emil.l.velikov@gmail.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
* egl: remove _EGL_PLATFORM_WINDOWS enumEmil Velikov2015-07-222-2/+0
| | | | | Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
* egl: remove final references of platform_nullEmil Velikov2015-07-223-6/+0
| | | | | Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
* egl: remove the non-haiku scons buildEmil Velikov2015-07-221-23/+8
| | | | | | | | | | | | | | | | It has been broken since 2011 with commit c98ea26e16b(egl: Make egl_dri2 and egl_glx built-in drivers.). When the backends got merged into the main library each entry point was guarded by a _EGL_BUILT_IN_DRIVER_* define. As the define was missing, the linker kindly removed the whole of the dri2 backend, thus we did not notice any errors due to the unresolved link to xcb and friends. Cc: Chia-I Wu <olv@lunarg.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Acked-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
* egl: sort extension lists alphabeticallyMarek Olšák2015-07-033-54/+51
| | | | and add the missing KHR_gl_colorspace case.
* android: egl: do not link against libglapiEmil Velikov2015-06-231-1/+0
| | | | | | | | | | | The only reason we touch glapi is to dlopen it in order to: - make sure that the unresolved _glapi* symbols in the dri modules are provided. - fetch glFlush() and use it at various stages in the dri2 driver. Cc: Chih-Wei Huang <cwhuang@linux.org.tw> Cc: Eric Anholt <eric@anholt.net> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
* egl/dri2: implement platform_surfacelessHaixia Shi2015-06-163-1/+7
| | | | | | | | | | | | | | | | | | The surfaceless platform is for off-screen rendering only. Render node support is required. Only consider the render nodes. Do not use normal nodes as they require auth hooks. v3: change platform_null to platform_surfaceless v4: make libdrm required for surfaceless v5: remove modified include guards with defined(HAVE_SURFACELESS_PLATFORM) v6: use O_CLOEXEC for drm fd Signed-off-by: Haixia Shi <hshi@chromium.org> Signed-off-by: Zach Reizner <zachr@google.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Chad Versace <chad.versace@intel.com>
* android: Depend on gallium_dri from EGL, instead of linking in gallium.Chih-Wei Huang2015-06-091-80/+3
| | | | | | | | | | | | The Android gallium build used to use gallium_egl, which was removed back in March. Instead, we will now use a normal Mesa libEGL loader with dlopen()ing of a DRI module. v2: add a clean step to rebuild all dri modules properly. v3: Squish the 2 patches doing this together (change by anholt). Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw> Reviewed-by: Eric Anholt <eric@anholt.net>
* egl: expose EGL 1.5 if all requirements are metMarek Olšák2015-06-052-0/+16
| | | | | | | | There's no driver support yet, because EGL_KHR_gl_colorspace isn't implemented. Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Chad Versace <chad.versace@intel.com>
* egl: return correct invalid-type error from eglCreateSyncMarek Olšák2015-06-051-8/+19
| | | | | Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Chad Versace <chad.versace@intel.com>
* 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 <chad.versace@intel.com>
* egl: add eglCreateImage (v2)Marek Olšák2015-06-051-0/+42
| | | | | | | v2: - use calloc - return BAD_ALLOC if calloc fails Reviewed-by: Chad Versace <chad.versace@intel.com>
* egl: add eglGetSyncAttrib (v2)Marek Olšák2015-06-055-10/+29
| | | | | | | | | 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 <chad.versace@intel.com>
* egl: add eglWaitSyncMarek Olšák2015-06-051-0/+12
| | | | | Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Chad Versace <chad.versace@intel.com>
* 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 <emil.l.velikov@gmail.com> Reviewed-by: Chad Versace <chad.versace@intel.com>
* egl: use EGL 1.5 types without suffixesMarek Olšák2015-06-055-36/+36
| | | | | Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Chad Versace <chad.versace@intel.com>
* egl: add context attribs from EGL 1.5Marek Olšák2015-06-051-0/+30
| | | | | Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Chad Versace <chad.versace@intel.com>
* egl: fix setting context flagsMarek Olšák2015-06-051-2/+3
| | | | | | Cc: 10.6 10.5 10.4 <mesa-stable@lists.freedesktop.org> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Chad Versace <chad.versace@intel.com>
* egl: combine VersionMajor and VersionMinor into one variableMarek Olšák2015-06-052-7/+5
| | | | | Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Chad Versace <chad.versace@intel.com>
* egl: set the EGL version in common codeMarek Olšák2015-06-051-0/+7
| | | | | Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Chad Versace <chad.versace@intel.com>
* egl: remove unused _egl_global::ClientExtensionsMarek Olšák2015-06-052-19/+0
| | | | | Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Chad Versace <chad.versace@intel.com>
* egl: remove remaining EGL_MESA_copy_context skeletonEmil Velikov2015-05-142-2/+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 <emil.l.velikov@gmail.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
* 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: mesa-stable@lists.freedesktop.org Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
* egl: more define fixes for EGL_MESA_image_dma_buf_exportMarc-André Lureau2015-05-142-2/+2
| | | | | | s/EGL_MESA_dma_buf_image_export/EGL_MESA_image_dma_buf_export as defined by the spec Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Chad Versace <chad.versace@intel.com>
* egl/main: expose only core EGL functions staticallyEmil Velikov2015-05-142-135/+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 <brianp@vmware.com> Cc: Chad Versace <chad.versace@intel.com> Cc: Daniel Kurtz <djkurtz@chromium.org> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Chad Versace <chad.versace@intel.com>
* egl/main: Update README.txtEmil Velikov2015-05-141-7/+6
| | | | | | | | | | | | The driver search/load is not done at eglGetDisplay (or eglOpenDisplay as the readme called it) time, but during eglInitialize(). Drop _eglMain (available only for external drivers) reference. Mention we use function(s), specific to the built-in driver(s). Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Chad Versace <chad.versace@intel.com>
* egl/main: cleanup function prototypesEmil Velikov2015-05-142-14/+2
| | | | | | | | | Cleanup the function propotypes which were part of the previous EGL drivers. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Chad Versace <chad.versace@intel.com>
* egl/main: drop support for external egl driversEmil Velikov2015-05-141-351/+13
| | | | | | | | The only user (egl_gallium) is not longer around. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Chad Versace <chad.versace@intel.com>
* egl: Add needed extern "C" for C++ accessAlexander von Gluck IV2015-05-1413-0/+110
| | | | | | * Haiku's egl driver is C++ due to the interface natively being C++ Reviewed-⁠by: Brian Paul <brianp@vmware.com>
* egl: Remove skeleton implementation of EGL_MESA_screen_surfaceAdam Jackson2015-05-1112-1196/+0
| | | | | | | | No backend wires this up to anything, and the extension spec has been marked obsolete for 4+ years. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
* egl: image_dma_buf_export - use KHR 64-bit typeDave Airlie2015-05-052-2/+2
| | | | | | | | After talking to Jon Leech he suggested this should be fine. update spec to the version in the registry. Signed-off-by: Dave Airlie <airlied@redhat.com>
* egl/dri2: return the latest sync status in eglGetSyncAttribKHRMarek Olšák2015-04-301-1/+8
|