summaryrefslogtreecommitdiffstats
path: root/src/egl/drivers
Commit message (Collapse)AuthorAgeFilesLines
* egl: fix _eglQuerySurface in EGL_BUFFER_AGE_EXT caseTapani Pälli2017-06-143-4/+4
| | | | | | | | | | | | | | | | | | | Specification states that in case of error, value should not be written, patch changes buffer age queries to return -1 in case of error so that we can skip changing the value. In addition, small change to droid_query_buffer_age to return 0 in case buffer does not have a back buffer available. Fixes: dEQP-EGL.functional.negative_partial_update.not_postable_surface Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Chad Versace <[email protected]> Cc: [email protected] (cherry picked from commit 8fac894f9b8e4e2cb93061fdd25f3aecbfb3bbb7)
* egl/android: fix segfault within swap_buffersTapani Pälli2017-06-011-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | 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 Note, this is v1 as v2 caused dEQP regressions. Fixes: 2acc69d ("EGL/Android: Add EGL_EXT_buffer_age extension") Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Acked-by: Emil Velikov <[email protected]> Cc: "17.1" <[email protected]> (cherry picked from commit f347bac30f4045a9583f95a5776484b1a2947183) Signed-off-by: Juan A. Suarez Romero <[email protected]>
* Revert "android: fix segfault within swap_buffers"Juan A. Suarez Romero2017-06-011-8/+0
| | | | | | | | This reverts commit 4d4558411db166d2d66f8cec9cb581149dbe1597. See https://lists.freedesktop.org/archives/mesa-stable/2017-June/006408.html Signed-off-by: Juan A. Suarez Romero <[email protected]>
* egl/wayland: select the format based on the interface usedEmil Velikov2017-06-011-1/+2
| | | | | | | | | | Rather than misleadingly depending on DRI2 for the WL_DRM vs WL_SHM formats, use the wl_drm and wl_shm interface respectively. Fixes: a1727aa75ed ("egl/wayland: Don't use DRM format codes for SHM") Signed-off-by: Emil Velikov <[email protected]> (cherry picked from commit 6ef0fc400c690362b66add9c3533fae5f21d2cae) Signed-off-by: Juan A. Suarez Romero <[email protected]>
* egl/wayland: Ensure we get a back bufferDaniel Stone2017-06-011-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 9ca6711faa03 changed the Wayland winsys to only block for the frame callback inside SwapBuffers, rather than get_back_bo. get_back_bo would perform a single non-blocking Wayland event dispatch, to try to find any release events which we had pulled off the wire but not actually processed. The blocking dispatch was moved to SwapBuffers. This removed a guarantee that we would've processed all events inside get_back_bo(), and introduced a failure whereby the server could've sent a buffer release event, but we wouldn't have read it. In clients unconstrained by SwapInterval (rendering ~as fast as possible), which were being displayed directly without composition (buffer release delayed), this could lead to get_back_bo() failing because there were no free buffers available to it. The drawing rightly failed, but this was papered over because of the path in eglSwapBuffers() which attempts to guarantee a BO, in order to support calling SwapBuffers twice in a row with no rendering actually having been performed. Since eglSwapBuffers will perform a blocking dispatch of Wayland events, a buffer release would have arrived by that point, and we could then choose a buffer to post to the server. The effect was that frames were displayed out-of-order, since we grabbed a frame with random past content to display to the compositor. Ideally get_back_bo() failing should store a failure flag inside the surface and cause the next SwapBuffers to fail, but for the meantime, restore the correct behaviour such that get_back_bo() no longer fails. Signed-off-by: Daniel Stone <[email protected]> Reported-by: Eero Tamminen <[email protected]> Acked-by: Pekka Paalanen <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98833 Fixes: 9ca6711faa03 ("Revert "wayland: Block for the frame callback in get_back_bo not dri2_swap_buffers"") (cherry picked from commit 1f2d0093bf5084f65a923582881dc74153c804a4) Signed-off-by: Juan A. Suarez Romero <[email protected]>
* egl/wayland: Use per-surface event queuesDaniel Stone2017-05-312-27/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During display initialisation, we need a separate event queue to handle the registry events, which is correctly handled. But we also need separate per-surface event queues to handle swapchain-related events, such as surface frame events and buffer release events. This avoids two surfaces from the same EGLDisplay, both current on separate threads, dispatching each other's events. Create separate per-surface event queues, create wl_surface and wl_drm proxy wrapper objects per surface, so we eliminate the race around sending events to the wrong queue. swrast buffers do not need a dedicated proxy wrapper, as the wl_shm_pool used to create the wl_buffers, being transient, can itself be assigned to a queue. Signed-off-by: Daniel Stone <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Fixes: 36b9976e1f99 ("egl/wayland: Avoid race conditions when on non-main thread") Cc: [email protected] (cherry picked from commit 03dd9a88b0be17ff0ce91e92f6902a9a85ba584a) Signed-off-by: Juan A. Suarez Romero <[email protected]> Squashed with: egl/wayland: verify event queue was allocated We're already verified that 'window' wasn't NULL, I'm guessing this allocation error is about the newly created queue. CID: 1409754 Fixes: 03dd9a88b0b ("egl/wayland: Use per-surface event queues") Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Daniel Stone <[email protected]> (cherry picked from commit 30dc56bb5b313ae67c6e8648e23bb38c8e737488) Signed-off-by: Juan A. Suarez Romero <[email protected]>
* egl/wayland: Don't open-code roundtripDaniel Stone2017-05-311-25/+1
| | | | | | | | | | | | wl_display_roundtrip_queue() exists and can replace roundtrip(). The API was introduced with wayland 1.6, while we currently require 1.11. Signed-off-by: Daniel Stone <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Cc: [email protected] (cherry picked from commit 8118bc269f39ea0b965752ea89b886b28094db42) Signed-off-by: Juan A. Suarez Romero <[email protected]>
* egl/android: Set EGLSurface.Lost to EGL_TRUE/EGL_FALSENicolas Boichat2017-05-081-2/+2
| | | | | | | | | | Lost is an EGLBoolean, so we should assign it to EGL_TRUE/EGL_FALSE, not true/false. Fixes: e5eace58684 ("egl/android: Mark surface as lost when dequeueBuffer fails") Fixes: 0212db35040 ("egl/android: Cancel any outstanding ANativeBuffer in surface destructor") Reviewed-by: Chad Versace <[email protected]> (cherry picked from commit 63b12b0c77759a0244416cd1406c2bf50e7c01ec)
* egl/android: Mark surface as lost when dequeueBuffer failsChad Versace2017-05-081-0/+10
| | | | | | | | | | | | | | | | This ensures that future calls to eglSwapBuffers and eglMakeCurrent emit an error. This patch is part of a series for fixing android.hardware.camera2.cts.RobustnessTest#testAbandonRepeatingRequestSurface on Chrome OS x86 devices. 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]> (cherry picked from commit e5eace586848511f4ceaffaa2d45131c31c45ae0)
* egl/android: Cancel any outstanding ANativeBuffer in surface destructorChad Versace2017-05-081-4/+9
| | | | | | | | | | | | | | | | | | | | That is, call ANativeWindow::cancelBuffer in droid_destroy_surface(). This should prevent application deadlock when the app destroys the EGLSurface after EGL has acquired a buffer from SurfaceFlinger (ANativeWindow::dequeueBuffer) but before EGL has released it (ANativeWindow::enqueueBuffer). This patch is part of a series for fixing android.hardware.camera2.cts.RobustnessTest#testAbandonRepeatingRequestSurface on Chrome OS x86 devices. 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]> (cherry picked from commit 0212db350407e1331ff23f04136684cf2b7396cf)
* egl/platform/drm: Don't take display ownership until gbm is initializedAdam Jackson2017-05-081-1/+1
| | | | | | | | | | | If the gbm_create_device() call here actually did fail, any subsequent eglTerminate on the display would segfault. Cc: <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Signed-off-by: Adam Jackson <[email protected]> (cherry picked from commit f258815c7d4187fd83f6944943e78206a6cdc4cb)
* Android: kill off {MESA_}ANDROID_VERSION defines aka Android 4.1 and olderRob Herring2017-03-222-23/+1
| | | | | | | | | 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]>
* 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-163-0/+18
| | | | | | | | | 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]>
* 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]>
* 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]>
* 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]>
* 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/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/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]>
* egl/x11: cleanup init codeEric Engestrom2016-12-151-14/+10
| | | | | | | No functional change, just rewriting it in an easier-to-understand way. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl/surfaceless: remove duplicate KHR_image_base enablementEmil Velikov2016-12-091-2/+0
| | | | | | | | Already set by the core code - dri2_create_screen/dri2_setup_screen Cc: Chad Versace <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl: add EGL_ANDROID_native_fence_syncRob Clark2016-12-011-1/+57
| | | | | | | | | | 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/x11: store xcb_screen_t *screen instead of int screenEmil Velikov2016-11-223-66/+18
| | | | | | | | | | Just fetch and store it once, rather than doing the xcb_setup_roots_iterator + get_xcb_screen dance five times. v2: Call xcb_disconnect() on error (Eric) Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> (v1)
* egl/x11: factor out dri2_get_xcb_connection()Emil Velikov2016-11-221-36/+27
| | | | | | | | | | | | | | | | | Identical throughout dri2, dri3 and drisw. Next patch will add more common code, so rather than duplicating it factor out the function. Note: this also sets eglError on failure. Something that's quite inconsistent throughout the codebase. v2: Call xcb_disconnect() on error (Eric) Note: use xcb_disconnect() even in the xcb_connection_has_error() case as per the manual: ... memory will not be freed until xcb_disconnect... Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> (v1)
* egl/wayland: remove non-applicable destroyDrawable from error pathEmil Velikov2016-11-211-3/+1
| | | | | | | | If we fail to create the drawable there's not much point in attampting to destroy it. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl/android: Use gralloc::lock_ycbcr for resolving YUV formats (v2)Tomasz Figa2016-11-211-27/+137
| | | | | | | | | | | | | | | | | There is an interface that can be used to query YUV buffers for their internal format. Specifically, if gralloc:lock_ycbcr() is given no SW usage flags, it's supposed to return plane offsets instead of pointers. Let's use this interface to implement support for YUV formats in Android EGL backend. v2: Fixes from Emil's review: a) Added comments for parts that might be not clear, b) Changed get_fourcc_yuv() to return -1 on failure, c) Changed is_yuv() to use bool. Signed-off-by: Tomasz Figa <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* egl/android: Get gralloc module in dri2_initialize_android() (v2)Tomasz Figa2016-11-212-12/+19
| | | | | | | | | | | | | | | Currently droid_open_device() gets a reference to the gralloc module only for its own use and does not store it anywhere. To make it possible to call gralloc methods from code added in further patches, let's refactor current code to get gralloc module in dri2_initialize_android() and store it in dri2_dpy. v2: fixes from Emil's review: a) remove duplicate initialization of 'err'. Signed-off-by: Tomasz Figa <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* egl/android: Remove handling of RGB_888 pixel formatTomasz Figa2016-11-211-6/+0
| | | | | | | | | | It is currently completely broken, as it ends up using RGBX_8888 on hardware side, due to no way of distinguishing between these two in the DRI API, while HAL_PIXEL_FORMAT_RGB_888 is clearly defined to be the 3-byte per pixel RGB format. Signed-off-by: Tomasz Figa <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl/x11: misc style fixesEric Engestrom2016-11-172-2/+2
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* EGL/android: pbuffer implementationLiu Zhiquan2016-11-162-23/+78
| | | | | | | | | | | | | | | | | | | Android path didn't support pbuffer, so add pbuffer support to fix most failing dEQP and CTS pbuffer test cases. Patch adds a single buffer config to support pbuffer, and creates image in getBuffers for pbuffer when surface type is front surface. The EGL 1.5 spec states that pbuffers have a back buffer but no front buffer, single-buffered surfaces with no front buffer confuse Mesa; so we deviate from the spec, following the precedent of Mesa's EGL X11 platform. V3: update commit message and code review changes. Signed-off-by: Liu Zhiquan <[email protected]> Signed-off-by: Kalyan Kondapally <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* dri: make use of loader_get_extensions_name(..) helperChristian Gmeiner2016-11-151-2/+3
| | | | | | | | | | | | Changes since v1: - removed not needed includes - use the loader version of the helper v2 [Emil Velikov] - Keep the includes - they are required. Signed-off-by: Christian Gmeiner <[email protected]> Signed-off-by: Emil Velikov <[email protected]>
* Revert "dri: make use of dri_get_extensions_name(..) helper"Emil Velikov2016-11-151-3/+2
| | | | | | This reverts commit 1a21d21580965eff751414d140b3c176eeee2eb3. Pushed the wrong version of the patch.
* dri: make use of dri_get_extensions_name(..) helperChristian Gmeiner2016-11-151-2/+3
| | | | | Signed-off-by: Christian Gmeiner <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl/wayland: fix return value in dri2_wl_swrast_commit_backbufferEmil Velikov2016-11-111-1/+1
| | | | | | | | | | The function returns "void" rather than int. We could rework that, yet again there will be no benefit since all the callers have no use of it. Fixes: 9ca6711faa0 ("Revert "wayland: Block for the frame callback in get_back_bo not dri2_swap_buffers"") Reviewed-by: Daniel Stone <[email protected]> Signed-off-by: Emil Velikov <[email protected]>
* Revert "wayland: Block for the frame callback in get_back_bo not ↵Daniel Stone2016-11-101-16/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dri2_swap_buffers" This reverts commit 25cc889004aad6d1cab9edd76db898658e347b97, though since the code has changed, it was applied manually. The intent of moving blocking from SwapBuffers to get_back_bo, was to avoid unnecessary triple-buffering by ensuring that the compositor had fully processed the previous frame before we started rendering. This means that the only time we would have to resort to triple-buffering would be when the buffer is directly scanned out, thus saving an extra buffer for composition anyway. The 'repaint window' changes introduced in Weston since then, however, have narrowed the window of time between the frame event being sent and the repaint loop needing to conclude, to 7ms by default, in order to reduce latency. This means however that blocking in get_back_bo gives a maximum of 7ms for the entire GL submission to begin and complete. Not only this, but if a client is using buffer_age to avoid full repaints, the buffer-age request will stall in get_back_bo until the frame callback completes, meaning that the client cannot even calculate the repaint area before the 7ms window. The combination of the two meant that WebKit-GTK+ was failing to achieve full framerate on a Minnowboard, due to spending a great deal of its time attempting to query the age of the next buffer before redraw. Revert to the previous behaviour of allowing rendering to begin but delaying SwapBuffers, unless and until we can find a more gentle behaviour. Signed-off-by: Daniel Stone <[email protected]> Reviewed-by: Jonas Ådahl <[email protected]> Reviewed-by: Derek Foreman <[email protected]> Tested-by: Derek Foreman <[email protected]> Cc: Kristian Høgsberg <[email protected]>
* Revert "egl: remove explicit config_id management from dri2_add_config()"Emil Velikov2016-11-091-0/+3
| | | | | | | | This reverts commit 3652d1d5942a857f225700d67ce2c900396982f2. Self nack/reject on this one. The base.ConfigID is overwritten immediately after we store the current value, thus one memcpy [further down] the wrong value will be copied.
* egl: remove explicit config_id management from dri2_add_config()Emil Velikov2016-11-091-3/+0
| | | | | | | | | | Currently we only saved the id to memcpy the whole _EGLConfig to write back the exact same id value. Remove the unneeded and confusing/misleading code. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>