aboutsummaryrefslogtreecommitdiffstats
path: root/src/egl
Commit message (Collapse)AuthorAgeFilesLines
* egl/wayland: Fix zwp_linux_dmabuf usageChristopher James Halse Rogers2020-04-291-12/+20
| | | | | | | | | | | | | | | | | | | | | | There's no guarantee that the formats advertised by wl_drm and the formats advertised by zwp_linux_dmabuf_v1 are the same. get_back_bo() handles this by falling back from createImageWithModifiers() to createImage() when there's a wl_drm format but no corresponding linux_dmabuf format, but create_wl_buffer() unconditionally tries to create a linux_dmabuf buffer unless DRIimage has DRM_FORMAT_MOD_INVALID. Fix this by always checking if the DRIimage modifier has been advertised by zwp_linux_dmabuf_v1, and falling back to wl_drm if not. If DRM_FORMAT_MOD_INVALID has been advertised then we trust the client has allocated something appropriate and treat any modifier as matching. Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2220 Signed-off-by: Christopher James Halse Rogers <[email protected]> Reviewed-by: Daniel Stone <[email protected]> Reviewed-by: Simon Ser <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4294>
* egl: simplify client/platform extension handlingEmil Velikov2020-04-214-59/+23
| | | | | | | | | | | | | | | | For GLVND reasons the client/platform extensions strings should be split. While in the non GLVND case they're one big string. Currently we handle this distinction at run-time for not obvious reason. Adding additional code and complexity. Swap those with a few well placed #if USE_LIBGLVND guards. As a side result this removes a minor memory leak due to the concatenation in the non GLVND case. Signed-off-by: Emil Velikov <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4491>
* EGL: Add eglSetDamageRegionKHR to GLVND dispatch listDaniel Stone2020-04-031-0/+3
| | | | | | | | | | | | | This was missed in the original conversion, which added support for eglSetDamageRegionKHR to local EGL exports, but forgot to generate updated dispatch for GLVND. Signed-off-by: Daniel Stone <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Fixes: 9827547313c7 ("egl/android: support for EGL_KHR_partial_update") Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4403> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4403>
* gallium: enable EGL_EXT_image_dma_buf_import_modifiers unconditionallyAdam Jackson2020-04-021-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a re-do of [1]. Enable EGL_EXT_image_dma_buf_import_modifiers with EXT_image_dma_buf_import. This allows users to use queryDmaBufFormats to query the list of supported formats even if modifiers are not supported. With this change, queryDmaBufModifiers always returns zero modifiers. A compositor survey reveals that this should be fine: wlroots [2], Weston [3], Mutter [4] [5], kwin [6] and xorg-xserver [7] seem to all support this case gracefully. Tested with Sway and wlroots by running weston-info and checking the list of formats advertised by zwp_linux_dmabuf_v1. Also ran weston-simple-egl and checked zwp_linux_dmabuf_v1 was used instead of wl_drm. [1]: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/1812 [2]: https://github.com/swaywm/wlroots/blob/8707a9b7ecbba0321804604d9ea954a46ecced21/render/egl.c#L629 [3]: https://gitlab.freedesktop.org/wayland/weston/-/blob/786490cb53439624fd3c20b9e19d3ea5ec316c00/libweston/renderer-gl/gl-renderer.c#L2337 [4]: https://gitlab.gnome.org/GNOME/mutter/-/blob/f0df07cba3ca308b47c9aefcc8112e8880fd9950/src/wayland/meta-wayland-dma-buf.c#L486 [5]: https://gitlab.gnome.org/GNOME/mutter/-/blob/0a6034ef3a745c25ab63c2ca8d4ae08bc5e09d88/src/backends/native/meta-renderer-native.c#L399 [6]: https://cgit.kde.org/kwin.git/tree/platformsupport/scenes/opengl/egl_dmabuf.cpp?id=9b7ab4d16a8ee0cb35108362ee5aa046f4ae20b7#n473 [7]: https://gitlab.freedesktop.org/xorg/xserver/-/blob/26004df63c25061586a967f3586795a75280acc2/glamor/glamor_egl.c#L682 Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4298> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4298>
* Revert "egl/dri2: Don't dlclose() the driver on dri2_load_driver_common failure"Emil Velikov2020-04-011-2/+4
| | | | | | | | | | | | | | | | | | | | This reverts commit 1b87f4058de84d7a0bb4ead0c4f4b024d4cce8fb. dlclose() of the handle is perfectly reasonable, a follow-up NULL assignment is missing. As-is this causes a leak for nearly every platform, since they call dri2_load_driver* initially, followed by a second swrast fallback call. Some platforms even loop through the existing drivers probing. Revert the commit and add the NULL check. Fixes: 1b87f4058de ("egl/dri2: Don't dlclose() the driver on dri2_load_driver_common failure") Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Adam Jackson <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4084>
* egl/drm: reinstate (kms_)swrast supportEmil Velikov2020-04-011-5/+1
| | | | | | | | | | | | | | | | | | | | With earlier commit we've added a generic LIBGL_ALWAYS_SOFTWARE handling yet did not consider that the existing codebase unconditionally errors out when set. That was fixed with a latter commit, while the fix itself added erroneous restriction for egl/drm. As mentioned in the report - the feature was working for ages. It was a Gnome developer who added kms_swrast support for gbm in the first place. Admittedly kms_swrast is somewhat in the middle between traditional swrast and HW drivers, regardless - reinstate support. Fixes: 47273d7312c ("egl: set UseFallback if LIBGL_ALWAYS_SOFTWARE is set") Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/165 Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Adam Jackson <[email protected]> Acked-by: Eric Engestrom <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4084>
* scons: Prune out unnecessary targets.Jose Fonseca2020-03-301-36/+0
| | | | | | | | | | | | | | | | This prunes out all targets except libgl-gdi, libgl-xlib, and svga, as suggested by Marek Olšák. libgl-xlib will be remove once I have had time to confirm no automated tests we have rely upon it. There are also a bunch of Makefile.sources which become orphaned as result, that are not taken care of in this change. v2: Prune remainders of swr support. Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4348> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4348>
* egl/android: enable/disable KHR_partial_update correctlyChia-I Wu2020-03-231-3/+5
| | | | | | | | | | | | | | | | | | Commit f3728816af (egl/android: require ANDROID_native_fence_sync for buffer age) re-added some stale code removed in commit b4345da8762 (egl/android: Delete set_damage_region from egl dri vtbl). Remove it now. Commit b4345da8762 assumes KHR_partial_update is only driver-dependent. That is mostly true except that the extension also introduces buffer age query, which depends on ANDROID_native_fence_sync on Android. Signed-off-by: Chia-I Wu <[email protected]> Reviewed-by: Lepton Wu <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4235> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4235>
* egl/android: set window usage flagsDavid Stevens2020-03-121-0/+5
| | | | | | | | | When creating an egl surface from an ANativeWindow, the window's usage flags need to be set so that buffers are allocated properly. Signed-off-by: David Stevens <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Lepton Wu <[email protected]>
* egl/android: require ANDROID_native_fence_sync for buffer ageChia-I Wu2020-03-091-1/+12
| | | | | | | | | | | Querying buffer age requires a buffer to be dequeued. But dequeuing without ANDROID_native_fence_sync might imply eglClientWaitSync, which results in a deadlock as the display lock is already held by eglQuerySurface. Signed-off-by: Chia-I Wu <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/221> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/221>
* egl/wayland: Don't invalidate buffers on no-op resizeDaniel Stone2020-03-041-0/+4
| | | | | | | | | | | | | | | | The Wayland platform's resize_callback is invoked from libwayland-egl when wl_egl_window_resize() is called. The resize call is the only place for the application to insert dx/dy arguments to wl_surface_attach(). When modifying the cursor hotspot (as in wayland/wayland#148), we want to set dx/dy, but leave the surface size the same. If we get wl_egl_window_resize() with the same width and height argument as we already have, we do not need to invalidate our existing drawable. Signed-off-by: Daniel Stone <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4030> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4030>
* egl: allow INVALID format for linux_dmabufIvan Molodetskikh2020-03-021-5/+24
| | | | | | | | | | | | | | | | | | | | | As per https://gitlab.freedesktop.org/wayland/wayland-protocols/commit/fb9b2a87317c77e26283da5f6c9559d709f6fdcd, the compositor may advertise DRM_FORMAT_MOD_INVALID as a supported modifier. This patch makes mesa recognize this fact and allow linux_dmabuf usage with the INVALID modifier in this case. In case the driver doesn't support modifiers, we can still use linux-dmabuf protocol instead of the legacy wl_drm interface to create wl_buffers. This will help compositors to handle these buffers better. In this commit, the INVALID modifier is allowed to be added to the list of supported modifiers, and create_wl_buffer will be able to use linux_dmabuf with an INVALID modifier if the compositor advertised it as supported. Signed-off-by: Ivan Molodetskikh <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2147> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2147>
* egl: Factor out dri2_add_pbuffer_configs_for_visuals {device,surfaceless}.Mathias Fröhlich2020-02-264-92/+46
| | | | | | | | | v2: dri2_add_configs_for_visuals -> dri2_add_pbuffer_configs_for_visuals Reviewed-by: Emil Velikov <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3790> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3790>
* egl: Fix A2RGB10 platform_{device,surfaceless} PBuffer configs.Mathias Fröhlich2020-02-264-14/+81
| | | | | | | | | | | | | | | The __DRI_IMAGE_FORMAT_* part wants to be handled for the *101010 type formats as well. Factor out a common function for that task. That again makes the piglit egl_ext_device_base test work again for hardware drivers. v2: Factor out a common function for that task. v3: dri2_pbuffer_visuals -> dri2_pbuffer_visuals Reviewed-by: Emil Velikov <[email protected]> Fixes: 9acb94b6236 "egl: Enable 10bpc EGLConfigs for platform_{device,surfaceless}" Signed-off-by: Mathias Fröhlich <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3790>
* egl: Implement getImage/putImage on pbuffer swrast.Mathias Fröhlich2020-02-174-5/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | This change adds getImage/putImage callbacks to the swrast pbuffer loader extension. This fixes a recent crash with Weston as well as a crashing test with classic swrast without an official gitlab issue. v2: Determine bytes per pixel differently and fix non X11 builds. v3: Plug memory leak and fix crash on out of bounds access. (Daniel Stone) v4: Follow the code structure of the wayland get/put image implementation - hopefully being more obvious. Handle 64 bits formats. Use BufferSize directly. (Emil Velikov) v5: Change pixel size computation. (Eric Engestrom) Reviewed-by: Daniel Stone <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2219 Fixes: d6edccee8da "egl: add EGL_platform_device support" Signed-off-by: Mathias Fröhlich <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3711> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3711>
* egl: directly access static members instead of using _egl{Get,Set}ConfigKey()Eric Engestrom2020-02-143-42/+38
| | | | | | | | | | | | This function is meant for when the attribute is unknown at compile-time (eg. user-specified), but in all these cases it is much simpler to just read/write the member directly. Suggested-by: Emil Velikov <[email protected]> Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3816> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3816>
* Revert "egl: put full path to libEGL_mesa.so in GLVND json"Eric Engestrom2020-02-063-36/+8
| | | | | | | | | | | | | | | | | | | | This reverts commit 0021f7dc307f4852955359adb5ac2b7667e6d4ac. That commit had 2 issues: - I missed the `.0` from the filename, causing issues on Debian & Ubuntu platforms. - I didn't think about multilib/multi-arch systems, where we'd now need a separate json for each arch as they point to different libs. Reverting this commit for now, I'll try again later. Requested-by: Michel Dänzer <[email protected]> Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2466 Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2471 Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2480 Signed-off-by: Eric Engestrom <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3726> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3726>
* egl: put full path to libEGL_mesa.so in GLVND jsonEric Engestrom2020-02-023-8/+36
| | | | | | | | | | | This is useful when installing to a non-standard path. glvnd_icd.py copied & adapted from src/intel/vulkan/anv_icd.py Signed-off-by: Eric Engestrom <[email protected]> Acked-by: Matt Turner <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3038> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3038>
* egl: drop confusing mincore() error messageEric Engestrom2020-01-221-2/+0
| | | | | | | | | | | | A user came to me asking how to fix this error, but it's entirely expected that `get_wl_surface_proxy()` on recent enough wayland compositors will always print it. Let's just remove the message altogether, it is basically never useful. Reviewed-by: Matt Turner <[email protected]> Signed-off-by: Eric Engestrom <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3219> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3219>
* egl: Fix _eglPointerIsDereferencable w/o mincore()Alexander van der Grinten2020-01-221-3/+4
| | | | | | | | | | | | | | | | On platforms without mincore(), _eglPointerIsDereferencable() currently just checks whether p != NULL. This is not sufficient: In the Wayland platform code (i.e., in get_wl_surface_proxy()), _eglPointerIsDereferencable() is called on the version field of `struct wl_egl_window` which is 3 on current versions of Wayland. This causes a segfault when trying to dereference p. Fix this behavior by assuming that the first page of the process is never dereferencable. Reviewed-by: Eric Engestrom <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3103> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3103>
* egl/android: fix buffer_count for applications setting max countTapani Pälli2020-01-221-6/+22
| | | | | | | | | | | | | Problem with previous solution was that it did not take account that some applications may set a max count for buffers. Therefore we need to query both min and max and clamp our setting based on that. Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2373 Fixes: be08e6a4496 ("egl/android: Restrict minimum triple buffering for android color_buffers") Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3480> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3480>
* egl/android: Restrict minimum triple buffering for android color_buffersNataraj Deshpande2020-01-151-3/+7
| | | | | | | | | | | | | | | | | The patch restricts triple buffering as minimum at driver for android color_buffers in order to fix onscreen performance hit for T-Rex and Manhattan. v2: Update min_buffer check condition (Tapani Pälli) v3: further code cleanup (Eric Engestrom) Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2332 Fixes: 0661c357c60 ("egl/android: Update color_buffers querying for buffer age") Signed-off-by: Nataraj Deshpande <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3384> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3384>
* Revert "egl: handle EGL_IMAGE_EXTERNAL_FLUSH_EXT"Tapani Pälli2019-11-143-70/+11
| | | | | | | | | | | This reverts commit 34b1aa957a3f44ea9587ec43311e8434d3782cc1. This series caused unexpected flickering artifacts with Iris driver on Chrome OS and EGL_EXT_image_flush_external spec has not been published yet. Acked-by: Eric Engestrom <[email protected]> Acked-by: Kristian H. Kristensen <[email protected]>
* Revert "egl: implement new functions from EGL_EXT_image_flush_external"Tapani Pälli2019-11-147-106/+0
| | | | | | | | | | | This reverts commit c1c574fdf18f2aeb1c03f9670bf00e1dcd22d99d. This series caused unexpected flickering artifacts with Iris driver on Chrome OS and EGL_EXT_image_flush_external spec has not been published yet. Acked-by: Eric Engestrom <[email protected]> Acked-by: Kristian H. Kristensen <[email protected]>
* egl: move #include of local headers out of Khronos headersEric Engestrom2019-11-112-0/+4
| | | | | | Cc: [email protected] Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* egl: fix _EGL_NATIVE_PLATFORM fallbackEric Engestrom2019-11-111-9/+0
| | | | | | | | | When the X11 or Haiku platforms were compiled in, they would bypass the `_EGL_NATIVE_PLATFORM` fallback by always returning themselves instead. Cc: [email protected] Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* egl: Mention if swrast is being forcedChris Wilson2019-11-111-0/+2
| | | | | | | | | | | | | | The system can be disabling HW acceleration unbeknown to the user, leading to a long debug session trying to work out which component is failing. A quick mention that it is the environment override would be very useful. v2: Use more generic "CPU renderer" and so try to avoid jargon. Reviewed-By: Tapani Pälli <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Acked-by: Martin Peres <[email protected]>
* meson: move the generic symbols check arguments to a common variableEric Engestrom2019-11-051-1/+1
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviwed-by: Dylan Baker <dylan@pnwbakers>
* meson: add variable to control the symbols checksEric Engestrom2019-11-051-1/+1
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviwed-by: Dylan Baker <dylan@pnwbakers>
* meson: Add dep_glvnd to egl deps when building with glvndDylan Baker2019-11-051-1/+2
| | | | | | | | | | | Otherwise if glvnd is not installed systemwide, but only in a prefix, it's headers wont be found. This happens because if it's headers are in /usr/include/ then another dependence will provide the necessary -I arguments and compilation will work. Fixes: 035ec7a2bb2d5e413ac945b8f012185a0e187d5e ("meson: Add support for EGL glvnd") Acked-by: Eric Engestrom <[email protected]>
* meson: revert glvnd workaroundEric Engestrom2019-10-311-11/+2
| | | | | | | This effectively reverts MR !2112. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* egl: implement new functions from EGL_EXT_image_flush_externalMarek Olšák2019-10-257-0/+106
| | | | | Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-By: Tapani Pälli <[email protected]>
* egl: handle EGL_IMAGE_EXTERNAL_FLUSH_EXTMarek Olšák2019-10-253-11/+70
| | | | | Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-By: Tapani Pälli <[email protected]>
* egl/android: Remove our own reference to buffers.Lepton Wu2019-10-211-3/+1
| | | | | | | | | | | | | | | | | | | We currently doesn't maintain it correctly and the buffer gets leaked if surface is destroyed before calling swapping buffers. From Android frameworks/native/libs/nativewindow/include/system/window.h: The window holds a reference to the buffer between dequeueBuffer and either queueBuffer or cancelBuffer, so clients only need their own reference if they might use the buffer after queueing or canceling it. v2: Remove our own reference. Fixes: 0212db35040 ("egl/android: Cancel any outstanding ANativeBuffer in surface destructor") Reviewed-by: Chia-I Wu <[email protected]> (v1) Reviewed-By: Tapani Pälli <[email protected]> Signed-off-by: Lepton Wu <[email protected]>
* Revert "egl: Fixes transparency with EGL and X11."Hal Gentz2019-10-185-30/+17
| | | | This reverts commit 90a19074b4e1d4d8f8ababaade8170c05aeecffe.
* Revert "egl: Puts RGBA visuals in the second config selection group."Hal Gentz2019-10-181-9/+1
| | | | This reverts commit a800d16e4f1589e41e53edf8e8a771a33bb46a6a.
* Revert "egl: Configs w/o double buffering support have no `EGL_WINDOW_BIT`."Hal Gentz2019-10-1810-78/+7
| | | | This reverts commit 075a96aa926e6e89795f95a6a59693f44d9ac970.
* egl: Configs w/o double buffering support have no `EGL_WINDOW_BIT`.Hal Gentz2019-10-1110-7/+78
| | | | | | | | | | | | | | | | When users pass a config to `eglCreateWindowSurface` it requests double buffering, but if the config doesn't have the appropriate `__DRIconfig`, `eglCreateWindowSurface` fails with a `EGL_BAD_MATCH`. Given that such behaviour is completely unacceptable, we drop the `EGL_WINDOW_BIT` if we don't have at least one `__DRIconfig` supporting double buffering, otherwise dropping the `EGL_PIXMAP_BIT`. Fixes: 049f343e8ac "egl: Allow 24-bit visuals for 32-bit RGBA8888 configs" Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67676 Cc: [email protected] Reviewed-by: Adam Jackson <[email protected]> Signed-off-by: Hal Gentz <[email protected]>
* egl: Puts RGBA visuals in the second config selection group.Hal Gentz2019-10-111-1/+9
| | | | | | | | | | | | | | | That way applications don't get windows that are compositor alpha-blended accidentally. In the ideal world, this would be done by the xserver, as it does for GLX, however, an appropriate place could not be found, so it's being placed here instead. Fixes: 049f343e8ac "egl: Allow 24-bit visuals for 32-bit RGBA8888 configs" Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67676 Cc: [email protected] Reviewed-by: Adam Jackson <[email protected]> Signed-off-by: Hal Gentz <[email protected]>
* egl: Fixes transparency with EGL and X11.Hal Gentz2019-10-115-17/+30
| | | | | | | | | | | | | This commit does this by allowing both RGB and RGBA visuals to match with EGL configs. We also expose the `EGL_MESA_config_select_group` egl extension, which is similar to GLX's visual select group extension, to allow the RGBA visuals to get less priority. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67676 Fixes: 049f343e8ac "egl: Allow 24-bit visuals for 32-bit RGBA8888 configs" Cc: [email protected] Reviewed-by: Adam Jackson <[email protected]> Signed-off-by: Hal Gentz <[email protected]>
* meson: rename `glvnd_missing_pc_files` to `not glvnd_has_headers_and_pc_files`Eric Engestrom2019-10-101-2/+2
| | | | | | | | This reflects better what is provided by glvnd or not. Fixes: 93df862b6affb6b8507e ("meson: re-add incorrect pkg-config files with GLVND for backward compatibility") Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* egl: Include stddef.h in generated sourceDanilo Spinella2019-10-091-0/+1
| | | | | | | Required for NULL macro used throughout the generated file. Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* egl: Make native display detection work more than onceAdam Jackson2019-10-091-22/+12
| | | | | | | | | | | | eglGetDisplay is awful because you have to inspect the pointer you're given and guess what type of native display it corresponds to. We make it worse by caching the type of the first such display we detect, so if the second call to eglGetDisplay is to a different display type, kaboom. Fortunately this is a problem that can be solved with the delete key. Reviewed-by: Eric Engestrom <[email protected]> Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/156
* surfaceless: Support EGL_WL_bind_wayland_displayAdam Jackson2019-10-041-0/+4
| | | | | | | Feature parity with the drm, x11, and wayland platforms. Gitlab: https://gitlab.freedesktop.org/mesa/mesa/issues/1870 Tested-by: Pekka Paalanen <[email protected]>
* egl: Remove the 565 pbuffer-only EGL config under X11.Andres Gomez2019-10-031-93/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | The CTS finally has agreed to drop the requirement for a 565-no-depth-no-stencil config for ES 3.0. Hence we can now remove the code to satisfy this requirement using a pbuffer-only visual with whatever other buffers the driver happens to have given us. This reverts commit 82607f8a900796871470ac4f1a04e154392e4898, commit 6ad31c4ff33d92f6359b196a94ace99682272111 and commit dacb11a585face5ca179c34cfc588a71a425c1e0. v2: - Reference the VK-GL-CTS issue (Eric E.). v3: - Don't revert fc21394bc4d ("egl: Quiet warning about front buffer rendering for pixmaps/pbuffers") (Kenneth). References: VK-GL-CTS issue 1601. Cc: [email protected] Signed-off-by: Andres Gomez <[email protected]> Acked-by: Eric Engestrom <[email protected]> Acked-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* egl/dri2: Don't dlclose() the driver on dri2_load_driver_common failureAdam Jackson2019-10-031-3/+2
| | | | | | | | | | | | | | | | ... because it's wrong to do so. The error path out of dri2_initialize_drm ends with dri2_display_destroy, which calls functions in the vtable we're trying to set up, so if we dlclose the driver then those function pointers will point off into space and things crash. Noticed this because after !1923 eglinfo would crash when setting up the GBM platform. This was something of a cascade failure, because my kernel is too old for DRM_IOCTL_I915_GETPARAM to work without DRM_AUTH, so i965 wouldn't load. platform_drm.c then got very confused when it tries to load swrast as a dri2 driver. Reviewed-by: Eric Anholt <[email protected]>
* egl/gbm: Fix config validationRobin Murphy2019-10-011-2/+4
| | | | | | | | | | | | | In converting to shift/size-based validation, we lost a condition from the ARGB/XRGB equivalence check, which left it working one way round but not the other, and broke applications like glmark2-es2-drm on some platforms. Restore the equivalent check that *both* configs actually have an alpha channel before considering a mismatch. Fixes: 7b4ed2b513ef ("egl: Convert configs to use shifts and sizes instead of masks") Signed-off-by: Robin Murphy <[email protected]> Reviewed-by: Adam Jackson <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl: Fix implicit declaration of ffsKevin Strasser2019-09-301-0/+1
| | | | | | | | | | Found when building for Android in C99 mode. Include bitscan.h to ensure ffs is available. Fixes: 7b4ed2b5 ("egl: Convert configs to use shifts and sizes instead of masks") Signed-off-by: Kevin Strasser <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* meson: fix logic for generating .pc files with old glvndDylan Baker2019-09-251-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]>
* 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]>