summaryrefslogtreecommitdiffstats
path: root/src/egl/main
Commit message (Collapse)AuthorAgeFilesLines
* egl: Rename MESA_configless_context bit to KHR_no_config_contextAdam Jackson2016-09-123-5/+7
| | | | | | | | | Keep the old name in the extension string, but refer to the KHR extension internally. Reviewed-by: Kristian Høgsberg <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Adam Jackson <[email protected]>
* egl: QueryContext on a configless context returns zeroAdam Jackson2016-09-121-3/+8
| | | | | | | | | | | | MESA_configless_context does not specify the interaction with QueryContext at all, and the code to generate an error in this case predates the Mesa extension. Since EGL_NO_CONFIG_{KHR,MESA} are numerically identical there's no way to distinguish which one the application asked for, so use the KHR behaviour. Reviewed-by: Kristian Høgsberg <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Adam Jackson <[email protected]>
* egl: fix gcc warning braces around scalar initializerTimothy Arceri2016-09-121-1/+1
| | | | Reviewed-by: Alejandro Piñeiro <[email protected]>
* egl: Fix up indentation on previous commitAdam Jackson2016-09-081-2/+2
| | | | | | This was requested in review but I pushed the wrong version. Signed-off-by: Adam Jackson <[email protected]>
* egl: Document why EGL_OPENGL{, _ES}_API are mostly identicalAdam Jackson2016-09-081-0/+10
| | | | | Signed-off-by: Adam Jackson <[email protected]> Reviewed-by: Alejandro Piñeiro <[email protected]>
* EGL: Combine the GL and GLES current contexts (v2)Kyle Brenneman2016-09-074-107/+22
| | | | | | | | | | | | | | | | | | | | | | Only keep track of a single current context, instead of separate contexts for GL and GLES. In EGL 1.4 (and 1.5), EGL_OPENGL_API and EGL_OPENGL_ES_API are supposed to be interchangeable for all purposes except for eglCreateContext. The _EGLThreadInfo::CurrentContexts array is now a single pointer to the current context, which may be a GL or GLES context. In addition, it now keeps track of the current API as an enum instead of an index. eglMakeCurrent will now replace the current context, regardless of which client API is used for for the current and new contexts. It no longer checks for a conflicting context. In addition, calling eglMakeCurrent with EGL_NO_CONTEXT will now release the current context regardless of the current API. v2: Rebased against master (Adam Jackson) Reviewed-by: Adam Jackson <[email protected]>
* egl: treat EGL_OPENGL_API as invalid on AndroidEmil Velikov2016-08-301-1/+7
| | | | | | | | At the moment one can use OpenGL in eglBindAPI() only to clear the EGL_OPENGL_BIT from RenderableType and Conformant for _each_ config. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Tomasz Figa <[email protected]>
* egl: turn a couple asserts static (compile-time)Eric Engestrom2016-08-241-3/+4
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: Fix the bad surface attributes combination checking for pbuffers. (v3)Guillaume Charifi2016-07-071-21/+15
| | | | | | | | | | | | | | | | | Fixes a regression induced by commit a0674ce5c41903ccd161e89abb149621bfbc40d2: When EGL_TEXTURE_FORMAT and EGL_TEXTURE_TARGET were both specified (and both != EGL_NO_TEXTURE), an error was instantly triggered, before the other one had even a chance to be checked, which is obviously not the intended behaviour. v2: Full commit hash, remove useless variables. v3: [chadv] Add Fixes footers. Fixes: piglit "spec/egl 1.4/eglcreatepbuffersurface and then glclear" Fixes: piglit "spec/egl 1.4/largest possible eglcreatepbuffersurface and then glclear" Signed-off-by: Guillaume Charifi <[email protected]> Reviewed-by: Frank Binns <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* egl/display: remove unnecessary code and make it easier to readEric Engestrom2016-07-071-15/+14
| | | | | | | | | Remove the two first level `if` as they will always be true, and flatten the two remaining `if`. No functional change. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* Revert "egl: Check if API is supported when using eglBindAPI."Marek Olšák2016-06-034-72/+10
| | | | | | This reverts commit e8b38ca202fbe8c281aeb81a4b64256983f185e0. It broke Glamor for Gallium at least.
* egl: Account for default values of texture target and formatPlamena Manolova2016-06-021-0/+6
| | | | | | | | | | When validating attributes during surface creation we should account for the default values of texture target and format (EGL_NO_TEXTURE) since the user is not obligated to explicitly set both via the attribute list passed to eglCreatePbufferSurface. Signed-off-by: Plamena Manolova <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* egl: Check if API is supported when using eglBindAPI.Plamena Manolova2016-06-024-10/+72
| | | | | | | | | According to the EGL specifications before binding an API we must check whether it's supported first. If not eglBindAPI should return EGL_FALSE and generate a EGL_BAD_PARAMETER error. Signed-off-by: Plamena Manolova <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa_glinterop: remove mesa_glinterop typedefsEmil Velikov2016-05-302-9/+9
| | | | | | | | | | | | | | | | As is there are two places that do the typedefs - dri_interface.h and this header. As we cannot include the former in here, just drop the typedefs and use the struct directly (as needed). This is required because typedef redefinition is C11 feature which is not supported on all the versions of GCC used to build mesa. v2: Kill the typedef alltogether, as per Marek. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96236 Cc: Vinson Lee <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* egl: Additional attribute validation for eglCreatePbufferSurfacePlamena Manolova2016-05-261-0/+13
| | | | | | | | | | | | | eglCreatePbufferSurface should generate an EGL_BAD_MATCH error if: 1: The EGL_TEXTURE_FORMAT attribute is EGL_NO_TEXTURE and EGL_TEXTURE_TARGET is something other than EGL_NO_TEXTURE 2: EGL_TEXTURE_FORMAT is something other than EGL_NO_TEXTURE and EGL_TEXTURE_TARGET is EGL_NO_TEXTURE. This fixes the dEQP-EGL.functional.negative_api.create_pbuffer_surface test. Signed-off-by: Plamena Manolova <[email protected]> Reviewed-by: Ben Widawsky <[email protected]>
* mesa_glinterop: make GL interop version field bidirectionalEmil Velikov2016-05-242-2/+2
| | | | | | | | | | | | | | This allows clear and easy communication between the two. Caller: Requesting information (struct vN) Callee: I know how to deal with older version (vN-1) only. Here is your data and the version I support. Caller: Older version ? Sure I'll cap all access to the fields provided by the older version (vN-1) Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Tested-by: Tom Stellard <[email protected]>
* mesa_glinterop: remove unneeded GLAPI/GLAPIENTRY/APIENTRYP symbolsEmil Velikov2016-05-241-2/+2
| | | | | | | | | | | | | | | | These come from windows.h, gl.h, glcorearb.h and/or glext.h. The interop interface is aimed at non-Windows platforms while the macros are used/derived due to Windows specifics. Thus we can safely remove them. Strictly speaking there should be GLXAPIENTRY/EGLAPIENTRY and alike macros, although a) there is no GLX ones and b) this brings us even further from decoupling the file from the GLX/EGL header dependency. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Tested-by: Tom Stellard <[email protected]>
* egl: Add OpenGL_ES to API string regardless of GLES versionPlamena Manolova2016-05-231-7/+4
| | | | | | | | | | | | | | | | | According to the EGL specifications eglQueryString(EGL_CLIENT_APIS) should return a string containing a combination of "OpenGL", "OpenGL_ES" and "OpenVG", any other values would be considered invalid. Due to this when the API string is constructed, the version of GLES should be disregarded and "OpenGL_ES" should be attached once instead of "OpenGL_ES2" and "OpenGL_ES3". Fixes: dEQP-EGL.functional.negative_api* and dEQP-EGL.functional.query_context.simple.query_api Signed-off-by: Plamena Manolova <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Ben Widawsky <[email protected]>
* egl: implement EGL part of interop interface (v2)Marek Olšák2016-04-202-0/+81
| | | | v2: - use const
* egl: add EGL_KHR_reusable_sync to egl_driDongwon Kim2016-04-052-2/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch enables an EGL extension, EGL_KHR_reusable_sync. This new extension basically provides a way for multiple APIs or threads to be excuted synchronously via a "reusable sync" primitive shared by those threads/API calls. This was implemented based on the specification at https://www.khronos.org/registry/egl/extensions/KHR/EGL_KHR_reusable_sync.txt v2 - use thread functions defined in C11/threads.h instead of using direct pthread calls - make the timeout set with reference to CLOCK_MONOTONIC - cleaned up the way expiration time is calculated - (bug fix) in dri2_client_wait_sync, case EGL_SYNC_CL_EVENT_KHR has been added. - (bug fix) in dri2_destroy_sync, return from cond_broadcast call is now stored in 'err' intead of 'ret' to prevent 'ret' from being reset to 'EGL_FALSE' even in successful case - corrected minor syntax problems v3 - dri2_egl_unref_sync now became 'void' type. No more error check is needed for this function call as a result. - (bug fix) resolved issue with duplicated unlocking of display in eglClientWaitSync when type of sync is "EGL_KHR_REUSABLE_SYNC" Signed-off-by: Dongwon Kim <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* egl: Add EGL_RECORDABLE_ANDROID attributeRob Herring2016-04-014-0/+9
| | | | | | | | | | This is used by Android to select an eglconfig compatible with screen recording. Cc: [email protected] Signed-off-by: Rob Herring <[email protected]> [Emil Velikov: add the _eglIsConfigAttribValid check] Signed-off-by: Emil Velikov <[email protected]>
* egl: Add EGL_FRAMEBUFFER_TARGET_ANDROID attributeRob Herring2016-04-014-1/+10
| | | | | | | | | 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: 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 <[email protected]> Cc: "11.0 11.1" <[email protected] Reviewed-by: Emil Velikov <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
* 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" <[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: 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 <[email protected]> Cc: Chad Versace <[email protected]> Cc: "10.6 11.0" <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91044 Signed-off-by: Matthew Waters <[email protected]> Signed-off-by: Emil Velikov <[email protected]>
* 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 <[email protected]> Reviewed-by: Matt Turner <[email protected]> [Emil Velikov: Add newline before the spec quote (Matt)] Reviewed-by: Emil Velikov <[email protected]>
* 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 <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* 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: <[email protected]> Signed-off-by: Frank Binns <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* 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 <[email protected]>
* egl: implement EGL_KHR_gl_colorspace (v2)Marek Olšák2015-07-223-1/+27
| | | | | | v2: add missing "break" Reviewed-by: Emil Velikov <[email protected]>
* egl: remove old makefile.sourcesEmil Velikov2015-07-221-29/+0
| | | | | Signed-off-by: Emil Velikov <[email protected]> Acked-by: Matt Turner <[email protected]>
* 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 <[email protected]> Cc: Eric Anholt <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Acked-by: Matt Turner <[email protected]> Tested-by: Varad Gautam <[email protected]>
* 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 <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Acked-by: Matt Turner <[email protected]>
* 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 <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* egl: automake: remove unused HAVE_XCB_DRI2 defineEmil Velikov2015-07-221-1/+0
| | | | | Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* egl: remove unused _EGL_DRIVER_SEARCH_DIR defineEmil Velikov2015-07-223-8/+2
| | | | | Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* egl: remove final Windows specific workaroundEmil Velikov2015-07-224-10/+2
| | | | | Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* 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 <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* egl: remove _EGL_PLATFORM_WINDOWS enumEmil Velikov2015-07-222-2/+0
| | | | | Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* egl: remove final references of platform_nullEmil Velikov2015-07-223-6/+0
| | | | | Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* 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 <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Acked-by: Matt Turner <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* 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 <[email protected]> Cc: Eric Anholt <[email protected]> Signed-off-by: Emil Velikov <[email protected]>
* 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 <[email protected]> Signed-off-by: Zach Reizner <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* 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 <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* 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 <[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]>