summaryrefslogtreecommitdiffstats
path: root/src/egl
Commit message (Collapse)AuthorAgeFilesLines
* meson: fix logic for generating .pc files with old glvndDylan Baker2019-09-261-14/+16
| | | | | | | | | | | | | | | We want to generate PC files for non-glvnd builds and for builds with old glvnd, but the current logic doesn't do that, it builds them unconditionally, and for GLES it builds the shared libraries, which is also not what we want. This does not generate .pc files for gles1 or gles2. Which it we weren't doing before either, making this not a regression but a return to status-quo.o Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1838 Fixes: 93df862b6affb6b8507e40601212a58012bfa873 ("meson: re-add incorrect pkg-config files with GLVND for backward compatibility") Reviewed-by: Matt Turner <[email protected]> (cherry picked from commit fafd20f67dec9f5891838435ecde1dedb77ab742)
* meson: re-add incorrect pkg-config files with GLVND for backward compatibilityEric Engestrom2019-09-251-10/+17
| | | | | | | | | | | | | This is a bit counter-intuitive, but the issue is that GLVND is broken in versions <= 1.1.1, so we need to keep wrongly providing these files to cover up their mistake, otherwise the rest of the world ends up broken. Suggested-by: Dylan Baker <[email protected]> Cc: [email protected] Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]> (cherry picked from commit 93df862b6affb6b8507e40601212a58012bfa873)
* egl: check for NULL value like eglGetSyncAttribKHR doesTapani Pälli2019-09-231-0/+4
| | | | | | | | | | | | | | Commit d1e1563bb63 added a NULL check for eglGetSyncAttribKHR but eglGetSyncAttrib does not do this. Patch adds same check to happen with eglGetSyncAttrib. Fixes crashes in (when exposing EGL 1.5): dEQP-EGL.functional.fence_sync.invalid.get_invalid_value Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Cc: [email protected] (cherry picked from commit 99cbec0a5f463fef4d9c61f34482d9eb00293704)
* egl: fix deadlock in malloc error pathEric Engestrom2019-09-041-1/+3
| | | | | | | Fixes: cb0980e69aa921af7086 ("egl: move alloc & init out of _eglBuiltInDriver{DRI2,Haiku}") Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> (cherry picked from commit 43d470404c47d86d1fab93d1345e09375bcf4fb6)
* egl: fix platform selectionLionel Landwerlin2019-09-041-2/+7
| | | | | | | | | | | | | Add missing "device" platform v2: Add the missing platform (Eric) Signed-off-by: Lionel Landwerlin <[email protected]> Reported-by: Jean Hertel <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111529 Fixes: d6edccee8d ("egl: add EGL_platform_device support") Reviewed-by: Eric Engestrom <[email protected]> (cherry picked from commit 6775a524004ba15ab281c1391fb24cbf621fe859)
* egl: reset blob cache set/get functions on terminateTapani Pälli2019-09-041-0/+4
| | | | | | | | | | Fixes errors seen with eglSetBlobCacheFuncsANDROID on Android when running dEQP that terminates and reinitializes a display. Fixes: 6f5b57093b3 "egl: add support for EGL_ANDROID_blob_cache" Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> (cherry picked from commit 3e03a3fc5315b488468b28aa40a7e9416f506520)
* win32: unify strcasecmp definitionsErik Faye-Lund2019-08-151-0/+1
| | | | | | | | | There was two incompatible definitions of strcasecmp, which lead to a compiler warning. Let's clean this up by only leaving one of them, and using that one all the time. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* surfaceless: Fix swrast-path segfault when loader doesn't know driver name.Eric Anholt2019-08-131-2/+3
| | | | | | | | | If we're hitting the swrast fallback path here, it's probably because we stumbled across a KMS-only device (such as the ASpeed that some of our CI runners have) that will then return a NULL driver_name. Don't crash in that case. Reviewed-by: Eric Engestrom <[email protected]>
* surfaceless: Fix swrast path.Eric Anholt2019-08-134-33/+26
| | | | | | | | | We get a getDrawableInfo() call in the MakeCurrent path, which platform_device was handling correctly by returning the pbuffer's width/height but platform_surfaceless segfaulted for. Reuse platform_device's implementation. Reviewed-by: Gurchetan Singh <[email protected]>
* egl/dri: Use __DRI2_BUFFER_DAMAGE extension for KHR_partial_updateHarish Krupo2019-08-132-5/+51
| | | | | | | | | | | | Use the DRI2 interface callback to pass the damage rects to the driver. Signed-off-by: Harish Krupo <[email protected]> Signed-off-by: Boris Brezillon <[email protected]> Acked-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Qiang Yu <[email protected]> Tested-by: Qiang Yu <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* egl/android: Delete set_damage_region from egl dri vtblHarish Krupo2019-08-1310-67/+1
| | | | | | | | | | | | | | | | | | The intension of the KHR_partial_update was not to send the damage back to the platform but to send the damage to the driver to ensure that the following rendering could be restricted to those regions. This patch removes the set_damage_region from the egl_dri vtbl and all the platfrom_*.c files. Then upcomming patches add a new dri2 interface for the drivers to implement Signed-off-by: Harish Krupo <[email protected]> Reviewed-by: Daniel Stone <[email protected]> Signed-off-by: Boris Brezillon <[email protected]> Acked-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Qiang Yu <[email protected]> Tested-by: Qiang Yu <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* util: add anon_file.h for all memfd/temp file usageGreg V2019-08-071-117/+2
| | | | | | | | | Move the Weston os_create_anonymous_file code from egl/wayland into util, add support for Linux memfd and FreeBSD SHM_ANON, use that code in anv/aubinator instead of explicit memfd calls for portability. Acked-by: Lionel Landwerlin <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl: drop unnecessary function derefEric Engestrom2019-08-041-2/+2
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Adam Jackson <[email protected]>
* mesa: Rename GLX_USE_TLS to USE_ELF_TLS.Bas Nieuwenhuizen2019-08-031-3/+3
| | | | | | | These days it is not GLX only and it does not work with all TLS implementations. Reviewed-by: Eric Engestrom <[email protected]>
* meson: replace last uses of libxmlconfig with idep_xmlconfigEric Engestrom2019-08-031-1/+2
| | | | | | Signed-off-by: Eric Engestrom <[email protected]> Acked-by: Eric Anholt <[email protected]> Tested-by: Vinson Lee <[email protected]>
* meson: replace libmesa_util with idep_mesautilEric Engestrom2019-08-031-2/+2
| | | | | | | | | | | This automates the include_directories and dependencies tracking so that all users of libmesa_util don't need to add them manually. Next commit will remove the ones that were only added for that reason. Signed-off-by: Eric Engestrom <[email protected]> Acked-by: Eric Anholt <[email protected]> Tested-by: Vinson Lee <[email protected]>
* egl: fix OpenGL 3.1 context creationTimothy Arceri2019-08-021-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | >From the EGL_KHR_create_context spec: "* If OpenGL 3.1 is requested, the context returned may implement any of the following versions: * Version 3.1. The GL_ARB_compatibility extension may or may not be implemented, as determined by the implementation. * The core profile of version 3.2 or greater." Fixes CTS tests: dEQP-EGL.functional.create_context_ext.gl_31.rgb888_depth_stencil dEQP-EGL.functional.create_context_ext.robust_gl_31.rgb888_depth_stencil dEQP-EGL.functional.create_context_ext.gl_31.rgb888_depth_no_stencil dEQP-EGL.functional.create_context_ext.robust_gl_31.rgb888_depth_no_stencil dEQP-EGL.functional.create_context_ext.gl_31.rgba8888_depth_no_stencil dEQP-EGL.functional.create_context_ext.gl_31.rgb888_no_depth_no_stencil dEQP-EGL.functional.create_context_ext.robust_gl_31.rgba8888_depth_no_stencil dEQP-EGL.functional.create_context_ext.robust_gl_31.rgb888_no_depth_no_stencil dEQP-EGL.functional.create_context_ext.gl_31.rgba8888_no_depth_no_stencil dEQP-EGL.functional.create_context_ext.robust_gl_31.rgba8888_no_depth_no_stencil dEQP-EGL.functional.create_context_ext.gl_31.rgba8888_depth_stencil dEQP-EGL.functional.create_context_ext.robust_gl_31.rgba8888_depth_stencil Reviewed-by: Kenneth Graunke <[email protected]>
* egl/drm: ensure the backing gbm is set before using itEmil Velikov2019-07-311-1/+1
| | | | | | | | | | | | | | | | Currently, if we error out before gbm_dri is set (say due to a different name of the backing GBM implementation, or otherwise) the tear down will trigger a NULL ptr deref and crash out. Move the gbm_dri initialization as early as possible. v2: Drop check in dri2_teardowm_drm (Eric) Reported-by: Christian Gmeiner <[email protected]> Cc: Christian Gmeiner <[email protected]> Cc: [email protected] Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* tree-wide: replace MAYBE_UNUSED with ASSERTEDEric Engestrom2019-07-311-1/+1
| | | | | | Suggested-by: Jason Ekstrand <[email protected]> Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* egl: replace MAYBE_UNUSED with UNUSEDEric Engestrom2019-07-311-1/+1
| | | | | | | | MAYBE_UNUSED is going away, so let's replace legitimate uses of it with UNUSED, which the former aliased to so far anyway. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* egl: Also query modifiers when exporting DMABufNicolas Dufresne2019-07-251-4/+22
| | | | | | | | | | | This fixes eglExportDMABUFImageQueryMESA() so it will report the modififers of the underlying image. Without this information, re-importing will likely be broken as it is rare these days that no modifiers are used. Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Daniel Stone <[email protected]> Fixes: 8f7338f284cdb1fef64c ("egl: add initial EGL_MESA_image_dma_buf_export v2.4")
* egl: Only expose 565 pbuffer configs if X can export them as DRI3 imagesKenneth Graunke2019-07-221-37/+79
| | | | | | | | | | | | | | | | | | | Glamor in xorg-server 1.20 cannot expose 16bpp pixmaps when running in the usual 24bpp mode. This meant our 565 pbuffer configs would ultimately fail to create a backing pixmap, leading to crashes. To hack around this, make a 16bpp pixmap and try and export it. If it works, expose the configs. Otherwise, just skip them. This also disables them on DRI2. These configs were only added to pass conformance requirements, and I doubt anybody cares about testing out 565 pbuffer visuals on DRI2-only drivers. v2: Don't leak the fds (caught by Eric Anholt) v3: Don't free(fds), it's not malloc'd Fixes: dacb11a585f ("egl: Add a 565 pbuffer-only EGL config under X11.") Reviewed-by: Eric Anholt <[email protected]>
* egl: Make the 565 pbuffer-only config single buffered.Kenneth Graunke2019-07-221-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit dacb11a585face5ca179c34cfc588a71a425c1e0, Eric found the first matching 565 pbuffer config, and stopped. Our double-buffered configs come first in the list, so we added that, making a pbuffer-only config that claimed to be double buffered. This doesn't make sense, since pixmaps/pbuffers are fundamentally not double buffered. When using that config, every call to eglCreatePbufferSurface would fail with EGL_BAD_MATCH. The call chain looks like this: - eglCreatePbufferSurface - dri3_create_pbuffer_surface - dri3_create_surface - dri2_get_dri_config which eventually does: const bool double_buffer = surface_type == EGL_WINDOW_BIT; and then fails to find a matching config, because it ends up looking for a single-buffered config - and there aren't any. To fix this, make the 565 pbuffer config single-buffered. This fixes at least 51 dEQP-EGL.* tests. Fixes: dacb11a585f ("egl: Add a 565 pbuffer-only EGL config under X11.") Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* egl: Quiet warning about front buffer rendering for pixmaps/pbuffersKenneth Graunke2019-07-221-3/+5
| | | | | | | | | | pbuffer configs cause a million of these warnings to trigger, but when using pixmaps or buffers, there is only one surface, so this warning doesn't make much sense. Retain it for window surfaces for now. Fixes: dacb11a585f ("egl: Add a 565 pbuffer-only EGL config under X11.") Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* egl/android: Update color_buffers querying for buffer ageNataraj Deshpande2019-07-222-6/+31
| | | | | | | | | | | | | | | | | | | | | | color_buffers[] is currently hard coded to 3 for android which fails in droid_window_dequeue_buffer when ANativeWindow creates color_buffers >3 while querying buffer age during dEQP partial_update tests on chromeOS. The patch removes static color_buffers[], queries for MIN_UNDEQUEUED_BUFFERS, sets native window buffer count and allocates the correct number of color_buffers as per android. Fixes dEQP-EGL.functional.partial_update* tests on chromebooks with enabling EGL_KHR_partial_update. v2: update comment instead of removing (Eric Engestrom) v3: change static array to dynamic allocated color_buffers querying MIN_UNDEQUEUED_BUFFERS (Chia-I Wu [email protected]) Fixes: 2acc69da8ce "EGL/Android: Add EGL_EXT_buffer_age extension" Signed-off-by: Nataraj Deshpande <[email protected]> Acked-by: Eric Engestrom <[email protected]> Reviewed-by: Chia-I Wu <[email protected]>
* egl: drop incorrect pkg-config file for glvndEric Engestrom2019-07-201-18/+10
| | | | | | | | | | | | | | | | | With b01524fff05eef66e8cd ("meson: don't build libGLES*.so with GLVND") we dropped the incorrect pkg-config files for GLES*. Since then, the glvnd issue of its missing files has become painfully apparent, since it break the build for everyone using glvnd. NVIDIA has had a fix for a few years now, but has yet to accept it: https://github.com/NVIDIA/libglvnd/pull/86 Since the breakage is already there, let's clean up everything on our side while we wait for NVIDIA to accept the fix. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* egl/android: handle multi-fd native windowsRob Clark2019-07-161-25/+55
| | | | | | | | | | | | | | We can hit multi-fd EGL_NATIVE_BUFFER_ANDROID case when the native android buffer is YUV. So we need to handle that. Currently this went unnoticed because, even though we have two or three fd's for YUV native android buffers, they all reference the same backing buffer. But we really shouldn't rely on that. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* egl: add glvnd symbols checkEric Engestrom2019-07-102-1/+2
| | | | | | | | | | | | | According to the spec [1], `__egl_Main` is the only symbol that needs to be exported. We don't want applications directly linking against libEGL_mesa.so (apps should always go through libEGL.so, regardless of who is providing it), so we shouldn't export any other symbols either. [1] https://github.com/NVIDIA/libglvnd/blob/master/include/glvnd/libeglabi.h (this header is the closest there is to a spec) Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: rewrite entrypoints checkEric Engestrom2019-07-103-13/+38
| | | | | | | | | | Part of the effort to replace shell scripts with portable python scripts. I could've used a trivial `assert lines == sorted(lines)`, but this way the caller is shown which entrypoint is out of order. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by Dylan Baker <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: use new symbols check scriptEric Engestrom2019-07-102-30/+10
| | | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by Dylan Baker <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: simplify loopEric Engestrom2019-07-011-3/+1
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Sagar Ghuge<[email protected]>
* egl/wayland: use bitset.h for `formats` bit setEric Engestrom2019-07-012-11/+19
| | | | | | | | | | | Currently only 7 formats are supported, but we don't want the 16 limit (it's an `unsigned`) to hit us by surprise :] Let's use bitset.h's BITSET magic to allow us to have any number of formats, with a static assert to make sure we don't forget to update it. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* egl: Enable eglGetPlatformDisplay on Android Platformrenchenglei2019-06-293-0/+27
| | | | | | This helps to add eglGetPlatformDisplay support on Android Platform. Reviewed-by: Eric Engestrom <[email protected]>
* egl: replace dead vfunc with an errorEric Engestrom2019-06-252-14/+2
| | | | | | | | | | st/egl used to support eglCreatePbufferFromClientBuffer, but now that it's gone, any call to it would segfault. Let's return a nice error instead. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* egl: delete unused vfuncsEric Engestrom2019-06-252-46/+7
| | | | | | | | | | | Nobody ever uses these, so let's just hard code them instead. If an EGL driver ever comes around that needs them they're trivial to re-add. Suggested-by: Emil Velikov <[email protected]> Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* egl: drop empty eglfallbacks.cEric Engestrom2019-06-255-53/+0
| | | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: move eglGetSyncAttrib() fallback to eglapi.cEric Engestrom2019-06-252-2/+5
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* egl: move eglSwapInterval() fallback to eglapi.cEric Engestrom2019-06-252-5/+8
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* egl: move eglSurfaceAttrib() fallback to eglapi.cEric Engestrom2019-06-252-3/+5
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* egl: move eglQuerySurface() fallback to eglapi.cEric Engestrom2019-06-252-2/+5
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* egl: move eglQueryContext() fallback to eglapi.cEric Engestrom2019-06-252-3/+5
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* egl: move eglGetConfigAttrib() fallback to eglapi.cEric Engestrom2019-06-252-3/+5
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* egl: move eglChooseConfig() fallback to eglapi.cEric Engestrom2019-06-252-3/+6
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* egl: move eglGetConfigs() fallback to eglapi.cEric Engestrom2019-06-252-2/+4
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* Revert "egl: drop empty eglfallbacks.c" and "egl: move fallback calls to ↵Eric Engestrom2019-06-226-38/+75
| | | | | | | | | | | | | | | | eglapi.c" This reverts commits cc4b68a80193e2a132cb62309292984a9428f2bb and b27fb3eacab906ec06cd61b7d01e3425c3b3cbfc. These caused a bunch of EGLSync tests to crash when they were previously failing. I have a hunch the tests are doing something wrong, like using extensions without checking for they support, but until the issue is investigated I'm just reverting these commits. Signed-off-by: Eric Engestrom <[email protected]>
* egl: drop empty eglfallbacks.cEric Engestrom2019-06-225-53/+0
| | | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: move fallback calls to eglapi.cEric Engestrom2019-06-222-22/+38
| | | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: drop `_eglReturnFalse()` fallbacksEric Engestrom2019-06-221-24/+0
| | | | | | | | | v2: drop them altogether, they should never get called in the first place (Emil) Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* egl: remove unnecessary eglGetProcAddress() fallbackEric Engestrom2019-06-222-2/+1
| | | | | | | | | No need to add a function that returns `false` only to be cast into a pointer, we can just use the existing `return NULL` :) Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: remove NULL assignments after calloc()Eric Engestrom2019-06-221-21/+0
| | | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>