summaryrefslogtreecommitdiffstats
path: root/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp
Commit message (Collapse)AuthorAgeFilesLines
* client texture cleanup: fix crash in clean-up lambdaThomas Senyk2024-01-181-0/+2
| | | | | | | | | | | | | | | | | | 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>
* Reimplement orphaned texture handlingThomas Senyk2023-09-181-78/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Move setup functions from local to memberThomas Senyk2023-02-271-3/+4
| | | | | | | | | | | | | | 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-201-6/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Use SPDX license identifiersLucie Gérard2022-06-101-28/+2
| | | | | | | | | | | 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>
* Allow multiple client buffer integrations to initializeEskil Abrahamsen Blomfeldt2022-05-031-9/+2
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* wayland: do not rely on transitive includesFabian Kosmale2022-03-111-0/+1
| | | | | Change-Id: I149e04d31ef3e897e25a91450427237069af4c34 Reviewed-by: Liang Qi <liang.qi@qt.io>
* Export wayland-egl compositor hwintegrationElvis Lee2021-04-291-1/+1
| | | | | | | | Support wayland-egl compositor hwintegration as a module for external build Change-Id: I794ad4eb38fc2dda31ace1b0eeb2e001020d0956 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Support EGL protected contentYoungjin Kim2021-03-151-1/+21
| | | | | | | | | | If a buffer has a protected content like DRM decoded video, the EGL Protected content extension allows GPU to operate on the buffer. With that, wayland-egl can get EGL image and texture from protected content. Change-Id: Ia687fc4ebc348cb03450e06713040acaa34b1cab Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Clear dirty flag to protect original textureJungi Byun2021-02-041-0/+1
| | | | | | | | | | | | If the dirty flag is kept as true, a texture which is rendered in a thread might be ruined by "glEGLImageTargetTexture2DOES" by another rendering thread. This can cause an undefined behavior like a crash in GPU driver. As same as SharedMemoryBuffer, change the dirty flag into false in WaylandEglClientBuffer and LinuxDmabufClientBuffer. Change-Id: I2deb09703174e6257c13cc0bb542a90f0956c1c2 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Support multiple buffer integrationsPaul Olav Tvete2020-08-261-1/+4
| | | | | | | | | | | | | Allow compositors to support more than one type of hardware client buffer integration. [ChangeLog][QtWaylandCompositor] QtWaylandCompositor now supports multiple client buffer integrations. QT_WAYLAND_CLIENT_BUFFER_INTEGRATION will now accept a semicolon-separated list. Fixes: QTBUG-68846 Change-Id: Iff1fa0a45b01f6a45dd744c37a89bac7d5e70658 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Adapt to recent qtbase changes and update dependenciesFriedemann Kleint2020-07-291-1/+1
| | | | | | | | | - moving linuxaccessibility/xkbcommon/eglsupport/glxsupport to QtGui - event refactoring Task-number: QTBUG-83255 Change-Id: Ic82ee6ef5652413781468edb58c601ee7dce2e3b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Use QList instead of QVectorJarek Kobus2020-06-081-1/+1
| | | | | | Task-number: QTBUG-84469 Change-Id: I4bc7b2eb2913fc828f09f96e21480b76cabf8656 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devLiang Qi2020-04-291-10/+8
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/client/xdgoutput/tst_xdgoutput.cpp Regenerated CMake projects. Removed duplicate wayland source in tests/auto/client/xdgoutput/xdgoutput.pro. It's still referenced via the included shared.pri file. Regenerated the CMake project to adapt to that. Otherwise the CMake project fails to configure due to duplicate rules with a error like the one below CMake Error at src/compositor/Qt6WaylandCompositorMacros.cmake:13 (add_custom_command): Attempt to add a custom rule to output tests/auto/client/xdgoutput/wayland-xdg-output-unstable-v1-server-protocol.h.rule Also use a workaround fix for configuring CMake standalone tests due to regression introduced by dd7e40b1086020f6a054957f4972720cd684 in qtbase. Change-Id: Ib364b851a1fa828c153efbf8653c9e4ef5e618cd
| * Revert "Compositor: Warn and clean up when client hardware buffer ↵v5.14.2Jani Heikkinen2020-03-241-10/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | integrations fail" This reverts commit 137966a6293b50f6b248d130a2e36e67df49335e. Reason for revert: QTBUG-82948 Conflicts: src/compositor/compositor_api/qwaylandcompositor.cpp src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp Change-Id: I77e3265c336fbcdf47eb1aa5dc07f31ec41006b5 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | Fix build: Add dependency on OpenGL moduleJohan Klokkhammer Helsing2020-01-301-1/+1
| | | | | | | | | | | | | | | | | | | | Several of the QOpenGL* classes we depend on has moved to QtOpenGL, add the dependency and fix the include paths. Task-number: QTBUG-74409 Change-Id: Iab7949dd67befaa71cf2cfa041771e93f4e47160 Reviewed-by: Johan Helsing <johan.helsing@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devSimon Hausmann2019-10-311-26/+38
|\| | | | | | | | | | | | | Conflicts: src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp Change-Id: I42733f5ad9429a5d2ff6c804eb1f3f2d50f50811
| * Compositor: Use logging category in egl client integrationJohan Klokkhammer Helsing2019-10-301-16/+29
| | | | | | | | | | Change-Id: I5ad3663b3710b939f08798abad3bc985ab460e88 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
| * Remove unused variable WaylandEglClientBufferIntegrationPrivate::validJohan Klokkhammer Helsing2019-10-281-2/+0
| | | | | | | | | | Change-Id: I489267d8378cbcaf7ae7cd8eee48d4e2a71ca91a Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
| * Compositor: Warn and clean up when client hardware buffer integrations failJohan Klokkhammer Helsing2019-10-251-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We've recently seen a number of performance issues on bugreports and on the mailing list. The problem in many of these cases, is that no client hardware buffer plugin is used. I.e. it's just due to our fallback to CPU buffers when the compositor is configured incorrectly or run in a setup where hardware buffers are not available. This patch detects when client hardware buffer plugins fail and prints a warning explaining the issue to the console. This will make it easier to differentiate between expected and unexpected drops in performance and will hopefully also guide users in the right direction to fix their setup (set the right environment variables and perhaps recompile Qt with a supported OpenGL version). QtWayland::ClientBufferIntegration now returns a bool indicating success or failure. The integration is now destroyed immediately if it failed, instead of leaving it lying around until the compositor shuts down. There has been some slight changes in the xcomposite plugins as well, turning some qFatals into qCWarnings and failing more softly (with the warning mentioned above). Task-number: QTBUG-78483 Change-Id: I55293dbb3cf72768f3982c075fcf63e79329ada1 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-10-261-15/+5
|\| | | | | | | Change-Id: I25e65c392612cc1c379bd408adb60559b1d8a498
| * Update QtWaylandCompositor license headers to GPL 3v5.14.0-beta2Paul Olav Tvete2019-10-161-15/+5
| | | | | | | | | | | | | | | | | | | | | | | | As announced on the mailing list, QtWaylandCompositor licensing is changing to GPLv3: https://lists.qt-project.org/pipermail/development/2019-October/037666.html Change-Id: I4bdc1aa5914e53ac760acc2b6453355af636baa9 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io> Reviewed-by: Johan Helsing <johan.helsing@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Bump module version to 6.0.0Simon Hausmann2019-07-111-1/+1
|/ | | | | | | And fix the build at the same time. Change-Id: I71f1ef2b8777fe514107a27c9ef6ee4c702a74c0 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Compositor: Call eglUnbindWaylandDisplayWL when destroying the compositorJohan Klokkhammer Helsing2019-03-141-0/+8
| | | | | | | | | | | | | | | If unbind is not called, some drivers may try to do cleanup that depends on a valid wl_display in eglTerminate. Arguably, this could/should also have been fixed in the affected drivers. There is a display_destroy signal that the driver should listen to, to avoid using dangling wl_display and wl_global pointers. However, by using eglUnbindWaylandDisplayWL we can force the cleanup to happen before wl_display_destroy. Which is what this patch does. Change-Id: Id9062de896b723838bcecac3902031e6b172a6de Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* Compositor API: Don't leak OpenGL textures when running multi-threadedJohan Klokkhammer Helsing2018-04-271-2/+15
| | | | | | | | | | | | | | | | If a client destroyed buffers, they would not get deleted because the event would be handled on the GUI thread without a valid OpenGL context. I.e: you would see the following output: QOpenGLTexturePrivate::destroy() called without a current context. Texture has not been destroyed Work around it by keeping a list of buffers that have been orphaned and delete them whenever we have a valid OpenGL context. Change-Id: I31c7c4cff179bd68cd954714b2a8e3e2a74675b2 Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Init variables where they are declared when possible (clang-tidy)Johan Klokkhammer Helsing2018-02-271-34/+16
| | | | | | | | | | | | | | | | | | | | clang-tidy -p compile_commands.json $file \ -checks='-*,modernize-use-default-member-init,readability-redundant-member-init' \ -config='{CheckOptions: [{key: modernize-use-default-member-init.UseAssignment, value: "1"}]}' \ -header-filter='qtwayland' \ -fix Afterwards I ran search and replace on the diff to clean up some whitespace errors: - Replaced '(\n\+[^:\n]*)(:\s+\+\s+)' with '$1: ' - Replaced '(\n\+[^,\n]*)(,\s+\+\s+)' with '$1, ' - Replaced '\n\+\s*\n' with '\n' I also had to do some manual edits, because for some reason, this particular clang-tidy check doesn't trigger for some files. Change-Id: I3b3909bac4bf20108bbe8ad1e01bcc54236dae1b Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Use nullptr instead of 0 or NULLJohan Klokkhammer Helsing2018-02-201-7/+7
| | | | | | | | Applied automatic fixes using clang-tidy's modernize-use-nullptr, and some manual cleanup to prevent QFlag macros to be affected. Change-Id: I88f94390185bc6e6f23693b68723cd5710815ae6 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Merge remote-tracking branch 'qt/5.10' into devPaul Olav Tvete2018-01-311-1/+28
|\ | | | | | | Change-Id: I603cbb164e6015c1bb7796bd8bb055d84dbc3b04
| * Fix for big memory leak in Qt based compositorsRobert Griebl2017-12-191-1/+28
| | | | | | | | | | | | | | | | | | The system would leak a complete buffer every time the client attached a new Wayland buffer. For QML applications this will normally happen every time a new animation is started. Change-Id: Ie4981ccbb2e09d702ee291f1144e3b8aa84c0d1d Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Merge remote-tracking branch 'qt/5.10' into devPaul Olav Tvete2017-10-271-44/+75
|\| | | | | | | Change-Id: I4f885a551093ada07da97fd3d99902e36f98595e
| * Support threaded rendering for Nvidia EGLStreamsPaul Olav Tvete2017-10-251-44/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | Create and update the texture on the GUI thread. Make sure there is a valid context on the GUI thread: create one if necessary, and share it with the global share context. Note: this requires that threaded compositors set the Qt::AA_ShareOpenGLContexts application attribute. Task-number: QTBUG-63039 Change-Id: Ia19af0536f9df319cde84221ed53db1c2ef42293 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | Replace Q_NULLPTR with nullptrKevin Funk2017-09-261-1/+1
|/ | | | | | | Change-Id: I9699a957430b8d3574ce29acb91b7ada9ea6209b Reviewed-by: Jan Arne Petersen <jan.petersen@kdab.com> Reviewed-by: Johan Helsing <johan.helsing@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Set texture size and format in WaylandEglClientBuffer::toOpenGLTextureJohan Klokkhammer Helsing2017-06-221-0/+13
| | | | | Change-Id: I26e3ac4224fb54e1d3fddeef8847f9556effe324 Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* Fix licensingv5.9.0-beta4Jani Heikkinen2017-05-041-12/+15
| | | | | | | | | | Currently tests are licensed under GPL-EXCEPT, examples under BSD and src under LGPL so replase old license headers with new & proper ones. Also remove old & unused license files Task-number: QTBUG-57147 Change-Id: Ia6a738798736c275dc309ccfa5b627dc2178d241 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix the wayland-egl compositing using NVIDIA graphicsDominik Holland2017-03-281-7/+19
| | | | | | Task-number: QTBUG-58299 Change-Id: I29737c62dc977de9b7301b635454315560ebb338 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* eglstream: Return if we don't have a OpenGL contextDominik Holland2017-01-191-1/+3
| | | | | | | | Having an warning message should be enough, no need to still try to bind the texture and end in an assert. Change-Id: I6a5f297e1d2b01ca3649775be53ac28d7dcc6479 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* use modularized platformsupport modulesv5.8.0-beta1Oswald Buddenhagen2016-10-221-1/+1
| | | | | Change-Id: I7883470e22deb089240d86df7dc2d625a107a53e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Expose native buffer handlesPaul Olav Tvete2016-10-031-5/+5
| | | | | | | | | This is required for making accelerated compositors that do not use OpenGL. Change-Id: I76c735a971dc62344080aececc087c0495925b87 Reviewed-by: Louai Al-Khanji <louai.al-khanji@qt.io> Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Refactor buffer handlingPaul Olav Tvete2016-10-011-207/+149
| | | | | | | | | | | | | | | | | | | | | | | | | We cannot support bindToTexture() functions. On some platforms the texture is provided by the driver. Therefore, the HW integration must always provide a texture. This has the added bonus of unifying the two separate code paths that were introduced when EGLStream support was added. Add a separate buffer manager that owns all buffers. Don't destroy buffer objects on release. The client will probably attach them again later. Also, release shm buffers immediately after uploading to texture (needs to be documented that image() will not work afterwards). Make the old SurfaceBuffer class into an abstract base class, so we can store state in the buffer class instead of having to map from the wl_resource in each buffer integration. Move the shared memory buffer handling into a separate subclass. Change-Id: I81e471d13c92913d31ea1efe487f93fa908b5e0c Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com> Reviewed-by: Louai Al-Khanji <louai.al-khanji@qt.io> Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* eglstream: Fixed problem when resizing a windowDominik Holland2016-06-021-4/+2
| | | | | | | | | | | | It seems we are not allowed to delete the texture when the buffer is destroyed as this breaks the following eglstream and shows a empty texture. We need to check with NVIDIA, but the deletion of the texture might be handled by wayland Change-Id: Icd20594498d83c57458f77b9e91f0980f8c2d173 Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Fixed eglStream compositingDominik Holland2016-05-181-4/+47
| | | | | | | | | | | | | | | | | | | | | | | When creating the eglStream from the fd we also need to create the texture and call stream_consumer_gltexture. Otherwise the wayland client can't create the wayland client surface. Fixed the qwindow-compositor example to use the texture associated to the QWaylandBufferRef when compositing a EXTERNAL_OES target. QML compositing only works when QSG_RENDER_LOOP is set to basic as we need to generate a texture from the gui thread. As the texture is created by the bufferintegration it might end up in a different gl context than the quick item using it. The texture is also deleted together with the buffer, which prevents the use of the texture afterwards. Both problems need to be fixed in follow up commits. Task-number: QTBUG-50850 Change-Id: Ifec67bbe9e4b2a680c871dc4aced37b71b7b6f80 Reviewed-by: Louai Al-Khanji <louai.al-khanji@qt.io> Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* QtWaylandCompositor: Add support for different EGL buffer formatsLouai Al-Khanji2016-04-291-152/+263
| | | | | Change-Id: Idfeeedbf247fa81dccdf28a1aa04f878900ed262 Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* Proper fix for buffer destructionPaul Olav Tvete2016-02-251-5/+12
| | | | | | | | | | | | | The previous fix (93ca929fb9caf347150) would always crash on client exit. It tried use the same destroy_listener on several buffers. Due to the way linked lists are implemented in Wayland, a listener can only be listening to one signal at the time. The correct way to do this is to create a new listener for each buffer. Change-Id: Ie94dd8cd2d3dc7f93a0526c5c585a8feab3b7354 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>
* Fix querying the buffer size on some platformsGiulio Camuffo2016-02-081-14/+14
| | | | | | | | On Mesa/Intel apparently querying a buffer's size can return bogus values if an EGLImage was not created from it yet. Change-Id: I186dcc70f64d310ef3f5e9f908267a8c28b113f2 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Fix destroy listener signal connectionLaszlo Agocs2016-02-041-1/+1
| | | | | | | | Remove it from the list in the callback, not when a new buffer is created later on. Change-Id: I2328edec9728752d18efaecede19eb4527d0f578 Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>
* Merge remote-tracking branch 'qt/5.6' into wip-compositor-apiPaul Olav Tvete2015-12-021-0/+4
|\ | | | | | | Change-Id: Ie70fdd03e1259a8cb75bbdbf1324e3e4a2b51807
| * Get rid of the egl config test and use what qtbase providesLaszlo Agocs2015-11-111-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | contains(QT_CONFIG, egl) and CONFIG += egl is the only sane way to test for and pull in EGL headers and libs. This is particularly important when trying to be robust and guard against half-broken sysroots on embedded where a naive PKGCONFIG += egl breaks. Also add an EGL_WAYLAND_BUFFER_WL define to keep wayland-egl compiling. We are not testing for that in any config tests may cause a failure in sysroots that have parts of Mesa thrown in but pick ip an older EGL header from the vendor's driver. Change-Id: I7b7e6a7a91e78dbda5b6954ad08761298c538efc Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* | Fix crash on client exitPaul Olav Tvete2015-11-091-0/+2
| | | | | | | | | | | | | | | | | | | | Wayland linked lists are implemented by having next and prev pointers in the objects themselves. This means that an object can only be in one list at the time. If the object is not removed from a list before being inserted into another, the original list is corrupted. Change-Id: Idc6cfc507f7d7ff30a365fda01c4f9729335ae09 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | Merge branch '5.6' into wip-compositor-apiLaszlo Agocs2015-10-271-28/+201
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qwindow-compositor changes from 5.6 will be adapted separately. The traditional wayland-egl path is tested and is functional like before. The EGLStream support will be verified separately once the qwindow-compositor changes are ready. Conflicts: examples/wayland/qwindow-compositor/qwindowcompositor.cpp examples/wayland/qwindow-compositor/textureblitter.cpp examples/wayland/qwindow-compositor/textureblitter.h examples/wayland/server-buffer/client/client.pro examples/wayland/server-buffer/compositor/compositor.pro src/compositor/compositor_api/qwaylandbufferref.cpp src/compositor/compositor_api/qwaylandbufferref.h src/compositor/hardware_integration/qwlclientbufferintegration_p.h src/compositor/wayland_wrapper/qwlkeyboard.cpp src/compositor/wayland_wrapper/qwlkeyboard_p.h src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.h src/plugins/hardwareintegration/compositor/wayland-egl/wayland-egl.pro Change-Id: Ic2e3a6e8f74606c35b1e27cd4016fa133527d7ba
| * Support EGLStream in wayland-eglLaszlo Agocs2015-10-201-29/+240
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For Wayland on NVIDIA. Tested with a Jetson TK1 Pro and Vibrante Linux. With just the hw integration no compositors would work out of the box since EGL_KHR_stream_consumer_gltexture only allows connecting to the texture bound to GL_TEXTURE_EXTERNAL_OES, meaning that assumptions about the target always being GL_TEXTURE_2D break horribly both in C++ and in shader code. In addition, buffers have to be extended with an additional updateTexture() operation as EGLStream requires to call ConsumerAcquire on every frame. Previously there was no concept of this as calling createTexture() on attach() was sufficient. Qt Quick bits are omitted since the refactored compositor API is pretty different. This means that QML compositors will not currently function in this environment. The qwindow-compositor example is enhanced to support the external texture target, but this won't apply for the refactored branch either. It is provided for testing purposes for the time being, and to show how C++ compositors can support different texture targets and correct operation with EGLStreams. Done-with: Louai Al-Khanji <louai.al-khanji@theqtcompany.com> Change-Id: I0e209fc0cbcf435cca83528d938eb50e4bdceb82 Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>