summaryrefslogtreecommitdiffstats
path: root/src/egl/main/eglapi.c
Commit message (Collapse)AuthorAgeFilesLines
* egl/android: Provide an option for the backend to expose KHR_imageHarish Krupo2017-12-141-1/+2
| | | | | | | | | | | | | | | | | From android cts 8.0_r4, a new test case checks if all the required egl extensions are exposed. In the current implementation we expose KHR_image if KHR_image_base and KHR_image_pixmap are supported but KHR_image spec does not mandate the existence of both the extensions. This patch preserves the current check and also provides the backend with an option to expose the KHR_image extension. Test: run cts -m CtsOpenGLTestCases -t \ android.opengl.cts.OpenGlEsVersionTest#testRequiredEglExtensions Signed-off-by: Harish Krupo <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: Convert int to attrib in eglGetPlatformDisplayAdam Jackson2017-11-171-14/+13
| | | | | | | | ... because converting attrib to int truncates, and that's bad. Signed-off-by: Adam Jackson <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: EXT_pixel_format_float plumbingTapani Pälli2017-11-131-0/+1
| | | | | | | | | | | | | | | Patch adds support and capability to match with new surface attribute, component type. Currently no configs with floating point type are exposed. With this change, following dEQP test starts to pass: dEQP-EGL.functional.choose_config.color_component_type_ext.dont_care dEQP-EGL.functional.choose_config.color_component_type_ext.fixed dEQP-EGL.functional.choose_config.color_component_type_ext.float Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Adam Jackson <[email protected]>
* egl: Implement EGL_KHR_context_flush_controlAdam Jackson2017-11-061-0/+1
| | | | | | Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Signed-off-by: Adam Jackson <[email protected]>
* egl: Support IMG_context_priorityChris Wilson2017-10-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IMG_context_priority https://www.khronos.org/registry/egl/extensions/IMG/EGL_IMG_context_priority.txt "This extension allows an EGLContext to be created with a priority hint. It is possible that an implementation will not honour the hint, especially if there are constraints on the number of high priority contexts available in the system, or system policy limits access to high priority contexts to appropriate system privilege level. A query is provided to find the real priority level assigned to the context after creation." The extension adds a new eglCreateContext attribute for choosing a priority hint. This stub parses the attribute and copies into the base struct _egl_context, and hooks up the query similarly. Since the attribute is purely a hint, I have no qualms about the lack of implementation before reporting back the value the user gave! v2: Remember to set the default ContextPriority value to medium. v3: Use the driRendererQuery interface to probe the backend for supported priority values and use those to mask the EGL interface. v4: Treat the priority attrib as a hint and gracefully mask any requests not supported by the driver, the EGLContext will remain at medium priority. Signed-off-by: Chris Wilson <[email protected]> Cc: Rob Clark <[email protected]> Reviewed-by: Ben Widawsky <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* Revert "egl: drop EGL driver `name`"Marek Olšák2017-10-181-1/+2
| | | | | | This reverts commit 6414d6bd8d2897f4ba643357fe3037f3acd60879. This is needed to apply the next revert.
* egl: drop EGL driver `name`Eric Engestrom2017-10-181-2/+1
| | | | | | | | | | | | | | The "DRI2" name was reported as confusing when printing EGL infos (one user reported thinking DRI3 was not working on his X server), and the only alternative is Haiku, which can only be used on a Haiku machine. The name therefore doesn't add any information that the user wouldn't know already, so let's just drop it. Cc: Kai Wasserbäch <[email protected]> Suggested-by: Emil Velikov <[email protected]> Related-to: b174a1ae720cb404738c ("egl: Simplify the "driver" interface") Signed-off-by: Eric Engestrom <[email protected]>
* egl: drop always-false TestOnly optionEric Engestrom2017-10-181-1/+1
| | | | Signed-off-by: Eric Engestrom <[email protected]>
* egl: use switch statements over if/else chainEmil Velikov2017-09-191-31/+28
| | | | | | | Shorter, explicit and consistent with the rest of the co debase. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl: simplify _eglDebugReport* APIEmil Velikov2017-09-191-2/+1
| | | | | | | | | | | | | | Instead of having three, almost identical but not quite, _eglDebugReport* functions, simply fold them into one. While doing so drop the unnecessary arguments 'command' and 'objectLabel'. Former is identical to funcName, while the latter is already stored (yet unused) in _EGLThreadInfo::CurrentObjectLabel. Cc: Kyle Brenneman <[email protected]> Cc: Adam Jackson <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> (IRC)
* egl: Fix inclusion of egl.h+mesa_glinterop.hMatt Turner2017-08-211-1/+1
| | | | | | | | Previously clang would warn about redefinition of typedef EGLDisplay. Avoid this by adding preprocessor guards to mesa_glinterop.h and including it after EGL.h is indirectly included. Reviewed-by: Jordan Justen <[email protected]>
* egl: avoid eglCreatePlatform*Surface{EXT,} crash with invalid dpyEmil Velikov2017-08-101-2/+2
| | | | | | | | | | | | | | | | | | If we have an invalid display fed into the functions, the display lookup will return NULL. Thus as we attempt to get the platform type, we'll deref. it leading to a crash. Keep in mind that this will not happen if Mesa is built without X11 or when the legacy eglCreate*Surface codepaths are used. A similar check was added with earlier commit 5e97b8f5ce9 ("egl: Fix crashes in eglCreate*Surface), although it was only applicable when the surfaceless platform is built. Cc: [email protected] Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* egl: handle BAD_NATIVE_PIXMAP further up the stackEmil Velikov2017-08-101-0/+3
| | | | | | | | | | | | The basic (null) check is identical across all backends. Just move it to the top. v2: - Split the WINDOW vs PIXMAP into separate patches - Move check after the dpy and config - dEQP expects so Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl: whitespace cleanup in eglapi.cEric Engestrom2017-08-091-25/+25
| | | | Signed-off-by: Eric Engestrom <[email protected]>
* egl: check the correct function pointerEric Engestrom2017-08-021-1/+1
| | | | | | | | | | `.swap_interval` != `.SwapInterval`... Fixes: 991ec1b81a76de24fd01 "egl: make platform's SwapInterval() optional" Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102015 Cc: Cedric Sodhi <[email protected]> Signed-off-by: Eric Engestrom <[email protected]> Tested-by: Cedric Sodhi <[email protected]>
* egl: make platform's SwapInterval() optionalEric Engestrom2017-08-011-1/+1
| | | | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Daniel Stone <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* egl: deduplicate swap interval clamping logicEric Engestrom2017-08-011-1/+11
| | | | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Daniel Stone <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* egl: Add EGL_KHR_create_context_no_error supportGrigori Goronzy2017-07-141-0/+1
| | | | | | | | This only adds the EGL side, needs to be plumbed into Mesa frontend. v2: Add check for extension availability. Reviewed-by: Marek Olšák <[email protected]>
* egl/android: support for EGL_KHR_partial_updateHarish Krupo2017-06-111-0/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for the EGL_KHR_partial_update extension for android platform. It passes 36/37 tests in dEQP for EGL_KHR_partial_update. 1 test not supported. v2: add fallback for eglSetDamageRegionKHR (Tapani) v3: The native_window_set_surface_damage call is available only from Android version 6.0. Reintroduce the ANDROID_VERSION guard and advertise extension only if version is >= 6.0. (Emil Velikov) v4: use newly introduced ANDROID_API_LEVEL guard rather than ANDROID_VERSION guard to advertise the extension.The extension is advertised only if ANDROID_API_LEVEL >= 23 (Android 6.0 or greater). Add fallback function for platforms other than Android. Fix possible math overflow. (Emil Velikov) Return immediately when n_rects is 0. Place function's entrypoint in alphabetical order. (Eric Engestrom) v5: Replace unnecessary calloc with malloc (Eric) Check for BAD_ALLOC error (Emil) Check for error in native_window_set_damage_region. (Emil, Tapani, Eric). Signed-off-by: Harish Krupo <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* egl: advertise EGL_EXT_image_dma_buf_import_modifiersVarad Gautam2017-05-301-0/+1
| | | | | | | | | v2: check for DRIimageExtension version 15 (Jason Ekstrand) Signed-off-by: Varad Gautam <[email protected]> Reviewed-by: Daniel Stone <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl: implement eglQueryDmaBufModifiersEXTVarad Gautam2017-05-301-0/+20
| | | | | | | | | | | | | | | | | | | query and return supported dmabuf format modifiers for EGL_EXT_image_dma_buf_import_modifiers. v2: move format check to the driver instead of making format queries here and then checking. v3: Check DRIimageExtension version before query (Daniel Stone) v4: - move to DRIimageExtension version 15, check queryDmaBufModifiers before calling (Jason Ekstrand) - pass external_only to the driver instead of setting as EGL_TRUE here (Emil Velikov, Daniel Stone) Signed-off-by: Varad Gautam <[email protected]> Reviewed-by: Daniel Stone <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl: implement eglQueryDmaBufFormatsEXTVarad Gautam2017-05-301-0/+18
| | | | | | | | | | | | | | allow egl clients to query the dmabuf formats supported on this platform. v2: return EGLBoolean. v3: Check DRIimageExtension version before querying (Daniel Stone). v4: move to DRIimageExtension version 15, error checking (Jason Ekstrand). Signed-off-by: Louis-Francis Ratté-Boulianne <[email protected]> Signed-off-by: Varad Gautam <[email protected]> Reviewed-by: Daniel Stone <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl: error out on eglCreateWaylandBufferFromImageWLEmil Velikov2017-05-291-1/+2
| | | | | | | | | | | | | Currently f one does the silly thing by probing the entry point w/o checking the extension they will attempt to use the extension even though it cannot work. That is due our of of an assert which gets removed in release builds. Simply error out if the extension is not enabled. Thus we can apply some cleanups with next commits. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl: Partially revert 23c86c74, fix eglMakeCurrentChad Versace2017-05-181-19/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes regressions in Android CtsVerifier.apk on Intel Chrome OS devices due to incorrect error handling in eglMakeCurrent. See below on how to confirm the regression is fixed. This partially reverts commit 23c86c74cc450a23848b85cfe914376caede1cdf Author: Chad Versace <[email protected]> Subject: egl: Emit error when EGLSurface is lost The problem with commit 23c86c74 is that, once an EGLSurface became lost, the app could never unbind the bad surface. Each attempt to unbind the bad surface with eglMakeCurrent failed with EGL_BAD_CURRENT_SURFACE. Specificaly, the bad commit added the error handling below. #2 and #3 were right, but #1 was wrong. 1. eglMakeCurrent emits EGL_BAD_CURRENT_SURFACE if the calling thread has unflushed commands and either previous surface is no longer valid. 2. eglMakeCurrent emits EGL_BAD_NATIVE_WINDOW if either new surface is no longer valid. 3. eglSwapBuffers emits EGL_BAD_NATIVE_WINDOW if the swapped surface is no longer valid. Whe I wrote the bad commit, I misunderstood the EGL spec language for #1. The correct behavior is, if I understand correctly now, is below. This patch doesn't implement the correct behavior, though, it just reverts the broken behavior. - Assume a bound EGLSurface is no longer valid. - Assume the bound EGLContext has unflushed commands. - The app calls eglMakeCurrent. The spec requires eglMakeCurrent to implicitly flush. After flushing, eglMakeCurrent emits EGL_BAD_CURRENT_SURFACE and does *not* alter the thread's current bindings. - If the app calls eglMakeCurrent again, and the app inserts no commands into the GL command stream between the two eglMakeCurrent calls, then this second eglMakeCurrent succeeds without emitting an error. How to confirm this fixes the regression: Download android-cts-verifier-7.1_r5-linux_x86-x86.zip from source.android.com, unpack, and `adb install CtsVerifier.apk`. Run test "Projection Cube". Click the Pass button (a green checkmark). Then run test "Projection Widget". Confirm that widgets are visible and that logcat does not complain about eglMakeCurrent failure. Then confirm there are no regressions in the cts-traded module that commit 263243b1 fixed: cts-tf > run cts --skip-preconditions --skip-device-info \ -m CtsCameraTestCases \ -t android.hardware.camera2.cts.RobustnessTest Tested with Chrome OS board "reef". Fixes: 23c86c74 (egl: Emit error when EGLSurface is lost) Acked-by: Tapani Pälli <[email protected]> Cc: "17.1" <[email protected]> Cc: Tomasz Figa <[email protected]> Cc: Nicolas Boichat <[email protected]> Cc: Emil Velikov <[email protected]>
* egl: remove suprous header eglcompiler.hEmil Velikov2017-05-081-1/+1
| | | | | | | | | The header is used only to provide STATIC_ASSERT. The latter is already available in utils/macros.h so use that instead and kill of the header. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* egl: Emit error when EGLSurface is lostChad Versace2017-05-041-0/+36
| | | | | | | | | | | | | | | | | | | | | | Add a new bool, _EGLSurface::Lost, and check it in eglMakeCurrent and eglSwapBuffers. The EGL 1.5 spec says that those functions emit errors when the native surface is no longer valid. This patch just updates core EGL. No driver sets _EGLSurface::Lost yet. I discovered that Mesa failed to detect lost surfaces while debugging an Android CTS camera test, android.hardware.camera2.cts.RobustnessTest#testAbandonRepeatingRequestSurface. This patch doesn't fix the test though, though, because the test expects EGL_BAD_SURFACE when the surface becomes lost, and this patch actually complies with the EGL spec. If I interpreted the EGL spec correctly, EGL_BAD_NATIVE_WINDOW or EGL_BAD_CURRENT_SURFACE is the correct error. Cc: [email protected] Cc: Tomasz Figa <[email protected]> Cc: Tapani Pälli <[email protected]> Reviewed-by: Nicolas Boichat <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* EGL: Implement the libglvnd interface for EGL (v3)Kyle Brenneman2017-04-171-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | The new interface mostly just sits on top of the existing library. The only change to the existing EGL code is to split the client extension string into platform extensions and everything else. On non-glvnd builds, eglQueryString will just concatenate the two strings. The EGL dispatch stubs are all generated. The script is based on the one used to generate entrypoints in libglvnd itself. v2: [Kyle] - Rebased against master. - Reworked the EGL makefile to use separate libraries - Made the EGL code generation scripts work with Python 2 and 3. - Change gen_egl_dispatch.py to use argparse for the command line arguments. - Assorted formatting and style cleanup in the Python scripts. v3: [Emil Velikov] - Rebase - Remove separate glvnd glx/egl configure toggles Signed-off-by: Emil Velikov <[email protected]>
* eglapi: replace linear entrypoint search with binary searchEric Engestrom2017-02-241-13/+24
| | | | | | | Tested with dEQP-EGL.functional.get_proc_address.* Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* eglapi: move entrypoints list out to its own fileEric Engestrom2017-02-241-77/+1
| | | | | | | | This will allow us to make sure the list is always sorted in the next commit. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* eglapi: sort entrypoints listEric Engestrom2017-02-241-37/+37
| | | | | | | | Let's make that comment true. If will also be necessary in a couple commits (using bsearch). Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* eglapi: use macro to map entrypoints to functionsEric Engestrom2017-02-241-74/+75
| | | | | | | As of the last 3 commits, there's a function for each entrypoint. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* eglapi: add entrypoint for eglClientWaitSyncKHREric Engestrom2017-02-241-7/+24
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* eglapi: add entrypoint for eglDestroySyncKHREric Engestrom2017-02-241-7/+21
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* eglapi: add entrypoint for eglDestroyImageKHREric Engestrom2017-02-241-7/+21
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: Check config's surface types in eglCreate*Surface()Chad Versace2016-12-201-0/+10
| | | | | | | | | | | If the provided EGLConfig does not support the requested surface type, then emit EGL_BAD_MATCH. Fixes dEQP-EGL.functional.negative_api.create_pbuffer_surface on GBM. Cc: "13.0" <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* egl: Fix crashes in eglCreate*Surface()Chad Versace2016-12-141-2/+2
| | | | | | | | | | | | | Don't dereference a null EGLDisplay. Fixes tests dEQP-EGL.functional.negative_api.create_pbuffer_surface dEQP-EGL.functional.negative_api.create_pixmap_surface Reviewed-by: Mark Janes <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=99038 Cc: "13.0" <[email protected]>
* egl: add and enable EGL_KHR_config_attribsEmil Velikov2016-12-091-0/+6
| | | | | | | Extension is already implemented in the main code. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl: unexport _eglConvertIntsToAttribsEric Engestrom2016-12-091-1/+1
| | | | | | | | Nobody else makes use of this function. We can always re-export it if someone ever needs it. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: rename static functions to match conventionEric Engestrom2016-12-091-9/+9
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: add EGL_ANDROID_native_fence_syncRob Clark2016-12-011-4/+37
| | | | | | | | | | With fixes from Chad squashed in, plus fixes for issues that Rafael found while writing piglit tests. Signed-off-by: Rob Clark <[email protected]> Tested-by: Rafael Antognolli <[email protected]> Reviewed-by: Chad Versace <[email protected]> Tested-by: Chad Versace <[email protected]>
* egl: fix helper function nameEric Engestrom2016-11-171-4/+4
| | | | | | | | | I introduced this code last month, but didn't follow the naming convention. Fix this. Fixes: 0a606a400fe382a9bc72 ("egl: add eglSwapBuffersWithDamageKHR") Reviewed-by: Tapani Pälli <[email protected]> Signed-off-by: Eric Engestrom <[email protected]>
* egl: make interop ABI visible againMarek Olšák2016-11-041-2/+2
| | | | | | | | | This was broken when the GLAPI use was removed from mesa_glinterop.h. Cc: 12.0 13.0 <[email protected]> Acked-by: Alex Deucher <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: fix error handling in _eglCreateSyncTapani Pälli2016-10-271-2/+9
| | | | | | | | | | | | EGL specification requires context to be current only when sync type matches EGL_SYNC_FENCE_KHR. Fixes 25 failing dEQP tests: dEQP-EGL.functional.reusable_sync.* Signed-off-by: Tapani Pälli <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98339 Reviewed-by: Eric Engestrom <[email protected]>
* egl: add check that eglCreateContext gets a valid configTapani Pälli2016-10-251-1/+3
| | | | | | | | | | | | | Fixes following dEQP test: dEQP-EGL.functional.negative_api.create_context v2: don't break EGL_KHR_no_config_context (Eric Engestrom) Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Cc: "12.0 13.0" <[email protected]>
* egl: Implement EGL_MESA_platform_surfacelessChad Versace2016-10-141-1/+41
| | | | Reviewed-by: Emil Velikov <[email protected]>
* egl: add eglSwapBuffersWithDamageKHREric Engestrom2016-10-111-6/+26
| | | | | | | | | | | EGL_KHR_swap_buffers_with_damage is actually already supported, as it is technically nothing but a rename of EGL_EXT_swap_buffers_with_damage. To that effect, both extension are advertised depending on the same condition, and the new entrypoint simply redirects to the previous one. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: Unify the EGLint/EGLAttrib paths in eglCreateSync* (v3)Chad Versace2016-10-101-8/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Pre-patch, there were two code paths for parsing EGLSync attribute lists: one path for old-style EGLint lists, used by eglCreateSyncKHR, and another for new-style EGLAttrib lists, used by eglCreateSync (1.5) and eglCreateSync64 (EGL_KHR_cl_event2). There were two attrib_list parsing functions, _eglParseSyncAttribList(_EGLSync *sync, const EGLint *attrib_list) _eglParseSyncAttribList64(_EGLSync *sync, const EGLattrib *attrib_list) This patch unifies the two attrib_list parsing functions into one, _eglParseSyncAttribList(_EGLSync *sync, const EGLattrib *attrib_list) Many internal EGLSync function signatures had *two* attrib_list parameters to accomodate both code paths: one parameter was an EGLint list and other an EGLAttrib list. At most one of the parameters was allowed to be non-null. This patch removes the `EGLint *attrib_list` parameter, leaving only the `EGLAttrib *attrib_list` parameter, for all internal EGLSync functions. v2: - Consistently use condition (sizeof(int_list[0]) == sizeof(attrib_list[0])). [for emil] v3: - Don't double-unlock the display in eglCreateSyncKHR. Reviewed-by: Emil Velikov <[email protected]> (v2)
* egl: Implement EGL_KHR_debug (v2)Kyle Brenneman2016-10-051-0/+145
| | | | | | | | | | | | | | | | Wire up the debug entrypoints to EGL dispatch, and add the extension string to the client extension list. v2: - Lots of style fixes - Fix missing EGLAPIENTRYs - Factor out valid attribute check - Lock display in eglLabelObjectKHR as needed, and use RETURN_EGL_* - Move "EGL_KHR_debug" into asciibetical order in client extension string Reviewed-by: Adam Jackson <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: Track EGL_KHR_debug state when going through EGL API calls (v3)Kyle Brenneman2016-10-051-9/+142
| | | | | | | | | | | | | | | | | | | | | | This decorates every EGL entrypoint with _EGL_FUNC_START, which records the function name and primary dispatch object label in the current thread state. It also adds debug report functions and calls them when appropriate. This would be useful enough for debugging on its own, if the user set a breakpoint when the report function was called. We will also need this state tracked in order to expose EGL_KHR_debug. v2: - Clear the object label in more cases in _eglSetFuncName - Pass draw surface (if any) to _EGL_FUNC_START in eglSwapInterval v3: - Set dummy thread's CurrentAPI to EGL_OPENGL_ES_API not zero - Less ?: in _eglSetFuncName Reviewed-by: Adam Jackson <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: Add _eglConvertIntsToAttribs()Chad Versace2016-10-041-0/+41
| | | | | | | This function converts an attribute list from EGLint[] to EGLAttrib[]. Will be used in following patches to cleanup EGLSync attribute parsing. Reviewed-by: Emil Velikov <[email protected]>