summaryrefslogtreecommitdiffstats
path: root/src/egl
Commit message (Collapse)AuthorAgeFilesLines
* 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/x11: misc style fixesEric Engestrom2016-11-172-2/+2
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* egl: fix function name in debug stringEric Engestrom2016-11-171-1/+1
| | | | | 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]>
* egl: add missing error-checking to eglReleaseTexImage()Eric Engestrom2016-11-161-3/+40
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[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: Use pkg-config for Android NDK buildGurchetan Singh2016-11-151-0/+2
| | | | | | | | | | | | | | | | | It's possible to build Mesa for Android using the traditional autotools workflow [1]. ChromiumOS fetches Android prebuilts and puts them in a sysroot. We now want to use pkg-config to specify the location of system headers and libraries [2]. To enable this, let's add the required pkg-config checks and link against them. [1] https://developer.android.com/ndk/guides/standalone_toolchain.html [2] https://chromium-review.googlesource.com/#/c/403237/ v2: Bundle pkg-config checks together (Emil) v3: Provide further context on standalone NDK Mesa build (Emil) 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]>
* 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: use util/macros.hMarek Olšák2016-11-042-5/+2
| | | | | | | | | I need the definition of PUBLIC. 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]>
* gbm: set up the interop extension for egl/drmMarek Olšák2016-11-011-0/+1
| | | | | | | breaking libgbm -> libEGL ABI? Acked-by: Alex Deucher <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: set preserved behavior for surface only if config supports itTapani Pälli2016-10-271-1/+5
| | | | | | | | | | | | | | Otherwise we can end up with mismatching behavior between config and surface when client queries surface attributes. As example, configs for DRI3 do not support preserved behavior but here we were setting preserved behavior for pixmap and pbuffer. Signed-off-by: Tapani Pälli <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98326 Cc: "12.0 13.0" <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Chad Versace <[email protected]> Tested-by: Mark Janes <[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/dri2: swap_buffers_with_damage falls back to swap_buffersEric Engestrom2016-10-261-1/+2
| | | | | | | | | | | | | | | | | | Since commit 0a606a400fe3 ("egl: add eglSwapBuffersWithDamageKHR"), Android has been broken because the function eglSwapBuffersWithDamageKHR is provided regardless of the extension being present. Also, the Android meta-EGL always advertises the extension regardless of the underlying EGL implementation. As there doesn't seem to be a simple way conditionally make the EGL function ptr NULL, just implement a brain dead version of eglSwapBuffersWithDamage{KHR,EXT}. Cc: 13.0 <[email protected]> CC: Rob Clark <[email protected]> Suggested-by: Emil Velikov <[email protected]> Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Rob Herring <[email protected]> [Emil Velikov: copy the original commit message from Rob's patch] Reviewed-by: Emil Velikov <[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: fix type mismatch error type in _eglInitSurfaceTapani Pälli2016-10-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | EGL spec defines EGL_BAD_MATCH for windows, pixmaps and pbuffers in case where user creates a surface but config does not support rendering to such surface type. Following quotes are from EGL 1.5 spec 3.5 "Rendering Surfaces" : for eglCreatePlatformWindowSurface, eglCreateWindowSurface: "If config does not support rendering to windows (the EGL_SURFACE_TYPE attribute does not contain EGL_WINDOW_BIT ), an EGL_BAD_MATCH error is generated." for eglCreatePbufferSurface: "If config does not support pbuffers, an EGL_BAD_MATCH error is generated." for eglCreatePlatformPixmapSurface, eglCreatePixmapSurface: "If config does not support rendering to pixmaps (the EGL_SURFACE_TYPE attribute does not contain EGL_PIXMAP_BIT ), an EGL_BAD_MATCH error is generated." Fixes following dEQP test: dEQP-EGL.functional.negative_api.create_pbuffer_surface Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* Revert "egl/android: Set EGL_MAX_PBUFFER_WIDTH and EGL_MAX_PBUFFER_HEIGHT"Tapani Pälli2016-10-251-2/+0
| | | | | | | | | | This reverts commit b1d636aa007c0c354a217024b4befe15cfb5149f, previous commit sets these values for all egl configs. Signed-off-by: Tapani Pälli <[email protected]> Cc: "12.0 13.0" <[email protected]> Suggested-by: Emil Velikov <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl/dri2: set max values for pbuffer width and heightTapani Pälli2016-10-251-0/+9
| | | | | | | | | | | | | | | | | | While these max values were previously fixed for pbuffer creation, this change makes also eglGetConfigAttrib() return correct values. Fixes following dEQP tests: dEQP-EGL.functional.create_surface.pbuffer.rgb888_no_depth_no_stencil dEQP-EGL.functional.create_surface.pbuffer.rgb888_depth_stencil dEQP-EGL.functional.create_surface.pbuffer.rgba8888_no_depth_no_stencil dEQP-EGL.functional.create_surface.pbuffer.rgba8888_depth_stencil Signed-off-by: Tapani Pälli <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98326 Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Cc: "12.0 13.0" <[email protected]>
* egl/wayland: add missing destroy_window callbackStencel, Joanna2016-10-241-2/+13
| | | | | | | | | | | The original patch by Joanna added the function pointer and callback yet things got only partially applied - the infra was added, but the implementation was missing. Cc: "12.0 13.0" <[email protected]> Fixes: 690ead4a135 ("egl/wayland-egl: Fix for segfault in dri2_wl_destroy_surface.") Signed-off-by: Emil Velikov <[email protected]>
* egl: bring back the default glapi.so nameEric Engestrom2016-10-191-3/+1
| | | | | | | | | | | | | Earlier commit replaced the default platform specific libglapi.so name with an #error. This may have been overzealous since the name is the correct for the BSD platforms, at least. Reinstate the hunk - bringing back OpenBSD, et al. to a successful build state. Fixes: 7a9c92d071d ("egl/dri2: non-shared glapi cleanups") [Emil Velikov: format the patch from Eric, add commit message and tag.] Signed-off-by: Emil Velikov <[email protected]>
* egl/surfaceless: Fix segfault in eglSwapBuffersChad Versace2016-10-181-0/+12
| | | | | | | | | | | Since commit 63c5d5c6c46c8472ee7a8241a0f80f13d79cb8cd, the surfaceless platform has allowed creation of pbuffer surfaces. But the vtable entry for eglSwapBuffers has remained NULL. Discovered by running a little pbuffer test. Cc: Gurchetan Singh <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* egl: remove docs directory from EXTRA_DISTJonathan Gray2016-10-181-1/+0
| | | | | | | | | | | | The egl docs directory no longer exists as of 88b5c36fe1a1546bf633ee161a6715efc593acbd. Remove it from EXTRA_DIST to unbreak 'make dist' Signed-off-by: Jonathan Gray <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Tested-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* loader: remove loader_get_driver_for_fd() driver_typeEmil Velikov2016-10-185-5/+5
| | | | | | | | | | | | | | Reminiscent from the pre-loader days, were we had multiple instances of the loader logic in separate places and one could build a "GALLIUM_ONLY" version. Since that is no longer the case and the loaders (glx/egl/gbm) do not (and should not) require to know any classic/gallium specific we can drop the argument and the related code. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Axel Davy <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* egl/android: fix error in droid_add_configs_for_visuals()Tapani Pälli2016-10-171-2/+0
| | | | | | | | | | This was some kind of leftover in commit acd35c8 and format_count array variable (declared in outer scope) should be used instead. Signed-off-by: Tapani Pälli <[email protected]> Fixes: acd35c8758dc73240903 ("egl/android: tweak droid_add_configs_for_visuals()") Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl/surfaceless: Fix comparison between pointer and integerChad Versace2016-10-161-1/+1
| | | | | | | | | Fixes GCC warning: drivers/dri2/platform_surfaceless.c:196:18: warning: comparison between pointer and integer Fixes: 4b8a55809eb ("egl/surfaceless: tweak surfaceless_add_configs_for_visuals()") Reviewed-by: Emil Velikov <[email protected]>
* egl/surfaceless: use correct index when accesing the visualEmil Velikov2016-10-161-1/+1
| | | | | | | | | | i is used for the driver_configs, while j is for the visuals. Fixes: 4b8a55809eb ("egl/surfaceless: tweak surfaceless_add_configs_for_visuals()") Reported-by: Chad Versace <[email protected]> Tested-by: Chad Versace <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl: Move old EGL_MESA_screen_surface specChad Versace2016-10-141-564/+0
| | | | | | | It was the lone file in src/egl/docs. Move it to where the other specs live, in $MESA_TOP/docs/specs. Reviewed-by: Emil Velikov <[email protected]>
* egl: Implement EGL_MESA_platform_surfacelessChad Versace2016-10-144-1/+70
| | | | Reviewed-by: Emil Velikov <[email protected]>
* egl: Don't advertise unsupported platform extensionsChad Versace2016-10-141-2/+8
| | | | | | | | | | | | | Mesa's set of supported platform extensions depends on the autoconf option --with-egl-platforms=foo,bar,baz. If --with-egl-platforms lacks foo, then eglGetPlatformDisplay(EGL_PLATFORM_FOO, ...) unconditonally fails. So, if --with-egl-platforms lacks foo, then remove EGL_VENDOR_platform_foo from the EGL client extension string. Cc: [email protected] Reviewed-by: Emil Velikov <[email protected]>
* Revert "egl/dri2: rework dri2_make_current code flow"Emil Velikov2016-10-141-36/+36
| | | | This reverts commit 675719817e7bf7c5b9da22c02252aca77a41338d.
* egl/drm: set eglError and provide an error message on failureEmil Velikov2016-10-141-6/+15
| | | | | | | v2: Remove gratuitous newline/semicolon (Eric) Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl/x11: attribute for dri2_add_config failureEmil Velikov2016-10-141-7/+14
| | | | | | | | | | | | | | ... in dri2_x11_add_configs_for_visuals(). Currently the latter does not consider that, thus in such cases it adds "empty" configs in the list. Properly account for things and as we do that we can reuse count, instead of calling _eglGetArraySize to determine if we've added any configs. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl/wayland: introduce dri2_wl_add_configs_for_visuals() helperEmil Velikov2016-10-141-32/+51
| | | | | | | | | | | | | | | | | | Analogous to previous commits - with an extra bonus. Current code, apart from not attributing the lack of 'per visual' and overall configs also overwrites the newly added config. Namely if the dpy supports two or more of the supported formats (XRGB8888, ARGB8888 and RGB565) earlier configs will be overwritten and the the final one will be stored, since the we use the same index for all three in our dri2_add_config call. v2: Use correct comparison in loop conditional (Eric) Use valid C initializer (Gurchetan) Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl/surfaceless: tweak surfaceless_add_configs_for_visuals()Emil Velikov2016-10-141-7/+8
| | | | | | | | | | | Analogous to previous commit. v2: Use correct comparison in loop conditional (Eric) Use valid C initializer (Gurchetan) Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Gurchetan Singh <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl/android: tweak droid_add_configs_for_visuals()Emil Velikov2016-10-141-19/+21
| | | | | | | | | | | | | | Iterate over the driver_configs first in order to cut down the number of getConfigAttrib() calls by a factor of 5. While we're here, also drop the sentinel of the visuals array. We already know its size so we can use that and save a few bytes. v2: Use correct comparison in loop conditional (Eric) Use valid C initializer (Gurchetan) Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl/drm: introduce drm_add_configs_for_visuals() helperEmil Velikov2016-10-141-28/+61
| | | | | | | | | | | | | | Factor out and rework the existing code so that it prints a debug message if we have zero configs for any visual. As a nice side effect we now provide a correct (sequential ID) when creating a config (via dri2_add_config). v2: Use correct comparison in loop conditional (Eric) Use valid C initializer (Gurchetan) Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl/surfaceless: print out a message on zero configs for given formatEmil Velikov2016-10-141-9/+18
| | | | | | | | | | | | Currently we print a debug message if the total configs is non-zero only to do the same (at an error level) as we return from the function. Rework the message to print if we're missing a config for the given format. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Gurchetan Singh <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl/dri2: set WL_bind_wayland_display in a consistent wayEmil Velikov2016-10-144-22/+29
| | | | | | | | | | | | | | Introduce a helper and use it throughout the platform code. This allows us to reduce the amount of ifdef(s) and (potentially) use kms_swrast_dri.so for !drm platforms (namely wayland and x11). Note: in the future as other platforms (android, surfaceless) support the extension they can reuse the helper. v2: Rebase, check for device_name. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Daniel Stone <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl/android: remove duplicate KHR_image_base setEmil Velikov2016-10-141-1/+0
| | | | | | | The core egl/dri2 already sets the extension bit _only_ when possible - which in Android's case is always. Signed-off-by: Emil Velikov <[email protected]>
* loader/dri3: constify the loader_dri3_vtableEmil Velikov2016-10-141-1/+1
| | | | | Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl/dri2: micro optimise dri2_bind_extensions()Emil Velikov2016-10-141-0/+1
| | | | | | | Do not loop over all matches if we've already found one. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl/dri2: annotate dri2_extension_match instances as const dataEmil Velikov2016-10-141-7/+7
| | | | | | | v2: Rebase. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl/dri2: use dri2_bind_extensions to manage the optional extensionsEmil Velikov2016-10-141-18/+10
| | | | | | | v2: dri2_bind_extensions() now takes optional as an argument. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl/dri2: add support for optional extensions in dri2_bind_extensions()Emil Velikov2016-10-141-9/+15
| | | | | | | | | | | Will allow us to reuse the function for optional extensions and fold a bit of code. v2: Make dri2_bind_extensions::optional flag an argument to dri2_bind_extensions (Kristian). Cc: Rob Clark <[email protected]> Signed-off-by: Emil Velikov <[email protected]>
* egl/dri2: coding style cleanupEmil Velikov2016-10-142-153/+153
| | | | | | | | | Consistently indent with space rather than a mix of tab and spaces. v2: Keep the structs properly aligned (Eric). Signed-off-by: Emil Velikov <[email protected]>