summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/kms
Commit message (Collapse)AuthorAgeFilesLines
* Add a function for QPA plugins to explicitly destroy QScreensGiulio Camuffo2014-12-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Previously QPlatformScreen was automatically deleting its QScreen in ~QPlatformScreen(). That means that we cannot use QScreen's methods when the screen is being removed, because doing so would call virtual methods of QPlatformScreen. By that point the QPlatformScreen subclass object does not exist anymore, and we call the default implementation instead of the subclassed one, or get a crash for the pure virtual methods. This happens for example when removing a screen which contains a QWindow with some QML item using QQuickScreenAttached. This patch adds a QPlatformIntegration::destroyScreen() function, which deletes the QScreen and later the QPlatformScreen. ~QPlatformScreen will still delete the QScreen if it was not deleted with destroyScreen(), so code not ported to the new approach will continue to work as before, with only a warning added. Task-number: QTBUG-41141 Change-Id: Ie4a03dee08ceb4c3e94a81875411f6f723273fe1 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Add some missing nativeResourceForIntegration imlementationsJørgen Lind2014-12-222-1/+25
| | | | | | | | The EglDisplay and the Display is normally a PlatformIntegration wide resource Change-Id: Ie5382a2a0b34fbe1c506b5134bf581afbd7f5d99 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Add Q_DECL_OVERRIDE in the src subdirectoryOlivier Goffart2014-12-036-20/+20
| | | | | | | | | | Done automatically with clang-modernize on linux (But does not add Q_DECL_OVERRIDE to the function that are marked as inline because it a compilation error with MSVC2010) Change-Id: I2196ee26e3e6fe20816834ecea5ea389eeab3171 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-11-271-1/+0
|\ | | | | | | Change-Id: Id20053d261b4fbbcc0ac8ba49dd3ef2253fa4b95
| * Reorganize devicediscovery headerLaszlo Agocs2014-11-261-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As pointed out in 13b939c7f41bceb2061e549923eab242326e9bb5 the approach qdevicediscovery_p.h takes is just wrong. The defines it relies on will often be missing when the header is included from random places in qtbase. This results in different class layouts. It was working only because the interface of the class is very limited and the public part was matching regardless of having the macro defined. This is now corrected by introducing subclasses and a common, non-variated base class. QDEVICEDISCOVERY_UDEV is removed completely. Change-Id: I9c83b5b041440a3a6ea3a604eee4a325d4d74439 Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com> Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-11-241-0/+1
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qiodevice.cpp src/plugins/bearer/linux_common/qofonoservice_linux.cpp src/plugins/bearer/linux_common/qofonoservice_linux_p.h src/plugins/platforms/android/qandroidplatformtheme.cpp src/tools/bootstrap/bootstrap.pro src/widgets/styles/qmacstyle_mac.mm Change-Id: Ia02aab6c4598ce74e9c30bb4666d5e2ef000f99b
| * Fix warning about QDeviceDiscovery violating ODR ruleThiago Macieira2014-11-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When compiling with GCC 4.9's LTO, the compiler realizes that the class looks different in two different compilation units and prints a warning. Adding the necessary #define will make sure that the warning isn't printed. It's possible the warning indicates a real problem, if the class actually got used in those two plugins. I wouldn't know. QtPlatformSupport/private/.../qdevicediscovery_p.h:66:7: warning: type ‘struct QDeviceDiscovery’ violates one definition rule .moc/.../qdevicediscovery_p.h:66:7: note: a type with the same name but different layout is defined in another translation unit Change-Id: I73ca8e553e392b8d368f0deaa318d3e6635d73e1 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-10-0911-25/+124
|\| | | | | | | Change-Id: I05fcd8dc66d9ad0dc76bb7f5bae05c9876bfba14
| * kms: Support QOpenGLWidget and QQuickWidgetLaszlo Agocs2014-09-309-17/+99
| | | | | | | | | | | | | | | | | | Also fixes the handling of shareContext() for contexts and format() for windows and makes QOffscreenSurface working. Change-Id: I3c3374a9de14a5b8428de3e11d9d7e1285c5b9c7 Reviewed-by: Gunnar Sletta <gunnar@sletta.org> Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
| * kms: Support non-64x64 cursorsLaszlo Agocs2014-09-302-8/+25
| | | | | | | | | | | | | | Task-number: QTBUG-41477 Change-Id: I10a519d8560c909e87ba2f673d2da4106ce93b71 Reviewed-by: Louai Al-Khanji <louai.al-khanji@digia.com> Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* | Merge remote-tracking branch 'origin/5.4' into devOswald Buddenhagen2014-09-2917-323/+187
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qbytearray.cpp src/gui/image/qimage.cpp src/gui/image/qppmhandler.cpp src/gui/kernel/qguiapplication.cpp src/gui/painting/qpaintengine_raster.cpp Change-Id: I7c1a8e7ebdfd7f7ae767fdb932823498a7660765
| * Update license headers and add new license filesMatti Paaso2014-09-2417-323/+187
| | | | | | | | | | | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* | QKmsScreen: use qEnvironmentVariableIntValue()Marc Mutz2014-09-121-1/+1
|/ | | | | | | | It doesn't allocate memory, so cannot throw and is a lot faster than qgetenv(). Change-Id: Iaaba62396de2d70f611bfa2ba5badb070087fa24 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* kms: Move debug output behind a category.Robin Burchell2014-09-052-4/+8
| | | | | Change-Id: I5b2bb8631a33b577afca1a0852abe4cabae1e254 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* kms: Also initialize in resize(), if required.Robin Burchell2014-08-171-0/+5
| | | | | | | | | It appears to have been an incorrect assumption that flush always comes before resize. At least for me, that is not the case. It also strikes me as being more robust this way. Change-Id: Iafd2cfe7b89802899e844152e0901e588ff0d8a6 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* kms plugin: use first returned mode if no preferred one is presentRolf Eike Beer2014-05-081-2/+6
| | | | | | | | | | The list of returned modes is scanned for the first one marked as preferred, and that is used. If no preferred mode was found then the builtin default mode of 1024x768 is used. Use that builtin mode only if no modes were returned at all, pick the first one if any were returned. Change-Id: Ib355cc92219ced093c605f49dae4e34ff244b639 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* kms plugin: do not needlessly query drm information twiceRolf Eike Beer2014-05-083-16/+8
| | | | | | | | | QKmsDevice already requested the drmModeRes and drmModeConnector information. Simply pass them to the QKmsScreen constructor instead of requesting and freeing them there again. Change-Id: I4897d76d7b13d83297c928b6e10e17ccdfdbd242 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* deprecate import_qpa_plugin and qpa_minimal_pluginOswald Buddenhagen2014-04-241-0/+1
| | | | | | | | they have been fully superseded by 4255ba40ab073afcf2a095b135883612859af4c2. Change-Id: If7ac14c8b7d3cf00fb0cb916036b62eb86c9cee0 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* kms: Adapt to initialize() patternLaszlo Agocs2014-02-112-22/+29
| | | | | | | | Right now socket notifiers are attempted to be created before having the event dispatcher up. This is wrong. Change-Id: Ica3034b9fa790c037f28982db23c71342f6597d7 Reviewed-by: Andy Nichols <andy.nichols@digia.com>
* Remove unused private member (fixes compilation with Clang 3.4)Thiago Macieira2014-02-062-2/+0
| | | | | | | qkmsscreen.h:114:18: error: private field 'm_refreshTime' is not used Change-Id: Id9c802c5c3ae2ffdf61238f083bfe875e7b613a8 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Disable terminal keyboard on eglfs and linuxfbLaszlo Agocs2014-01-245-176/+8
| | | | | | | | | | | | | | | | | | | | | Unify the behavior for eglfs, linuxfb and kms. The relevant code is now moved from kms into fbconvenience. From now on, on all three platforms, terminal keyboard input is turned off by default. This feature can be disabled by setting QT_QPA_ENABLE_TERMINAL_KEYBOARD to 1. This is similar to what the evdev-based keyboard handler did in QWS in Qt4. [ChangeLog][QtGui] The main Embedded Linux platform plugins (eglfs, linuxfb, kms) are changed to behave identically with regards to terminal keyboard input: it is turned off by default on all of these platforms. If this feature is not desired, it can be disabled by setting the environment variable QT_QPA_ENABLE_TERMINAL_KEYBOARD. Task-number: QTBUG-36394 Change-Id: I69e47ed7580464dc5e703e9a0e23891c7c8b7790 Reviewed-by: Andy Nichols <andy.nichols@digia.com>
* Fix namespaced build on LinuxDonald Carr2014-01-102-3/+5
| | | | | Change-Id: I01f389517824e3ada4e4ab153c41c58f05a246fd Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix warnings about forward declarations (-Wmismatched-tags)Sérgio Martins2013-12-202-3/+3
| | | | | | | These are structs in gbm.h. Change-Id: I448ddc072c3aa924672f802dca42b2183470519e Reviewed-by: Andrew Knight <andrew.knight@digia.com>
* Use case insensitive comparison when checking platform plugin keys.Friedemann Kleint2013-12-031-1/+1
| | | | | | Change-Id: Iff44698dcc941ca244b476f0e6c6a993f2ad75f3 Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com> Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Remove the GLES 2 dependency for eglfs and kmsJorgen Lind2013-11-193-3/+10
| | | | | Change-Id: If7b80487e01db726367f5a67d2860073f60a0844 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* QPA: Fix semantics of GUI event dispatcher ownership in platform pluginsTor Arne Vestbø2013-09-302-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The QPlatformIntegration::guiThreadEventDispatcher() function acted as an accessor to event dispatchers created in the constructor of each platform plugin, but the logic and semantics of event-dispatcher handling in Qt itself (QCoreApplication/QGuiApplication) still assumed both ownership and control over the event dispatcher, such as when to create one, which one to create, and when to delete it. This conflicted with the explicit calls in the platform plugins to QGuiApplication::setEventDispatcher(), as well as left a possibility that the event-dispatcher created by the platform plugin would never be deleted, as none of the platform plugins actually took full ownership of the dispatcher and deleted it in its destructor. The integration function has now been renamed back to its old name, createEventDispatcher(), and acts as a factory function, leaving the logic and lifetime of event dispatcher to QtCoreApplication. The only platform left with creating the event-dispatcher in the constructor is QNX, where other parts of the platform relies on having an event-dispatcher before their initialization. We then need to manually take care of the ownership transfer, so that the event-dispatcher is still destroyed at some point. Change-Id: I113db97d2545ebda39ebdefa865e488d2ce9368b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* remove unnecessary beginPaint and endPaint overridesShawn Rutledge2013-09-162-5/+0
| | | | | | | | | | | | | QPlatformBackingStore::endPaint does not take a QRegion parameter. 6ce6b8a378b0d97ba950240ffb048a4b7e485235 set the API, but the platform implementations were not all synced up since then. There was anyway no point in overriding beginPaint and endPaint on platforms which don't need to do anything there. This fixes clang warnings of the form QXcbBackingStore::endPaint hides overloaded virtual function Change-Id: Id6cd0fc2c831a34576ac2c73eeb0d5741d26e622 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Fix malformed assignment in QKmsScreenLaszlo Agocs2013-09-101-1/+1
| | | | | | Change-Id: Ic78160d27b2c768054feefe6ec3fd4aaf8280c83 Reviewed-by: Andrew Knight <andrew.knight@digia.com> Reviewed-by: Andy Nichols <andy.nichols@digia.com>
* Added automatic input device discovery to kms plugin.Samuel Rødal2013-08-061-0/+12
| | | | | | | | | Similar to what the EGLFS plugin does, to avoid having to explicitly specify which device to use for keyboard and mouse. Change-Id: I00502be8c767487490f3fd36fb06d3eb56548ada Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> Reviewed-by: Andy Nichols <andy.nichols@digia.com>
* Find primary GPU onlyPier Luigi Fiorini2013-08-061-1/+1
| | | | | | | | | | | | Some systems may have multiple DRM devices attached to a single seat and we are not guaranteed to pick up the primary GPU. With this flag we can control how DRM devices are detected and consider only the primary GPU. This is very useful for the kms plugin or QtCompositors running on kms in order to use the right DRM device. Change-Id: I8b91e78f148b25aaa4e40724e39e0ed0918ca100 Reviewed-by: Andy Nichols <andy.nichols@digia.com>
* Bump QPA-API-version.Friedemann Kleint2013-07-231-1/+1
| | | | | | | | | | | Changes f5dbc876378ae58a7bdfe1e9664fc81caca18dfb (Use QUrl in QFileDialog API) and c96a6ab627100452864eb4d8da973300401c1bfa (Pass argc, argv to platform plugin) introduced changes to the plugin API. Task-number: QTBUG-29396 Change-Id: I46ee22d16f045b69f141dc6c982017586efef662 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: David Faure (KDE) <faure@kde.org>
* Use QUDeviceHelper instead of custom code.Hannu Lyytinen2013-06-089-452/+29
| | | | | | | Avoid duplicating udev handling code here. Change-Id: I054b6616ead57aa8947dcf942177dfc8a14a00fe Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* KMS QPA Plugin: use preferred mode when selecting modeanknight2013-02-181-4/+8
| | | | | | | | | | This should select the best mode (likely the currently running mode) for the display instead of the first one found. The built-in mode was left as a fallback. Change-Id: I4e1bc798df6f310b001566ab76cb9def3224a7ed Reviewed-by: Andy Nichols <andy.nichols@digia.com>
* KMS QPA Plugin: use GBM cursor writeranknight2013-02-182-56/+19
| | | | | | | | | GBM provides a way to write directly to a buffer object that gets set as the drmMode cursor. This eliminates the need to create a GL texture and opens this class up to platforms that support GBM but not OpenGL. Change-Id: I7297827387ef9a717a5287b5484f14c9987b4158 Reviewed-by: Andy Nichols <andy.nichols@digia.com>
* KMS QPA Plugin: .pro file improvementsanknight2013-02-181-2/+3
| | | | | | | | - Use qtHaveModule to check for OpenGL - Add __GBM__ to pick up the correct native types in the Mesa EGL headers Change-Id: Idfc0e81e95672b08ba8f259b9d7edf2b25fd1bad Reviewed-by: Andy Nichols <andy.nichols@digia.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-01-2225-25/+25
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qsavefile_p.h src/corelib/tools/qregularexpression.cpp src/gui/util/qvalidator.cpp src/gui/util/qvalidator.h Change-Id: I58fdf0358bd86e2fad5d9ad0556f3d3f1f535825
| * Update copyright year in Digia's license headersSergio Ahumada2013-01-1825-25/+25
| | | | | | | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Regression: Fix setting of custom cursors for native widgets.Friedemann Kleint2013-01-211-2/+3
|/ | | | | | | | | | | | | | | | | | | | | | | | | Currently, there is no concept of not having a cursor set on a Window. Qt::ArrowCursor is always set instead. This causes bugs when native child widgets are involved, for example setting a cursor on the native widget's parent no longer works since the child's Qt::ArrowCursor applies. Introduce QWindowPrivate::hasCursor tracking whether a cursor has been explicitly set and clear in QWindow::unsetCursor(). Handle 0 in QPlatformCursor::changeCursor() to mean "unsetCursor()": - Windows: Introduce default constructor for QWindowsWindowCursor meaning "0". Search for applicable parent cursor in applyCursor. - XCB: No big changes required, set XCB_CURSOR_NONE for no cursor. - Other platforms: Assume Qt::ArrowCursor when cursor = 0 is passed for now. Task-number: QTBUG-28879 Change-Id: Id82722592f3cd5fe577a5b64dcc600c85cfea484 Reviewed-by: Jonathan Liu <net147@gmail.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Add PLUGIN_CLASS_NAME to qtbase pluginsMiikka Heikkinen2012-12-101-0/+1
| | | | | | | | Needed for automating static plugin loading. Task-number: QTBUG-28131 Change-Id: Icd993c0fc8335f29aeec30e853a408d888069399 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* beef up qt_plugin.prfOswald Buddenhagen2012-11-011-4/+2
| | | | | | | it now defines the DESTDIR and creates an INSTALLS rule. Change-Id: I15a462ccad9acbe3521c352fa98327825dc27c05 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-2225-601/+601
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* kms: Restore VT settings when crashedLaszlo Agocs2012-08-102-2/+29
| | | | | | | | | | This does the job of keeping the terminal keyboard working when the application segfaults but is somewhat unsafe because ioctl() is not async-signal safe. Change-Id: Ie6728a4252e18c29bba8f8308e6c00d4a1eb6a8e Reviewed-by: Elvis Lee <kwangwoong.lee@lge.com> Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* Properly manage window geometry in kmsLaszlo Agocs2012-08-072-4/+9
| | | | | | | | | | | If QWindow::setGeometry() is called before QWindow::create(), QKmsWindow::setGeometry() is not called at all. This is wrong because there is some special size restricting happening there which must never be skipped. Change-Id: I321632d4fdb327b0a75e6791c019b3f4c2793888 Reviewed-by: Elvis Lee <kwangwoong.lee@lge.com> Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
* Revert "Move QWindowSystemInterface out of qpa."Paul Olav Tvete2012-08-031-1/+1
| | | | | | | | | | | | | | This reverts commit 784a877d3cd9a1a75aca9c83146389503a966071. Conflicts: src/plugins/platforms/cocoa/qcocoawindow.mm src/testlib/qtestkeyboard.h src/testlib/qtestmouse.h src/testlib/qtesttouch.h Change-Id: Iebfed179b3eb7f30e4c95edcae5a8ad6fd50330e Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Disable tty keyboard in kmsLaszlo Agocs2012-07-255-2/+150
| | | | | | | | Set QT_KMS_TTYKBD=1 to prevent this and keep vt switching, ctrl-c, input appearing on the tty, etc. working. Change-Id: I0071685205ae9e02536dcb71f6fef6495c48f8fb Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* Fix keyboard input in kmsLaszlo Agocs2012-07-251-1/+3
| | | | | | | The window was not made active. Change-Id: I20c323201be71fa4deb758e4a8fc32297d6faf0c Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* Update only dirty areas in kms backingstoreLaszlo Agocs2012-07-252-3/+36
| | | | | | | | | | Do not upload the entire (typically fullscreen) image all the time. Taken from eglfs' backingstore implementation. Change-Id: I53db5cf54577ebea715d6cbd7215b9d2154e8960 Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* Add basic backingstore implementation to kmsLaszlo Agocs2012-07-232-4/+130
| | | | | | | | | | | | | | This allows using the kms plugin in QWidget apps having a single (preferably fullscreen) top-level widget. Based on eglfs' implementation. Dirty rectangle tracking is missing, should be added later. There is no composition so multiple TLWs will not work nicely. Change-Id: Ia78589d1a375925ebdcc46aa20fc1619ec14d6cc Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com> Reviewed-by: Elvis Lee <kwangwoong.lee@lge.com>
* release and clear next_bo when pageFlip failsElvis Lee2012-07-211-0/+4
| | | | | | | pageFlip failure makes starvation in waitForPageFlipComplete. Change-Id: Ifbcdda2a4138753f475e4c37767058014cc4230b Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
* Implement nativeResourceFunctionForContext for kmsElvis Lee2012-07-202-0/+25
| | | | | | Change-Id: I4e0486744f4c3eb711a9252c90b0d06c5bb3c670 Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com> Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>