summaryrefslogtreecommitdiffstats
path: root/src/egl
Commit message (Collapse)AuthorAgeFilesLines
* egl: initialise dummy_thread via _eglInitThreadInfoEmil Velikov2017-04-291-9/+4
| | | | | | | | | | | Considering we cannot make dummy_thread a constant we might as well, initialise by the same function that handles the actual thread info. This way we don't need to worry about mismatch between the initialiser and initialising function. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl: polish dri2_to_egl_attribute_map[]Emil Velikov2017-04-291-50/+18
| | | | | | | | Annotate the array as static const and use C99 initialiser to populate it. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* egl: add gitignoreElie TOURNIER2017-04-221-0/+2
| | | | | | | | | Since commit ce562f9e3fa, two new files are generated. We don't want to track them. Signed-off-by: Elie Tournier <[email protected]> Reviewed-by: Plamena Manolova <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* Revert "android: fix segfault within swap_buffers"Tapani Pälli2017-04-211-8/+0
| | | | | | | | | This reverts commit 4d4558411db166d2d66f8cec9cb581149dbe1597. This was a wrong call, while it fixed issue with 3DMark it actually introduced regression elsewhere. Signed-off-by: Tapani Pälli <[email protected]>
* EGL: Implement the libglvnd interface for EGL (v3)Kyle Brenneman2017-04-1713-26/+3491
| | | | | | | | | | | | | | | | | | | | | | | | 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]>
* Android: drop Android 4.4 (KitKat) supportRob Herring2017-03-221-4/+0
| | | | | | | | | | | Any users of KitKat are likely using an older version of Mesa and KitKat support adds complexity to the make files. Dropping support allows removing the MESA_LOLLIPOP_BUILD make variable in various make files. Signed-off-by: Rob Herring <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* Android: kill off {MESA_}ANDROID_VERSION defines aka Android 4.1 and olderRob Herring2017-03-223-28/+3
| | | | | | | | | The Android version defines are only needed for versions less than 4.2 which aren't really supported or tested. Signed-off-by: Rob Herring <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* Android: clean-up trailing '\' in make variablesRob Herring2017-03-221-2/+2
| | | | | | | | | Fixed with the following command: perl -pe 'BEGIN{undef $/;} s/ \\\n\n/\n\n/smg' $(find . -name 'Android.*') Signed-off-by: Rob Herring <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl/dri2: consistently use ifndef guards over pragma onceEmil Velikov2017-03-221-1/+4
| | | | | | | Signed-off-by: Emil Velikov <[email protected]> Acked-by: Vedran Miletić <[email protected]> Acked-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
* android: fix segfault within swap_buffersTapani Pälli2017-03-171-0/+8
| | | | | | | | | | | | | | | | | | | | Function droid_swap_buffers may get called without dri2_surf->buffer set, in these cases we don't have a back buffer set either. Patch fixes segfault seen with 3DMark that uses android.opengl.GLSurfaceView for rendering it's UI. backtrace: #00 pc 00013f88 /system/lib/egl/libGLES_mesa.so (droid_swap_buffers+104) #01 pc 000117b2 /system/lib/egl/libGLES_mesa.so (dri2_swap_buffers+50) #02 pc 000058b2 /system/lib/egl/libGLES_mesa.so (eglSwapBuffers+386) #03 pc 00011329 /system/lib/libEGL.so (eglSwapBuffersWithDamageKHR+553) #04 pc 000118e7 /system/lib/libEGL.so (eglSwapBuffers+55) #05 pc 000754dc /system/lib/libandroid_runtime.so v2: do like other backends, call get_back_bo (Emil Velikov) Fixes: 2acc69d ("EGL/Android: Add EGL_EXT_buffer_age extension") Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: Implement __DRI_BACKGROUND_CALLABLEEric Anholt2017-03-165-1/+22
| | | | | | | | | v2: (Timothy Arceri) use C99 initializers. Acked-by: Timothy Arceri <[email protected]> Acked-by: Marek Olšák <[email protected]> Tested-by: Dieter Nützel <[email protected]> Tested-by: Mike Lothian <[email protected]>
* egl/drm: Use modifiers for backbuffer creationBen Widawsky2017-03-151-4/+15
| | | | | | | | | Split into a separate patch from the previous patch as requested by Emil. Requested-by: Emil Velikov <[email protected]> Signed-off-by: Ben Widawsky <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* wayland: move .gitignore where applicableEmil Velikov2017-03-131-0/+0
| | | | | | | | Strictly speaking things work as-is, but let's move the file alongside the artefacts it references. Analogous to all other places in mesa. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* wayland-egl/wayland-egl-symbols-check: do not mandate bashEmil Velikov2017-03-101-1/+1
| | | | | | Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Andreas Boll <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl/egl-symbols-check: do not mandate bashEmil Velikov2017-03-101-1/+1
| | | | | | | | There's nothing bash specific in the script. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Andreas Boll <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* EGL/Android: Add EGL_EXT_buffer_age extensionXiaosong Wei2017-03-042-1/+59
| | | | | | | | This patch implements the EGL_EXT_buffer_age extension for Android. https://www.khronos.org/registry/EGL/extensions/EXT/EGL_EXT_buffer_age.txt Reviewed-by: Tapani Pälli <[email protected]> Acked-by: Emil Velikov <[email protected]>
* egl/wayland: Don't use DRM format codes for SHMDaniel Stone2017-03-011-6/+15
| | | | | | | | | | | | | | | | | | The wl_drm interface (akin to X11's DRI2) uses the standard set of DRM FourCC format codes. wl_shm copies this, except for ARGB8888/XRGB8888, which use their own definitions. Make sure we only use wl_shm format codes when we're working with wl_shm. Otherwise, using swrast with 32bpp formats would fail with an error. Cc: [email protected] Signed-off-by: Daniel Stone <[email protected]> (v1) Fixes: cb5e799448 ("egl/wayland: unify dri2_wl_create_surface implementations") v2: [Emil Velikov: move to dri2_wl_create_window_surface] Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Daniel Stone <[email protected]> (IRC)
* egl: Ensure ResetNotificationStrategy matches for shared contexts.Kenneth Graunke2017-03-011-0/+14
| | | | | | | | | | Fixes: dEQP-EGL.functional.robustness.negative_context.invalid_robust_shared_context_creation Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Cc: [email protected]
* egl/dri3: implement query surface hookBrendan King2017-02-281-0/+20
| | | | | | | | | | | | | | This is a DRI3 version of a change made for DRI2 (4d6d4f939e0af4252e0b, "egl/dri2: implement query surface hook"), that fixed failures in dEQP-EGL.functional.resize.surface_size.grow and dEQP-EGL.functional.resize.surface_size.shrink. Cc: Tapani Pälli <[email protected]> Cc: Mark Janes <[email protected]> Cc: Chad Versace <[email protected]> Signed-off-by: Brendan King <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Cc: "17.0" <[email protected]>
* check: add support for running test as standaloneEric Engestrom2017-02-261-0/+5
| | | | Signed-off-by: Eric Engestrom <[email protected]>
* check: make any failure fatalEric Engestrom2017-02-261-0/+1
| | | | | | | Previously, only the last error code was returned. Using `set -e` makes the script quit on any unhandled error. Signed-off-by: Eric Engestrom <[email protected]>
* check: mark two tests are requiring bashEric Engestrom2017-02-261-1/+1
| | | | | | | Requirement was removed just before pushing, but it's actually needed for heredocs (`<<<`). Signed-off-by: Eric Engestrom <[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]>
* egl: make sure entrypoints list is always sortedEric Engestrom2017-02-242-1/+7
| | | | | | | | Starting with the next commit, badly sorting this list will break the eglGetProcAddress(). Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: distribute all testsEric Engestrom2017-02-241-1/+1
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* eglapi: move entrypoints list out to its own fileEric Engestrom2017-02-243-77/+79
| | | | | | | | 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: _eglFilterArray's filter is always non-nullEmil Velikov2017-02-161-18/+9
| | | | | | | Drop the extra handling and assert() if things change in the future. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl: remove duplicate 0 assignmentEric Engestrom2017-02-151-3/+0
| | | | | | | The memset on the line before already takes care of this. Reviewed-by: Tapani Pälli <[email protected]> Signed-off-by: Eric Engestrom <[email protected]>
* android: fix droid_create_image_from_prime_fd_yuv for YV12Tapani Pälli2017-02-031-1/+1
| | | | | | | | | | | | | | | | Earlier changes introduced is_ycrcb flag which checks the component order of u and v components. Condition for setting the flag was incorrect, with ycrcb we are supposed to have cr before cb. This patch (together with a fix in our gralloc) fixes corrupted rendering from 'test-opengl-gl2_yuvtex' native test and corrupted gallery thumbnail in application switcher on Android-IA. Fixes: 51727b1cf57e8c4630767eb9ead207b102ffa489 Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Plamena Manolova <[email protected]> Reviewed-by: Marta Lofstedt <[email protected]> Reviewed-by: Tomasz Figa <[email protected]>
* Add missing copyright header to wayland-egl-priv.hMicah Fedke2017-02-011-0/+27
| | | | | Reviewed-by: Daniel Stone <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: automake: include builddir prior to srcdirEmil Velikov2017-01-271-1/+1
| | | | | | | Analogous to previous commit. Cc: "12.0 13.0" <[email protected]> Signed-off-by: Emil Velikov <[email protected]>
* dri: allow 16bit R/GR images to be exported via drm buffersRainer Hochecker2017-01-231-0/+10
| | | | | | | This allows eglCreateImageKHR to access P010 surfaces created by vaapi Signed-off-by: Rainer Hochecker <[email protected]> Acked-by: Ben Widawky <[email protected]>
* egl/wayland: resolve quirky try_damage_buffer() implementationEmil Velikov2017-01-181-10/+0
| | | | | | | | | | | | | | | | | | | The implementation was added with commit d085a5dff5b and effectively provided a hidden dependency. Namely: the codepath used was determined solely during build time. Thus if we built again new wayland and then run against older (yet still within the requirements, as per the configure) one will get undefined symbols. As of earlier commit 36b9976e1f9 "egl/wayland: Avoid race conditions when on non-main thread" the required version was bumped to one which provides the API, thus we can drop the quirky solution. Cc: Derek Foreman <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Daniel Stone <[email protected]> Reviewed-by: Derek Foreman <[email protected]>
* configure: remove HAVE_EGL_DRIVER_DRI[23]Emil Velikov2017-01-181-2/+0
| | | | | | | | | | We have them for local purposes in configure, where we can use their direct dependency. With the only remaining instance in the makefile(s) being always true, as it can be seen in the configure snippet. Signed-off-by: Emil Velikov <[email protected]>
* egl/wayland: unify dri2_wl_create_surface implementationsEmil Velikov2017-01-181-93/+21
| | | | | | | | | | | Rather than having two almost identical codepaths (one for HW/wl_drm and another for SW/wl_shm), just factorise and reuse in both places. v2: Rebase v3: Rebase Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Daniel Stone <[email protected]> (v2)
* egl/wayland: use the destroy_window_callback for swrastEmil Velikov2017-01-181-0/+2
| | | | | | | | | | | | | As described in commit 690ead4a135 ("egl/wayland-egl: Fix for segfault in dri2_wl_destroy_surface.") if we attempt to destroy a EGL surface attached to already destroyed Wayland window we'll get a segfault. v2: set the correct callback alongside the window->private. (Dan) Cc: Daniel Stone <[email protected]> Cc: "12.0 13.0" <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Daniel Stone <[email protected]>
* egl/dri2: Unify the style of function pointer calls in structsBoyan Ding2017-01-136-35/+34
| | | | | | | Signed-off-by: Boyan Ding <[email protected]> Acked-by: Alex Deucher <[email protected]> [Emil Velikov: address platform_surfaceless] Signed-off-by: Emil Velikov <[email protected]>
* gbm/drm: Pick the oldest available buffer in get_back_boDerek Foreman2017-01-131-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Applications may query the back buffer age to efficiently perform partial updates. Generally the application will keep a fixed length damage history, and use this to calculate what needs to be redrawn based on the age of the back buffer it's about to render to. If presented with a buffer that has an age greater than the length of the damage history, the application will likely have to completely repaint the buffer. Our current buffer selection strategy is to pick the first available buffer without considering its age. If an application frequently manages to fit within two buffers but occasionally requires a third, this extra buffer will almost always be old enough to fall outside of a reasonably long damage history, and require a full repaint. This patch changes the buffer selection behaviour to prefer the oldest available buffer. By selecting the oldest available buffer, the application will likely always be able to use its damage history, at a cost of having to perform slightly more work every frame. This is an improvement if the cost of a full repaint is heavy, and the surface damage between frames is relatively small. It should be noted that since we don't currently trim our queue in any way, an application that briefly needs a large number of buffers will continue to receive older buffers than it would if it only ever needed two buffers. Reviewed-by: Daniel Stone <[email protected]> Signed-off-by: Derek Foreman <[email protected]> Reviewed-by: Pekka Paalanen <[email protected]>
* egl/wayland: Avoid race conditions when on non-main threadJonas Ådahl2017-01-133-14/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | When EGL is used on some other thread than the thread that drives the main wl_display queue, the Wayland EGL dri2 implementation is vulnerable to a race condition related to display round trips and global object advertisements. The race that may happen is that after after a proxy is created, but before the queue is set, events meant to be emitted via the yet to be set queue may already have been queued on the wrong queue. In order to make it possible to avoid this race, wayland 1.11 introduced new API that allows creating a proxy wrapper that may be used as the factory proxy when creating new proxies via Wayland requests. The queue of a proxy wrapper can be changed without effecting what queue events emitted by the actual proxy will be queued on, while still effecting what default queue proxies created from it will have. By introducing a wl_display proxy wrapper and using this when performing round trips (via wl_display_sync()) and retrieving the global objects (via wl_display_get_registry()), the mentioned race condition is avoided. Signed-off-by: Jonas Ådahl <[email protected]> Cc: [email protected] Reviewed-by: Daniel Stone <[email protected]>
* egl/wayland: Cleanup private display connection when init failsJonas Ådahl2017-01-131-0/+4
| | | | | | | | | | When failing to initializing the Wayland EGL driver, don't leak the display server connection if it was us who created it. Signed-off-by: Jonas Ådahl <[email protected]> Cc: [email protected] Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Daniel Stone <[email protected]>
* egl/dri2: add image_loader_extension back into loader extensions for waylandDerek Foreman2017-01-111-0/+1
| | | | | | | | | | | | | before commit f871946594129500a67c05a6d9fe99db54b4bb64 image_loader_extension was always present in dri2_dpy->extensions, after that commit it is only present for render nodes. Its removal broke partial render based on buffer age on (at least) raspberry pi. Fixes: f8719465941 "egl/dri2: rework dri2_egl_display::extensions storage" Signed-off-by: Derek Foreman <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: Emit correct error when robust context creation failsChad Versace2016-12-271-12/+26
| | | | | | | | | | | | | | | | | Fixes dEQP-EGL.functional.create_context_ext.robust_* on Intel with GBM. If the user sets the EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR in EGL_CONTEXT_FLAGS_KHR when creating an OpenGL ES context, then EGL_KHR_create_context spec requires that we unconditionally emit EGL_BAD_ATTRIBUTE because that flag does not exist for OpenGL ES. When creating an OpenGL context, the spec requires that we emit EGL_BAD_MATCH if we can't support the request; that error is generated in the egl_dri2 layer where the driver capability is actually checked. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99188 Cc: [email protected] Reviewed-by: Tapani Pälli <[email protected]>
* egl/dri2: implement query surface hookTapani Pälli2016-12-271-0/+36
| | | | | | | | | | | | | | | | This makes better guarantee that the values we return are in sync what the underlying drawable currently has. Together with dEQP change in bug #98327 this fixes following test: dEQP-EGL.functional.resize.surface_size.grow v2: avoid unnecessary x11 roundtrips (Chad Versace) Signed-off-by: Tapani Pälli <[email protected]> Tested-by: Mark Janes <[email protected]> Reviewed-by: Chad Versace <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98327
* 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/android: Enhance pbuffer implementationLiu Zhiquan2016-12-191-81/+96
| | | | | | | | | | | | | | | Some dri drivers will pass multiple bits in buffer_mask parameter to droid_image_get_buffer(), more than the actual supported buffer type combination. For such case, will go through all the bits, and will not return error when unsupported buffer is requested, only return error when the allocation for supported buffer failed. v2: coding style and log changes v3: coding style changes and update patch format Signed-off-by: Liu Zhiquan <[email protected]> Signed-off-by: Long, Zhifang <[email protected]> Reviewed-by: Tomasz Figa <[email protected]>