summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl/platform
Commit message (Collapse)AuthorAgeFilesLines
* QEglPlatformContext: Also check for GL_EXT_ROBUSTNESSDavid Redondo9 days1-1/+14
| | | | | | | | | | | | | EGL_EXT_create_context_robustness says that on GLES GL_EXT_robustness is required - indeed the nvidia driver only exposes the EXT variant on GLES. Without this a context with reset notification is created but it's not reported via its format, this has impact when further contexts sharing with it are created which need to match its robustness. Pick-to: 6.11 6.10 Change-Id: I4d78a885777e8318d4a029849af4e6ad15de402f Reviewed-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Support graphics reset notifications on EGLDavid Edmundson2025-09-172-51/+200
| | | | | | | | | | | | | | | If a GPU hangs or is reset, this flag ensures the application is notified with a context loss event. This can then be queried by platforms to make use of Qt's existing reset handling. This is opt-in by applications based on the ResetNotification flag on the requested format. If a robust context cannot be created, it falls back to trying without this flag and the state is reflected in the retrieved surfaceFormat matching the behavior of GLX. Pick-to: 6.10 Change-Id: Idd53d275be8842f2d44bcd2b8c077c3ea19ca164 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* EGL: undef X11 macrosGiuseppe D'Angelo2025-05-301-0/+14
| | | | | | | | | | | Including egl.h may transitively include X headers which define a bunch of macros that clash against our code. Undef these macros just after EGL is included. This was already done locally in eglfs, but the same problem appears in any code that uses qt_egl_p.h, like the Wayland platform plugin. Change-Id: I2fbd617f57de6ae7366795aabacd81c639903699 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Add support for using static EGL libraries on VxWorksKarim Pinter2025-03-181-1/+1
| | | | | | | | | | | | | | | On VxWorks there is dlopen, but the feature can be turned off for static builds, so Qt can use EGL even when dlopen is not present. In qeglplatformcontext.cpp dlsym needs dlopen feature. There is no dlopen on windows neither on Integrity. Task-number: QTBUG-134671 Pick-to: 6.8 6.9 Change-Id: I7ced5f53ca21a8b0ceb25732ed4b1dc6c0bb1300 Reviewed-by: Janne Roine <janne.roine@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Kimmo Ollila <kimmo.ollila@qt.io> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Replace QPair/qMakePair with std::pair in qtbase/guiIsak Fyksen2025-01-091-1/+1
| | | | | | | | Task-number: QTBUG-115841 Pick-to: 6.9 Change-Id: Iebd96760ff7b3d7674816553312ba8dc3229c86a Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Clear VxWorks MESA display artifacts on startupMichał Łoś2024-10-151-0/+15
| | | | | | | | | | | | | | | | | | | | | This cherry-pick is a preparatory change as eglfs is not yet enabled on Intel VxWorks. Cherry-picked commit e39f3ebba61acddea2e6dfe6e9506ce0441bfd8b Author: Cliff Bilbrey <cliff.bilbrey@qt.io> Date: Fri Jun 9 13:56:14 2023 -0500 Display artifacts are sometimes seen at startup in VxWorks applications that make use of the MESA OpenGL libraries. This issue has been demonstrated in the Wind River MESA OpenGL demos, which use the same technique incorporated here to mask the problem. Cyling through the complete set of framebuffers and clearing each during the initialization process creates a clean slate that prevents the artifacts from being noticeable to the end user. Task-number: QTBUG-115777 Change-Id: Ifce9074eac687c002c215c531ddff1443a4df6a0 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Gui: Make more logging categories staticUlf Hermann2024-06-241-1/+1
| | | | | | | Non-static, non-forward-declared logging categories are deprecated. Change-Id: I818ab0b192bed72e6a0ecdda2bb288bce1110a4c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Misc.: Fix some narrowing integral conversion warningsAhmad Samir2023-04-251-4/+4
| | | | | | | Drive-by change: use QByteArrayView instead of allocating a QByteArray. Change-Id: Iaf7acbbdb4efbb101b73b30061ce38dd1fa99ca3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Default NVidia EGL to GLES2Allan Sandfeld Jensen2023-04-121-2/+6
| | | | | | | | | | | | | Found some documentation saying NVidia provided desktop GL for development purposes only, and recommmended against using it. Not sure if that applied to all NVidia drivers, or only that one embedded platform, but since we have multiple bugs about EGL not working on NVidia, default to using GLES2 like it suggested. Change-Id: If8ac8dd61c4ceb88162360f1eaa2a096acefa9c6 Pick-to: 6.5 6.2 Fixes: QTBUG-105921 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Add QEGLContext::invalidateContextThomas Senyk2023-01-121-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | QEGLContext::invalidateContext will mark that egl context is invalide and trigger SceneGraph to destroy it, create a new one and re-create and re-upload all resources (e.g. textures) associated with the current state of the SceneGraph In addition this change also improves QEglFSWindow::invalidateSurface() and QEglFSContext::eglSurfaceForPlatformSurface(..) Where QEglFSWindow::invalidateSurface() will now destroy the corresponding EGLSurface via eglDestroySurface, including "unbinding" it from the current thread via eglMakeCurrent and un-setting the screen's EGLSurface in case it's the same resource. QEglFSContext::eglSurfaceForPlatformSurface(..) will now call QEglFSWindow::resetSurface() in case of getting a EGL_NO_SURFACE from the QEglFSWindow (which happens if above invalidateSurface() was called before) - therefor re-creating the resource if it was destoyed via QEglFSWindow::invalidateSurface() Pick-to: 6.5 Change-Id: I37badd1fc11e993c395fb1502e9bd27ebe18b821 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* qputenv: port to QByteArrayViewMarc Mutz2022-08-061-1/+1
| | | | | | | | | | | | | | | | | | | | The vast majority of in-tree users pass simple and short C string literals as the value. By porting to QByteArrayView, we document that we'll accept non-NUL-terminated data, and do the NUL-termination internally, using SSO'ed std::string, saving memory allocations in the common case of short strings. I didn't bother to check which direction std::string takes for nullptrs these days (there was a change accepted in that area for C++20 or 23), so play it safe and protect against them. Follow-up to Task-number: QTBUG-105302 Change-Id: I2369acc62f1d5cbc26135396cfe0602d8c75300c Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Make EGL use Qt X connection without xcb_xlib with EGL_EXT_platform_xcbIlya Fedin2022-07-051-0/+4
| | | | | | | | This allows to create EGL context without involving Xlib. This extension was created a year ago and is present in Mesa since 21.0 Change-Id: I7cb0aece1e67b4db59d453cbcfbd317bb5d9c777 Reviewed-by: Liang Qi <liang.qi@qt.io>
* Port QXlibEglIntegration::getCompatibleVisualId to xcbIlya Fedin2022-06-202-163/+0
| | | | | | | | | | In combination with EGL_EXT_platform_xcb support, this allows xcb_egl to be used without xlib. Without EGL_EXT_platform_xcb support, this still reduces amount of code using xlib. Pick-to: 6.4 Change-Id: I29e2b29f7ef8ea34320887f62697f84232b86fba Reviewed-by: Liang Qi <liang.qi@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-1613-494/+26
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* egl: Remove the disabling of surfaceless contexts for MesaLaszlo Agocs2022-04-271-9/+0
| | | | | | | | | The current check is based on the state of things in 2015, we will assume that this is no longer an issue with more modern Mesa versions. Change-Id: I60c4966eea817a6df1a1edf6064a978fbcd44cf7 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Make sure all qtbase private headers include at least one otherThiago Macieira2022-02-242-0/+2
| | | | | | | | | | See script in qtbase/util/includeprivate for the rules. Since these files are being touched anyway, I also ran the updatecopyright.pl script too. Change-Id: Ib056b47dde3341ef9a52ffff13ef677e471674b6 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Revert "Add support for EGL_EXT_platform_xcb"Paul Olav Tvete2021-11-021-4/+0
| | | | | | | | | | | This reverts commit 816c5de460439faac0745cb364c374162b7fc651. Reason for revert: Causes crash on Nvidia when Qt is configured with -opengl es2 Fixes: QTBUG-97738 Change-Id: I9fe43146b922fc770890a144fdb1bd1c564635bb Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Add support for EGL_EXT_platform_xcbIlya Fedin2021-10-061-0/+4
| | | | | | | | This allows to create EGL context without involving Xlib. This extension was created a year ago and is present in Mesa since 21.0 Change-Id: Id9bcbffe8c46cb00d9cc0a9a425c1706d1b52b28 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Cater for upstream changes in eglplatform.hLaszlo Agocs2021-09-211-1/+5
| | | | | | | | | | | | | EGL_NO_X11 has been replaced with USE_X11, thus breaking all existing code out there, including Qt: https://github.com/KhronosGroup/EGL-Registry/pull/130 Fix this by defining USE_X11 whenever we do not define EGL_NO_X11. Fixes: QTBUG-96392 Pick-to: 6.2 Change-Id: If8b68caa8c9022477d87169ca2e2a0121a9313e0 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Remove conditioning on Android embeddedEdward Welbourne2021-09-171-2/+2
| | | | | | | | It is no longer handled separately from Android. This effectively reverts commit 6d50f746fe05a7008b63818e77784dd0c99270a1 Change-Id: Ic2d75b8c5a09895810913311ab2fe3355d4d2983 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Expose the config and display for EGL-based QOpenGLContextsLaszlo Agocs2021-09-131-0/+2
| | | | | | | | | | | | | | | | ...in the native interface. Using OpenXR is impossible on some platforms (for example, Android) without knowing all three. The EGLContext alone is not enough, and EGL offers no way to query the EGLConfig a context was created with. https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XR_KHR_opengl_es_enable Therefore, expose all three so libs/apps can use the new way to query these native resource without resorting to the old-style nativeResourceFor* queries. Change-Id: I7efb0a26b858150da55e711752af99426e744322 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Support EGL protected content extensionElvis Lee2021-03-091-0/+11
| | | | | | | | | | | | | | | | | | | | A protected context is required to allow the GPU to operate on protected resources, including protected surfaces and protected EGLImages. For example, GPU can post-process on protected content like DRM protected content so that complex, nonlinear video effects or mapping onto textures can be used. The surface format option may be relevant for DirectX and Vulkan in the future: https://microsoft.github.io/DirectX-Specs/d3d/ProtectedResources.html https://www.khronos.org/registry/vulkan/specs/1.1-khr-extensions/html/chap12.html#memory-protected-memory Change-Id: I2d155f0e68b830276690b4833b22a2bc452cdcad Reviewed-by: Elvis Lee <kwangwoong.lee@lge.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* egl: Add debug option to print all EGLConfigsLaszlo Agocs2021-02-081-0/+15
| | | | | | | | | QT_QPA_EGLFS_DEBUG=1 prints the attributes for the chosen EGLContext. Make QT_QPA_EGLFS_DEBUG=2 print the same for all EGLContexts. Pick-to: 6.1 Change-Id: Id161d04789fbd015e29e5a5a89a0901000096ea3 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Remove the qmake project filesJoerg Bornemann2021-01-073-43/+0
| | | | | | | | | | | | | | | | Remove the qmake project files for most of Qt. Leave the qmake project files for examples, because we still test those in the CI to ensure qmake does not regress. Also leave the qmake project files for utils and other minor parts that lack CMake project files. Task-number: QTBUG-88742 Change-Id: I6cdf059e6204816f617f9624f3ea9822703f73cc Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Rename the new platform APIs from QPlatformInterface to QNativeInterfaceTor Arne Vestbø2020-10-071-1/+1
| | | | | | | | | | | | We were already using the 'native' nomenclature when referring to these kinds of APIs, e.g. when talking about native handles, or the existing QPlatformNativeInterface on a QPA level. Using 'native' for the user facing APIs also distinguishes them from the 'platform' backend layer in QPA and elsewhere. Change-Id: I0f3273265904f0f19c0b6d62471f8820d3c3232e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Switch QSurfaceFormat::colorSpace to a QColorSpaceAllan Sandfeld Jensen2020-09-151-8/+15
| | | | | | | Allows more flexibility in the future. Change-Id: Idcf2d8ddaee268a7b5d55379ccb42dd9b3c33abf Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Do not expose xlib as public dependency of QtGuiJoerg Bornemann2020-09-111-1/+1
| | | | | | | | Consumers of QtGui should link explicitly to xlib if needed. Fixes: QTBUG-86421 Change-Id: Ibc94eb1c1ac405b53749b320c388b037bf693a08 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Move eglconvenience to QtGuiFriedemann Kleint2020-07-1313-0/+2667
| | | | | | | Task-number: QTBUG-83255 Change-Id: I8a008d8906308dd73a0793db5b88d3a1b6fdaf5c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Move glxconvenience into QtGuiFriedemann Kleint2020-07-104-0/+567
OpenGL is not quite as dead as initially assumed. Task-number: QTBUG-83255 Change-Id: I953040149812a5258caad5fe6bac0835e1982dd0 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>