summaryrefslogtreecommitdiffstats
path: root/src/hardwareintegration
Commit message (Collapse)AuthorAgeFilesLines
* Client: Replace a bunch of frameMargins with clientSideMarginsIlya Fedin2024-03-291-2/+2
| | | | | | | | | | | Use it wherever window coordinates should be translated to surface coordinates This also fixes the usage of QWindow::mapFromGlobal which is in wrong coordinate space while handling CSD dragging from pending touch points Change-Id: I66b114610f0e44fea10535594adb5d1284196662 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Use NO_GENERATE_CPP_EXPORTS explicitlyAlexey Edelev2024-03-252-0/+2
| | | | | | | | | | Use NO_GENERATE_CPP_EXPORTS explicitly for modules that don't need the autogenerated exports header file. Task-number: QTBUG-90492 Change-Id: I3494ac88e136126265e14ef1a380c5ef26def3ef Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Mark the whole repo with QT_NO_CONTEXTLESS_CONNECTAhmad Samir2024-02-151-3/+2
| | | | | | | | | | | | | | | | | | | | By adding it to the default build flags via .cmake.conf. tst_primaryselectionv1 and tst_datadevicev1: the connection type needs to be explicitly set to DirectConnection, otherwise the test fails. The sender and receiver are the same object, so typically would be in the same thread. The docs say: "If the receiver lives in the thread that emits the signal, Qt::DirectConnection is used." I suspect because the code is running inside CoreCompositor::exec() the signaling thread is different from the thread the objects live in, so leaving the type as AutoConnection when sender/receiver are the same object doesn't lead to the type becoming DirectConnection. Task-number: QTBUG-116296 Change-Id: Iad49889134a78fa723973ba6efbc237038f35b82 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* client: Disable threaded GL on desktop NVIDIADavid Redondo2024-02-011-0/+7
| | | | | | | | | | | | | | Otherwise QtQuick windows freeze when resized. In order to still use threaded rendering on embedded platforms where resizing is not required we check if XDG_CURRENT_DESKTOP which should be set by desktop environments. Task-number: QTBUG-95817 Pick-to: 6.7 6.6 6.6.2 Change-Id: Ic2348c3169e0ade8c5463e3d7c7a1c45037a89a7 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: David Edmundson <davidedmundson@kde.org>
* client: Fix deletion of new queued shm buffers during reconnectDavid Redondo2024-01-242-2/+2
| | | | | | | | | | | | | | | | | | | | | | | When reconnecting the cleanup of existing buffers is delayed in order to preserve contents and copy them to buffers belonging to the new connection. Due to the order of events it could happen that a new buffer was deleted along with the old ones but still being referenced by a window. During reconnect all QScreens are removed and new ones added for the wl_outputs on the new connection during the initial roundtrips. When the first new QScreen is added all QWindows move form the placeholder screen to it. This can cause for example QWidgets to repaint. At this point the windows are not reinited yet, and the buffer is queued inside the window. Only afterwards the reconnected signal was emitted which would cause deletion of all existing buffers including the newly queued ones. To fix this the signal is moved after the first roundtrip where all globals are announced and new buffers can be created but no new screens have been announced yet. The signal is renamed to be more fit for its new location. Pick-to: 6.7 Pick-to: 6.6 Change-Id: I06be14d235ac342a4b420176aadad3ccf18178fe Reviewed-by: David Edmundson <davidedmundson@kde.org>
* client texture cleanup: fix crash in clean-up lambdaThomas Senyk2024-01-182-0/+4
| | | | | | | | | | | | | | | | | | The dtor of WaylandEgl[Stream]ClientBuffer used to only clean-up the aboutToBeDestroyed-connection/lambda if it's integration is still present. This was a pointless condition as that clean-up is not depending on the integration and can lead to access of dead memory (when the Buffer is already deleted but the lambda is then later called due to QOpenGLContext::aboutToBeDestroyed) Fixed by moving the clean-up into it's own scope (needs a scope due to QMutexLocker) Pick-to: 6.7 6.6 6.5 Change-Id: Ib3b6e54365f66484f249ee449cb3b27029f5ce7c Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* client: Avoid creating decorations in the render threadDavid Edmundson2024-01-111-2/+0
| | | | | | | | | | | | | | | | | createDecoration is called when on the main thread from when window flags change, implicitly from initWindow, and also every handleWindowStatesChanged which will be called when we get the first configure event in an xdg shell. There is no need to create the decoration in QWaylandGLContext::makeCurrent. Any current call to makeCurrent before the platform window is shown will not create a decoration as there's a check for a shell surface. Any call afterwards will have already been handled by initWindow. Similarly the SHM backend store does not need to handle decorations itself. Fixes: QTBUG-105703 Pick-to: 6.7 Pick-to: 6.6 Change-Id: I644cece28277131cf7a65eaa234ff08c8431d544 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* QWaylandEglWindow: Pass window surface format to q_glFormatFromConfigKai Uwe Broulik2024-01-091-1/+1
| | | | | | | | | Otherwise it disregards the window's swap interval preference. Fixes: QTBUG-120477 Pick-to: 6.7 6.6 6.5 Change-Id: Icc6b192f9f317a80acdf4b588ee3f1c26f2ddf0a Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Don't use Qt keywords in headersKai Uwe Broulik2023-12-181-1/+1
| | | | | | | | | | | | | Unfortunately for many Wayland features applications need to access Qt private headers which will fail if the project is built with QT_NO_KEYWORDS. Ideally, the examples and tests were ported, too, and QT_NO_KEYWORDS enabled in .cmakec.conf. Pick-to: 6.7 Change-Id: I9f988d304bcc8dba4dd84761c41ba3da2473515d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Don't lock render thread when blocking swap is usedEskil Abrahamsen Blomfeldt2023-12-131-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | By default, Qt will use a non-blocking eglSwapBuffers() and implement our own frame event mechanism with a time-out. When the blocking version of eglSwapBuffers() is in use (either because it's manually enabled or because the driver does not support the alternative), it depends on the main thread to poll events, as it will wait indefinitely for a frame callback. This is incompatible with our locking of the surface for the duration of the frame, since we may end up locking the main thread in QWaylandWindow::reset() during shutdown while the render thread is simultaneously locked in eglSwapBuffers(). The lock was implemented to work around a bug in one family of graphics drivers, so we simply disable it when blocking eglSwapBuffers() is used. If we need to put this back, we would need a more advanced approach and make sure we continue to poll events even while we're waiting for access to the surface. Pick-to: 6.5 6.6 6.7 Fixes: QTBUG-118890 Change-Id: I04f7d2b168726d82c38fe3fafd350dcab928b956 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Warn if eglSwapBuffers failDavid Redondo2023-11-241-1/+2
| | | | | | | | | This failing was the cause of windows freezing on NVidia. If it happens for some other reason we can now see why. Pick-to: 6.6 Change-Id: Iabd44b1b3f73a54adac3024436ffe116ca15d21a Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Reimplement orphaned texture handlingThomas Senyk2023-09-185-225/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous implementation was a bit error prone (there was a reproducable "dead pointer" issue) and had duplicated code (dma, egl and eglstream share the same code). The new implementation fixes both issues (and more): - no more 'this' capture on a lambda where the 'this' isn't an object and hence can go out of scope without the lambda knowing. - no more duplicated code as we now have a singleton as our orphanage: QWaylandTextureOrphanage 3 (dma, egl, eglstream) HW-integrations use this singleton - the class itself as well as it's container are thread-safe by the usage of QMutex/QMutexLocker. This also includes the deletion code within the orphanage. As the orphanes are 100% owned by the orphanage, they are protected from double deletion. - The cleanup due to QOpenGLContext::aboutToBeDestroyed is now ctx specific, no more lamdba-per-texture. Change-Id: I36e82fae796864319bed7ebdb5154e93dbe96394 Pick-to: 6.6 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* eglwindow: update integration in a connection instead of reinitDavid Redondo2023-05-172-7/+4
| | | | | | | | | Since m_clientBufferIntegration is not initialized from QWaylandWindow::initSurface it doesn't make sense to update it in reinit. It needs to update the member regardless of reinit is called or not. Change-Id: I1d6a6f1818cf8cdedafaa6375292d96c21c9b527 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Introduce path for surviving compositor restartsDavid Edmundson2023-03-074-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces an optional mechanism for clients to survive a crash and reconnect seemingly seamlessly. In the event of a disconnect from the compositor socket we simply try to reconnect again and replay any data needed so that we maintain a consistent state to where we left off. From an application point-of-view any open popups will be dismissed and we we potentially get a new framecallback, but it will be almost entirely transparent. Users of custom QWaylandClientExtensions will be notified via the activeChanged signal and rebuild as though the compositor had withdrawn and re-announced the global. OpenGL contexts will be marked as invalid, and handled the same way as a GPU reset. On the next frame RHI will notice these are invalid and recreate them, only now against a new wl_display and new EGLDisplay. Users of low level EGL/native objects might be affected, but the alternative at this point is being closed anyway. The entire codepath is only activated via an environment variable. Change-Id: I6c4acc885540e14cead7640794df86dd974fef4f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Suppress QSharedMemory deprecation warningsMårten Nordheim2023-03-022-3/+5
| | | | | | | | | | | Since some consumers/producers may be using the old API we will use that and suppress the warnings. Reverts 904b9d33dc0ac97b01c811f0bcb8f67f824b052b Change-Id: Ia59fcb241ca991b8f096a07de4946c49f7997d72 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* client: Cleanup CSD contentFBO on surface hideDavid Edmundson2023-03-021-0/+2
| | | | | | | | | | | Otherwise we're wasting a large amount of memory. It will be recreated on the next show. This is also needed for handling compositor reset support where the framebuffer needs recreating. Change-Id: Ia684266f6f7998b0d62d177faf182efdfeaa0f06 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Move setup functions from local to memberThomas Senyk2023-02-272-5/+7
| | | | | | | | | | | | | | Two functions with the same name and signiture were committed in two files. Normally this isn't an issue as those symbols end up in different plugins, however for a static Qt build all are linked into the same binary => symbol clash! Changing those functions to member functions of the respective private classes resolves this issue. As the original name was rather long, it was also shorted in the process. Fixes: QTBUG-111473 Pick-to: 6.5 Change-Id: I0f341a64199637a415898309763f9b5416fc4be1 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* QOpenGLContext re-creation - orphanedTexturesThomas Senyk2023-02-206-13/+381
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The texture clean-up in the HW-integration has two issues when QOpenGLContext is re-created. 1. texture going out-of-date (QOpenGLContext::aboutToBeDestroyed) and still being used/returned to be used 2. QOpenGLContext dies (QOpenGLContext::aboutToBeDestroyed) while an "discarded" QOpenGLTexture (an orphan) isn't deleted yet. (you can't delete a texture past it's ctx's QOpenGLContext::aboutToBeDestroyed) This patch fixes both issues with a helper and a lambda on 3 HW-integration-backends: wayland-egl, wayland-eglstream and linux-dmabuf Fix for 1.: Simple connection to a lambda that deletes the texture and removes them from the set of used textures. Signal is QOpenGLContext::aboutToBeDestroyed Fix for 2.: A function in each backend: deleteSpecificOrphanedTexture(QOpenGLTexture *texture) Also connected/called by QOpenGLContext::aboutToBeDestroyed Deletes the texture (before deleteOrphanedTextures() does it too late) and removes the dead pointer from the orphanage Pick-to: 6.5 Change-Id: Iccce8845bb669df93f1be43cbe9b9d25f7fd5235 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Disambiguate Vulkan debug constantsFriedemann Kleint2023-02-133-34/+34
| | | | | | | | | They cause clashes in CMake Unity (Jumbo) builds. Pick-to: 6.5 Task-number: QTBUG-109394 Change-Id: I4dfef40309a42b8fa662dfa3d99b65d920480aba Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Do not use deprecated QSharedMemory constructorFabian Kosmale2023-02-011-1/+1
| | | | | | Change-Id: Ic2c2ee4256aa16ebfeb51b3c2f7a3430d4104091 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-102-3/+3
| | | | | | | | | | | | | | We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace. Task-number: QTBUG-99313 Change-Id: Ia64c6615ee81f7ad5d0658449b0ee347c3db8c29 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Port from container::count() and length() to size()Marc Mutz2022-10-105-5/+5
| | | | | | | | | | | | | | | | | | | | | This is a semantic patch using ClangTidyTransformator as in qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8: auto QtContainerClass = anyOf( expr(hasType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes))))).bind(o), expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o)); makeRule(cxxMemberCallExpr(on(QtContainerClass), callee(cxxMethodDecl(hasAnyName({"count", "length"), parameterCountIs(0))))), changeTo(cat(access(o, cat("size"), "()"))), cat("use 'size()' instead of 'count()/length()'")) a.k.a qt-port-to-std-compatible-api with config Scope: 'Container', with the extended set of container classes recognized. Change-Id: I574208abc90a8042b500b3f96e3862b0ff339eb6 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Hold surface read lock throughout QWaylandEglWindow::updateSurfaceDavid Edmundson2022-09-121-2/+4
| | | | | | | | | | | | | | | | | QWaylandEGLWindow::updateSurface is called from both the main and render threads. It is called on the render thread when making the surface current, which could be after the window is hidden if there are cleanup jobs to be done. Whilst the getter wlSurface() holds a read lock, it's not enough as we need the instance alive between the two calls and throughout the mesa code. This potentially fixes a crash seen in mesa where we crash creating a surface for an invalid wl_surface object. Change-Id: I497356e752ffaf3549d174f10c4c268234b02cbd Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Change the license of all CMakeLists.txt and *.cmake files to BSDLucie Gérard2022-08-235-5/+5
| | | | | | | Task-number: QTBUG-105718 Change-Id: Icb25ea4e07a38eea81f55ed59c6d3b9d37602626 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* QWaylandGLContext: print the 0x prefix in error codeThiago Macieira2022-08-101-2/+2
| | | | | | | | | So it's not ambiguous that this is hex, in messages like: "WARNING: QWaylandGLContext::makeCurrent: eglError: 3003" Pick-to: 6.4 Change-Id: Ie4bb662dcb274440ab8bfffd1709ba0415c3d790 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Add license headers to cmake filesLucie Gérard2022-07-085-0/+15
| | | | | | | | | | | | CMakeLists.txt and .cmake files of significant size (more than 2 lines according to our check in tst_license.pl) now have the copyright and license header. Existing copyright statements remain intact Task-number: QTBUG-88621 Change-Id: Ib014757184540728f40df71cd580f01e85fbbb56 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Remove unused variablesEskil Abrahamsen Blomfeldt2022-06-281-2/+0
| | | | | | | | | They appear to have been around and unused forever, but I've started getting warnings (-are-errors) about this. Pick-to: 6.4 6.3 6.2 5.15 Change-Id: I2f3006aa47de24927d7edd2d7f43cff78f965f87 Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Fix build with libcxx (missing array include)Sam James2022-06-201-0/+2
| | | | | | | | | Bug: https://bugs.gentoo.org/833488 Task-number: QTBUG-104435 Change-Id: I06384761a5560b81b675e6c4ae498bb93dcb4f4f Pick-to: 5.15 6.2 6.3 6.4 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Use SPDX license identifiersLucie Gérard2022-06-1051-1658/+102
| | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. License files are organized under LICENSES directory. Pick-to: 6.4 Task-number: QTBUG-67283 Change-Id: I106d3a5d1a7b96250380b6f51a48f3b19d10e4d9 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* QtWaylandEglClientHwIntegrationPrivate: includemocsLiang Qi2022-06-011-0/+2
| | | | | | | Pick-to: 6.3 6.2 5.15 Task-number: QTBUG-103295 Change-Id: I27804dc4a26050931ff7d99aaee319d88b254b00 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Replace QScopedPointer with std::unique_ptrThiago Macieira2022-05-111-5/+5
| | | | | | | | | | | | | As the warning asked. qwaylandshellintegrationfactory.cpp:67:28: warning: ‘T* QScopedPointer<T, Cleanup>::take() [with T = QtWaylandClient::QWaylandShellIntegration; Cleanup = QScopedPointerDeleter<QtWaylandClient::QWaylandShellIntegration>]’ is deprecated: Use std::unique_ptr instead, and call release(). [-Wdeprecated-declarations] As a drive-by, change *foo.get() to *foo. Pick-to: 6.3 6.2 Change-Id: I7fb65b80b7844c8d8f26fffd16e97fe161d6a67a Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Allow multiple client buffer integrations to initializeEskil Abrahamsen Blomfeldt2022-05-034-25/+23
| | | | | | | | | | | | | | | | | | | | | | | | | This amends 585f20dce37c398d8b2e6367008e3329dac79e24 where support for multiple client buffer integrations was added. Previously, this would not work unless you also set QT_WAYLAND_IGNORE_BIND_DISPLAY in the environment, because we would fail if eglBindWaylandDisplayWL() returned false, which it will when the display is already bound. Instead, we assume the display is correctly bound when the function returns false, and then we make sure we unbind from the same integration that originally did the bind. The patch adds unbind to the destructor of linux-dmabuf and eglstream integrations. This was previously missing. [ChangeLog][QtWaylandCompositor] Enabled support for multiple client buffer integrations without the need to set the QT_WAYLAND_IGNORE_BIND_DISPLAY environment variable. Fixes: QTBUG-101366 Change-Id: Iefeb865b540d96a55d3be9b9c1fb41bf388638ca Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* QtWaylandClient: use the CMake exports.h supportThiago Macieira2022-04-283-3/+3
| | | | | | | | | | | | The one in qtwaylandglobal.h was wrong. It just happened to work on Linux because the lack of import wasn't an error... until GCC 12 with -mno-direct-extern-access. Pick-to: 6.3 Change-Id: If05aeeb7176e4f13af9afffd16e8535b469f9158 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* wayland: do not rely on transitive includesFabian Kosmale2022-03-113-0/+3
| | | | | Change-Id: I149e04d31ef3e897e25a91450427237069af4c34 Reviewed-by: Liang Qi <liang.qi@qt.io>
* QtWaylandCompositor: use cmake-generated export headersMarc Mutz2022-02-141-2/+2
| | | | | | | | Pick-to: 6.3 Change-Id: Ifda9223dbf9d7c615de6540250a23a6687daecd7 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Do not delete window decorations before next updateInho Lee2022-02-091-8/+10
| | | | | | | | | | | | | When window decorations are turned on/off, a timing issue might happen with accessing deleted decorations. A boolean value, mWindowDecorationEnabled, will be used instead of mWindowDecoration. Pick-to: 6.3 6.2 Fixes: QTBUG-59627 Change-Id: I5514a408d89340fdbf481721ea2dc4bf62078852 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Don't keep eglConfig in hardwareintegrationInho Lee2022-01-254-18/+11
| | | | | | | | | | | | There is no reason to keep eglConfig value as a member variable. Even this can result in creating wrong surface from the current surface. And it makes no sense to change alpha bits of the surface format by supporting decorations. Task-number: QTBUG-97916 Pick-to: 6.3 6.2 5.15 Change-Id: Iaa395d36e83373ea197dc5e14424fcb62cd2cd8b Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* wayland-egl: fix build with recent eglplatform.hSamuli Piippo2022-01-171-0/+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 QtGui/private/qt_egl_p.h now defines USE_X11 whenever we do not define QT_EGL_NO_X11. See also 4cc5428548cb8ab973e4b0281dd123d59bfaf6a0 in qtbase. Fixes: QTBUG-99746 Pick-to: 6.3 6.2 Change-Id: If67b9f1f37dac59bb518010fec08944bc181766d Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* client: Fix crash on shutdown on Mesa driverEskil Abrahamsen Blomfeldt2021-12-212-12/+28
| | | | | | | | | | | | | | | | | | | | | On Wayland, then the mesa driver is in use, calling eglDestroySurface() while OpenGL commands are being executed may crash. While this means the driver does not operate by the specs in this case, the driver is so popular that it makes sense to work around it. To work around this, we read-lock the surface while rendering and wait for a write-lock before we destroy the EGL surface. [ChangeLog][QtWaylandClient] Fixed a crash on shutdown that could happen with some graphics-heavy applications when running on Mesa drivers. Pick-to: 6.3 Fixes: QTBUG-92249 Change-Id: I8b8461066cc9f948dc44ddeeddaa6e7d92b76f04 Reviewed-by: Liang Qi <liang.qi@qt.io>
* Remove the XComposite buffer sharing extensionPaul Olav Tvete2021-12-0729-2318/+0
| | | | | | | | | | | | | These extensions were disabled because they did not work properly and they are no longer very useful. It does not make sense to keep non-functional code around when it is unlikely to be fixed. [ChangeLog][Extensions][The xcomposite-egl and xcomposite-glx shell extension protocols have been removed.] Task-number: QTBUG-97985 Change-Id: I0ad37bd2b35551d7b2b1e5e7d4e77a51037864ad Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Introduce new qt-shell and an API for custom shellsPaul Olav Tvete2021-12-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | Adds a new API for writing custom shell extensions. This API is supported, but semi-public. Binary compatibility is not guaranteed. Also adds qt-shell, a new shell that maps directly to the QWindow API, and provides functionality that Qt provides on other window systems, such as absolute window positions and window activation. This shell is not intended for use on the desktop. This is a squashed commit of a development branch consisting of approximately 60 changes. Contributors: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Paul Olav Tvete <paul.tvete@qt.io> Task-number: QTBUG-94330 Task-number: QTBUG-91542 Change-Id: I419b6bd8179fe03e4da47d328c7ff4b4795b8a91 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: David Edmundson <davidedmundson@kde.org> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* linux-dmabuf-unstable-v1: Fix importing dmabuf buffers with modifiersAlexandros Frantzis2021-06-291-68/+61
| | | | | | | | | | | | | | | | | | | | | | | | Depending on the used modifiers, there are cases where dmabuf buffers may be transported as multiple dmabuf planes, although they are conceptually single plane buffers. An example of a modifier that works like this is I915_FORMAT_MOD_Y_TILED_CCS. In such cases we need to create a single EGLImage by merging all the dmabuf planes. Almost all of the currently supported DRM formats are conceptually single plane, so they require such merging of the dmabuf planes. The only formats that need to be mapped to multiple EGLImages are some YUV based ones, which we are already importing in a different way (see initYuvTexture). In addition, ensure that we don't pass to EGL a modifier value of DRM_FORMAT_MOD_INVALID, since this is not an acceptable value. To indicate a lack of modifiers skip the relevant EGL_DMA_BUF_*_MODIFIER_* attributes altogether. Sponsored-by: LG Electronics Inc. Change-Id: I32a717f3be20927f2f3f4aa0fc6c4f7a5250db33 Pick-to: 5.15 6.1 6.2 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Use QEventPoint::State instead of Qt::TouchPointStateJiDe Zhang2021-06-252-0/+4
| | | | | | | | | Also fix compile warnings about -Wenum-compare. Pick-to: 6.2 6.1 6.0 5.15 Change-Id: I5e94fc028c727b155d5db4c7def35d518c497c5c Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Remove forward declaration for classes that don't exist anymoreAlbert Astals Cid2021-06-182-2/+0
| | | | | | Change-Id: I06bd8056a9892d0affe92ddc262def9d42a471fa Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Add "We mean it" to private headersFabian Kosmale2021-06-035-0/+56
| | | | | Change-Id: Ia5c21421be7bc546b04002932dd5571464152635 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Add the 'Private' suffix to the internal module namesAlexey Edelev2021-05-312-4/+4
| | | | | | | | Rename internal modules to adjust their names to the internal module policy. Change-Id: Ib9604c0b0dbd2a216d48df3797e912983f7e3c8f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Enhance QWaylandQuickHardwareLayer supportElvis Lee2021-05-311-1/+1
| | | | | | | | | 1. method to re-enable scenegraph painting 2. method to initialize in native level Change-Id: Ia680c25d327608fd9163b46f3d1051d44dc759a8 Reviewed-by: Elvis Lee <kwangwoong.lee@lge.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* client: Gracefully handle shutdown and window hidingEskil Abrahamsen Blomfeldt2021-05-271-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | When a window is hidden or destroyed, the render thread may already be rendering. We need to properly read-lock the surface pointer when it is in use and exit when it becomes null. Note that there is also a potential crash in the Mesa GL driver where it keeps a proxy to the wl_surface, so if we delete this while we are still rendering, it can crash inside the driver. This is not addressed by this patch, and has not been reproduced on any other drivers so far. [ChangeLog][Client] Fixed a crash that could happen when hiding or closing windows while Qt Quick was actively rendering on a different thread. Pick-to: 6.0 6.1 5.15 Fixes: QTBUG-91264 Fixes: QTBUG-90037 Task-number: QTBUG-92249 Change-Id: I029b123b83c58740321e8b90a463ced748d8bcf4 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: David Edmundson <davidedmundson@kde.org>
* Export wayland-egl compositor hwintegrationElvis Lee2021-04-296-6/+34
| | | | | | | | Support wayland-egl compositor hwintegration as a module for external build Change-Id: I794ad4eb38fc2dda31ace1b0eeb2e001020d0956 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Export wayland-egl client hwintegrationElvis Lee2021-04-2811-18/+54
| | | | | | | | | | | Support wayland-egl client hwintegration as a module for external build. Change-Id: I3e82838d0cc89d4bb1435b835dc1e9b592319ddf Reviewed-by: Elvis Lee <kwangwoong.lee@lge.com> Reviewed-by: Jaeyoon Jung <jaeyoon.jung@lge.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>