summaryrefslogtreecommitdiffstats
path: root/src/hardwareintegration
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Fix crash when calling setVisible for EGL windows twice within one slotJohan Klokkhammer Helsing2018-03-232-9/+0
| | | | | | Task-number: QTBUG-63411 Change-Id: I56c367a1801d215e93bf195332272cfee300cdd8 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Don't try to create compatibility GL context when profile is unsetv5.11.0-beta2Johan Klokkhammer Helsing2018-03-091-4/+12
| | | | | | | | Context creation would sometimes fail because of this. Change-Id: Icf73a42ee2bb984ebfc09b7ed98f094d544134b8 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Use override when applicableJohan Klokkhammer Helsing2018-02-289-15/+15
| | | | | | | | | | Applied automatic fixes using clang-tidy's modernize-use-override. This adds the "override" keyword where it's possible and also removes the "virtual" keyword when redundant. Change-Id: I899950e5cf8782785d30a245a9c69c1720905d50 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Use default member initialization for raw pointersJohan Klokkhammer Helsing2018-02-2820-30/+30
| | | | | | | | Initialize to nullptr to prevent undefined behavior. Change-Id: I7753c0be77a886d62ecb1cd7b86fc8c98340b0b8 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Init variables where they are declared when possible (clang-tidy)Johan Klokkhammer Helsing2018-02-2736-128/+62
| | | | | | | | | | | | | | | | | | | | 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-204-12/+12
| | | | | | | | 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>
* Compositor API: Add support for hardware compositingJohan Klokkhammer Helsing2018-02-093-0/+388
| | | | | | | | | | [ChangeLog][Compositor] Add a tech preview for a plugin-based hardware layer API and a VSP2 implementation (for Renesas R-Car M3 and H3). Task-number: QTBUG-64600 Task-number: QTBUG-64604 Change-Id: Ia4abfb6343cf4f006ba408d293ec9464cd6f31b7 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Fix compilation for Renesas R-Car M3Johan Klokkhammer Helsing2018-02-082-2/+2
| | | | | Change-Id: Ib85001884bb880a18d8aa1241da0eb614a6b58ba Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Merge remote-tracking branch 'qt/5.10' into devPaul Olav Tvete2018-01-314-3/+33
|\ | | | | | | Change-Id: I603cbb164e6015c1bb7796bd8bb055d84dbc3b04
| * Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2018-01-181-1/+1
| |\ | | | | | | | | | Change-Id: I6c201769561f53d88c89f75cce7d9a7b2643d2f6
| | * Don't recreate hidden egl surfacesDavid Edmundson2018-01-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QWaylandEglWindow deletes surfaces when a window changes from hidden to visible, presumably as a result of us not having a valid wl_surface object. By extension it doesn't make sense to create a surface whilst a window is still hidden. This fixes a crash where a QQuickWindow hides and then is destroyed. In QQuickWindow destruction we have to create a valid context in order to delete any textures/assets owned by the scene graph; as the wl_surface has gone this causes an error in the EGL libs when we create an EGL surface. Task-number: QTBUG-65553 Change-Id: I9b37a86326bf2cd7737c4e839c1aa8c74cf08116 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
| * | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2018-01-073-2/+32
| |\| | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/compositor/compositor_api/qwaylandquickitem.cpp Change-Id: Id2f49e8703a67daedcee66db83f006df828d9da0
| | * Fix for big memory leak in Qt based compositorsRobert Griebl2017-12-192-1/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| | * wayland-egl: use egl compiler optionsSamuli Piippo2017-12-041-1/+1
| | | | | | | | | | | | | | | Change-Id: I6f8dcadf3cffecc6097ad0ad5e8245831b3ce0c1 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | | Adapt to qtbase 5.10 API change: qssize_t -> qsizetypeLiang Qi2018-01-071-1/+1
| | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-65600 Done-with: Thiago Macieira <thiago.macieira@intel.com> Change-Id: I34116dad8eecd01090596270965b9a24f6fe8f39 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Automatically change scale when entering a new outputJohan Klokkhammer Helsing2017-11-152-0/+6
| | | | | | | | | | | | | | | | | | Change-Id: I99198d47eac5b2091fe2bfd8fc24646be9c9890a Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io> Reviewed-by: David Edmundson <davidedmundson@kde.org>
* | | Merge remote-tracking branch 'qt/5.10' into devPaul Olav Tvete2017-10-271-44/+75
|\| | | | | | | | | | | Change-Id: I4f885a551093ada07da97fd3d99902e36f98595e
| * | Merge remote-tracking branch 'qt/5.9' into 5.10v5.10.0-beta3Paul Olav Tvete2017-10-251-44/+75
| |\| | | | | | | | | | Change-Id: I6c283081669594b3e8c6b30194bb96e389319cb2
| | * 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>
* | | Use QImage::sizeInBytes() instead of deprecated QImage::byteCount()Johan Klokkhammer Helsing2017-10-191-1/+1
| | | | | | | | | | | | | | | Change-Id: If3f21fc43d0118c1819d354c8ef43f1b79617c7b Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | | Replace Q_NULLPTR with nullptrKevin Funk2017-09-263-4/+4
|/ / | | | | | | | | | | | | 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>
* | shm-based server buffer for testing on desktopPaul Olav Tvete2017-08-166-0/+506
| | | | | | | | | | Change-Id: I2ea03f3366524d3133a65870abad9d9389dfec9c Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | Update server buffer integrationPaul Olav Tvete2017-08-158-84/+153
|/ | | | | | | | | Fix crashes, and change the (private) API to be more usable. The libhybris code compiles without warnings, but is untested. Change-Id: I1433daf1ba76d7869d1dfe260642199ce5a1b849 Reviewed-by: Johan Helsing <johan.helsing@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>
* Avoid double deletion of mBufferDonald Carr2017-06-161-0/+1
| | | | | | | | | | | Both WaylandBrcmBuffer and WaylandBuffer were calling wl_buffer_destroy(mBuffer) without the derived class nulling the pointer on deletion Change-Id: I66a553a3d11a1ef90bbfe6ad0fb49f40fe1a0bdb Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Fix missing rename from waylandDisplay to displayJohan Klokkhammer Helsing2017-06-131-1/+1
| | | | | | | | | | QWaylandCompositor::waylandDisplay was previously renamed to display, but the libhybris implementation was not updated. Task-number: QTBUG-61183 Change-Id: I80cacb7eeef93375bebd159b676db1147914e8de Reviewed-by: Jan Arne Petersen <jan.petersen@kdab.com> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* Fix licensingv5.9.0-beta4Jani Heikkinen2017-05-0419-228/+285
| | | | | | | | | | 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>
* Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-04-183-9/+3
|\ | | | | | | Change-Id: I436178527be54fd0efa6ffbe39918740d4737478
| * switch to new way to refer to libdl5.8Oswald Buddenhagen2017-04-062-6/+2
| | | | | | | | | | Change-Id: I9269bb0902b0a5b5d8581d79fa9568122ee0641b Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
| * Fix brcm-egl build by correcting commit() usageDonald Carr2017-03-181-3/+1
| | | | | | | | | | | | | | Adjusted existing call to commit() in keeping with parallel changes in 5b807802 Change-Id: I31c17336efa9a79a5f6c1719702215db7239a97d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Fix warning about inconsistent use of override keywordv5.9.0-beta2Thiago Macieira2017-04-043-4/+4
| | | | | | | | | | | | | | | | | | qwaylandshmbackingstore_p.h:93:19: warning: 'paintDevice' overrides a member function but is not marked 'override' [-Winconsistent-missing- override Change-Id: I27b55fdf514247549455fffd14b1791d4dd6b6b3 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | Fix Clang warning about unused private fieldsThiago Macieira2017-04-042-4/+0
| | | | | | | | | | | | | | | | qwaylandxcompositeeglwindow.h:69:35: warning: private field 'm_context' is not used [-Wunused-private-field] qwaylandxcompositeeglwindow.h:75:21: warning: private field 'mBuffer' is not used [-Wunused-private-field] Change-Id: I27b55fdf514247549455fffd14b179d94a725b7f Reviewed-by: Johan Helsing <johan.helsing@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>
* Merge remote-tracking branch 'origin/5.8.0' into 5.8Liang Qi2017-01-267-8/+27
|\ | | | | | | | | | | | | Conflicts: src/hardwareintegration/client/brcm-egl/qwaylandbrcmglcontext.h Change-Id: Ie45a13d3c866d0503e6e31b2a53b70f3420c5066
| * Fix build for brcm graphicsv5.8.0-rc1Johan Klokkhammer Helsing2016-12-081-1/+1
| | | | | | | | | | Change-Id: I301487ad58181a739146139862fe66fec432da9a Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
| * Unify getProcAddress behavior in xcomposite-glxLaszlo Agocs2016-12-062-2/+9
| | | | | | | | | | | | Task-number: QTBUG-57326 Change-Id: I6e49cce16a3bcda0de2f1a9c9ce97acb0a27c4da Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * Unify getProcAddress behavior in the brcm backendLaszlo Agocs2016-12-063-3/+10
| | | | | | | | | | | | Task-number: QTBUG-57326 Change-Id: Ie3df866507e591b47e0e65a1867313b0ab388635 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * Fix crashing in non-core GLES functions on some systemsLaszlo Agocs2016-11-291-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | The 5.7 refactoring for QOpenGLFunctions introduced new requirements for the QPlatformGLContext::getProcAddress implementations. Implementations outside of qtbase were unfortunately forgotten. QtWayland's implementation does not derive from the common EGL version so it needs its own patch. Task-number: QTBUG-57326 Change-Id: Ie2ad22bf5986870aac74adc1e4c654c616091034 Reviewed-by: Risto Avila <risto.avila@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Replace all occurrences of Q_DECL_OVERRIDE with overrideJohan Klokkhammer Helsing2017-01-2323-103/+103
| | | | | | | | | | Change-Id: I16b7b23efe944b49d1fcc9e7588cdb0a991cebd1 Reviewed-by: Paul Olav Tvete <paul.tvete@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 the feature system internallyLars Knoll2016-11-232-3/+0
| | | | | | | | | Get rid of almost all DEFINES += ... in the pro files, instead use the proper QT_CONFIG() macro to determine whether a feature is available. Change-Id: I867769be2085c6ba93b6815e223e2b89edcb245d Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Move qtwayland over to use the new configuration systemLars Knoll2016-11-2314-85/+15
| | | | | | | | | | | | | Re-use configuration results from qtbase where possible and move all pkg-config handling over to be done at configuration time. Since waylandclient and waylandcompositor are two independent libs, this required some duplication of features and libraries used by both in the configure.json files. Change-Id: I1f3ec56c85cb780324cc7634a3ad7951125853a0 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Fix build of brcm-egl clientDonald Carr2016-11-221-0/+1
| | | | | | | | Addendum to 3443483c9efdcfbfe049f96c83f83a5bf1d81e61 Change-Id: I915495d506efaa23f8f901293ee12ef5ec1736de Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Create and destroy the shell surface when showing and hidingGiulio Camuffo2016-11-174-6/+16
| | | | | | | | | | | | | | | | | | This changes the shell surface handling for windows, and instead of creating the shell surface at initialization time, and then attaching a null buffer to hide it, it creates the shell surface on setVisible(true), and destroys it on setVisible(false). This fixes hiding when using xdg_shell, as that interface defines that attaching a null buffer to an xdg_surface is an error. Also this should help with bugged EGL drivers which attach a buffer after eglSwapBuffers() returns, which used to cause a newly hidden window to get a new valid buffer after we attached a null one, showing it again. Task-number: QTBUG-47902 Change-Id: I8e0a0442319a98cc1361803ea7be1d079b36fc8c Reviewed-by: Johan Helsing <johan.helsing@qt.io> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* use modularized platformsupport modulesv5.8.0-beta1Oswald Buddenhagen2016-10-2215-15/+16
| | | | | Change-Id: I7883470e22deb089240d86df7dc2d625a107a53e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Expose native buffer handlesPaul Olav Tvete2016-10-032-7/+7
| | | | | | | | | 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-018-269/+368
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Fix for wayland-egl on DRIVE CXLaszlo Agocs2016-08-102-2/+2
| | | | | | | | | Have to adapt after the changes in qtbase Task-number: QTBUG-55140 Change-Id: I5b5c981514c7ea2898c631db579d4d7d43975e3d Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Fix build with ICC 17: problem parsing override keywordThiago Macieira2016-08-032-2/+2
| | | | | | | | | | | | | So just use the typedef that QPlatformOpenGLContext defines for a function pointer. qwaylandglcontext.h(76): error: expected a ";" Intel Issue ID: 6000161944 Change-Id: I149e0540c00745fe8119fffd1463ce5c4ffdeb4c Reviewed-by: Jan Arne Petersen <jan.petersen@kdab.com> Reviewed-by: Johan Helsing <johan.helsing@qt.io> Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>