summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/kmsconvenience
Commit message (Collapse)AuthorAgeFilesLines
* eglfs/kms: Re-enable drm/gbm format overrides in the config fileLaszlo Agocs2019-08-152-2/+11
| | | | | | | | | | | | Follow up to 091a386eaf91ad8932332a8aefc2df793de59f6c Defaulting to querying from the egl config is fine, but dropping support for the "format" key in the output list in the json config file is not ideal. Task-number: QTBUG-76748 Change-Id: I25dc99369d118c300cdef25b464426f6be85453b Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* eglfs: Make the logs from atomic support usableLaszlo Agocs2019-05-141-4/+10
| | | | | | | | | | | Atomic being supported and atomic being requested are two different things. (the latter is only true when QT_QPA_EGLFS_KMS_ATOMIC is set) Log accordingly since this can be very important to know when investigating problems. Change-Id: I6947d18e7c0eaef3fe160095cb046770f9c93efe Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Add missing backslash to kmsconvenience.proLaszlo Agocs2019-05-091-1/+1
| | | | | | Change-Id: I3519447af657bdbb7304aca272de416104dca0f9 Fixes: QTBUG-75730 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* kms: Add support for "skip" key in the output configLaszlo Agocs2019-04-121-0/+8
| | | | | | | | | | "off" is not quite suitable because that turns the output off, as the name suggests. Disconnected outputs are skipped automatically - it is natural to have a way to request the same for connected outputs as well. Task-number: QTBUG-74871 Change-Id: I8bea83428ae0424601b19482b6e6ef809491d0fb Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-07-171-1/+1
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/xcb/qxcbintegration.cpp Conflicts git missed: src/plugins/platforms/qnx/qqnxglcontext.cpp Change-Id: I0582cdc9e66e43efe79038b9c43d4f9572ac88fc
| * Fix Clang annoying, useless warning about using %llu when it wants %luThiago Macieira2018-07-051-1/+1
| | | | | | | | | | | | | | | | | | | | The types have the same size. So it's stupid for it to make the issue a warning... qkmsdevice.cpp:737:88: error: format specifies type 'unsigned long long' but the argument has type '__u64' (aka 'unsigned long') [-Werror,-Wformat] Change-Id: I117816bf0f5e469b8d34fffd153e640b62bef635 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | eglfs/kms: Add drm atomic zpos property handlingLionel CHAZALLON2018-05-032-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | This adds the ability to specify a ZPOS property for the eglfs plane ZPOS will allow to control the relative position between eglfs layer and the other layers. It is bound to using QT_QPA_EGLFS_KMS_ZPOS environment variable to determine its value. Change-Id: I51986ccb22a9dbaeef20165ac5feb7dbe8047373 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | eglfs/kms: also set windowing properties on planesLionel CHAZALLON2018-04-092-0/+12
| | | | | | | | | | | | | | | | | | The 0 values should be default for X,Y both on plane and crtc. But atomic implementation can have flaws on some devices so we don't assume they are defaulted right and set them to 0. Change-Id: I2f7dc98fdba523eb46eb86b97568d18b6cfd1277 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | eglfs/kms: Add framebuffer scaling ability with KMS atomicLionel CHAZALLON2018-04-042-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit will add the possibility to have a different sizes between framebuffer and videomode using DRM atomic, which is not possible with DRM legacy. The main goal of this change is to allow to get decent performance on embedded devices which can support high resolution display (ie UHD), and which don't have a GPU able to achieve decent framerate in such resolutions. This patch adds a "size" member to the output configuration in KMS configuration file. The GBM framebuffer will be created with that size and the GBM screen will report that size so that EGLFS can do everything normally. Scaling planes with different size than the video mode size is not something supported consistently with DRM legacy, so that feature will be only available when using the DRM atomic API. This was tested on Rock64 device, both with drm legacy and atomic. Change-Id: I8ba5bae35e61fcb7d9fc58234504bdfd647b43f6 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Lionel CHAZALLON <longchair@hotmail.com>
* | eglfs/kms: make sure eglfs plane is always consistentLionel CHAZALLON2018-03-181-3/+9
| | | | | | | | | | | | | | | | We need to make sure we update the eglfs plane properly even when we are forcing the rendering plane index. Change-Id: I0cd19fbc53c34f28d55708ba2c8e84278e1d7e7d Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | eglfs/kms: Add DRM atomic ModeSettingLionel CHAZALLON2018-03-172-1/+54
| | | | | | | | | | | | | | | | | | | | | | This patch will allow to set the video mode with DRM atomic API when available. Using Atomic ModeSetting will allow further to enable framebuffer upscaling which is something not possible with DRM legacy API or at least not supported on all devices in a reliable way. Change-Id: Ie340585cf4cbf5d65555c9a7c547dcbadb327fc0 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | eglfs/kms: Add DRM/KMS atomic supportLionel CHAZALLON2018-03-052-0/+87
|/ | | | | | | | | | | | | | | | | | | | | This commit adds support for DRM atomic to qtbase eglfs/KMS QPA when libdrm and device supports it. Compared To legacy DRM API, atomic API allows to update multiple planes in one vsync. This is the first part of some work that should follow and allow: - DRM framebuffer upscaling for embedded devices that have weaker GPUs - Sharing the drm atomic request if the KMSDevice so that applications in userland can blend content on overlay in the same vsync loop. One of the application for DRM atomic and Qt is typically videoplayer integration at high resolutions (UHD) on embedded devices which cannot use their GPU to render such videos, but are able to render it to a drm overlay. Change-Id: I047adf3e3d07a53440d52c2a7073c9ed054adf34 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-10-171-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/network/fortuneclient/client.cpp examples/network/fortuneserver/server.cpp src/platformsupport/platformcompositor/qopenglcompositorbackingstore_p.h src/plugins/platforms/cocoa/qcocoabackingstore.h src/plugins/platforms/cocoa/qcocoaintegration.h src/plugins/platforms/cocoa/qcocoascreen.h src/plugins/platforms/ios/qiosbackingstore.h src/plugins/sqldrivers/oci/qsql_oci.cpp src/widgets/kernel/qwidgetwindow.cpp Change-Id: Ia6dd2c52d4a691b671cf9a2ffca70deccece8f10
| * Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-10-041-1/+1
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qconfig-bootstrapped.h src/corelib/global/qglobal.h src/corelib/tools/qcryptographichash.cpp src/corelib/tools/qcryptographichash.h src/corelib/tools/qmessageauthenticationcode.cpp src/plugins/platforms/windows/qwindowswindow.h tests/auto/gui/kernel/qwindow/BLACKLIST tests/auto/widgets/itemviews/qitemdelegate/BLACKLIST Change-Id: Ib68112de985a3d714c2071f47c10e907e4f0229a
| | * Fix typo in debug statement: QPlatformScren -> QPlatformScreenSérgio Martins2017-09-241-1/+1
| | | | | | | | | | | | | | | Change-Id: Ibf5046ff88cbad1f03966f39f62183b0bd750221 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | | Build fix for clang-5.0Jędrzej Nowacki2017-10-141-1/+1
| | | | | | | | | | | | | | | | | | | | | qkmsdevice.cpp:737:40: error: lambda capture 'this' is not used [-Werror,-Wunused-lambda-capture] Change-Id: I90f0281baeb7bd8216d62515e4b087070c98c235 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | | Fix compilation with clang, missing errno.hDavid Faure2017-10-121-0/+2
| | | | | | | | | | | | | | | | | | | | | Similar to cfe1a295fc which was in a different file. Change-Id: I40e204f8603a2d4c10a6c737192957653f537d1a Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* | | Replace Q_NULLPTR with nullptr where possibleKevin Funk2017-09-191-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remaining uses of Q_NULLPTR are in: src/corelib/global/qcompilerdetection.h (definition and documentation of Q_NULLPTR) tests/manual/qcursor/qcursorhighdpi/main.cpp (a test executable compilable both under Qt4 and Qt5) Change-Id: If6b074d91486e9b784138f4514f5c6d072acda9a Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | kms: Discover all available planesLaszlo Agocs2017-09-192-0/+205
| | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-63058 Change-Id: I655384916bedbeb0da516e2eaa177d1128272d1c Reviewed-by: Andy Nichols <andy.nichols@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* | | kms: Fix crtc allocation logicLaszlo Agocs2017-09-192-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The intention of choosing a different CRTC for each connector is fine, but the code is flawed: the bitmask thas marks used crtc must be based on the crtc index, not the id. In practice the fix makes a difference only when multiple connectors are in use and there are crtc ids above 31. Task-number: QTBUG-63058 Change-Id: I74e01add72df9c6e0b8fbddab978c102573a282c Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* | | kms: Rename the plane index workaround vars appropriatelyLaszlo Agocs2017-09-192-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | ...and purge support from eglfs_kms. That path never worked, the environment variable was meant for the NVIDIA backend only. Task-number: QTBUG-63058 Change-Id: I8cf47168d5878e18eb22c839d56e2d48cbb4fdad Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* | | eglfs_kms: Add headless mode for DRM render nodesLaszlo Agocs2017-09-052-17/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Attempting to switch /dev/dri/cardX to /dev/dri/renderDY is futile on its own now since many output-related drm operations fail and we eventually crash. Add a new headless mode that skips the real screen stuff and registers a fairly dummy, headless screen, does not bother with the mouse cursor, and disallows rendering to the screen via a QWindow (while keeping the actual rendering still fully functional). Such applications will not need any special privileges and will run even if there is a DRM master (X11, Wayland compositor) active. For example the configuration can look like this: { "device": "/dev/dri/renderD128", "headless": "1024x768" } After this applications have two choices to perform offscreen rendering: 1. Use an ordinary window (and its default framebuffer, meaning the gbm_surface), e.g. a QOpenGLWindow subclass MyOpenGLWindow w; w.show(); // will not actually show on screen w.grabFramebuffer().save("output.png"); Note that there is no vsync-based throttling. Also note that windows are still sized to match the screen size, hence the need for specifying a size in the headless property. 2. Or the typical offscreen approach with an extra FBO QOffscreenSurface s; s.setFormat(ctx.format()); s.create(); ctx.makeCurrent(&s0; QOpenGLFramebufferObject fbo(1024, 768); fbo.bind(); ctx.functions()->glClearColor(1, 0, 0, 1); ctx.functions()->glClear(GL_COLOR_BUFFER_BIT); fbo.toImage().save("output.png"); ctx.doneCurrent(); Task-number: QTBUG-62262 Change-Id: Ic1dbfa2b27b223bd5ef8ba36b665f0f61abf4f06 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* | | kms: Remove unused member variableLaszlo Agocs2017-09-052-3/+0
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-62262 Change-Id: Ia0bdac0ebca1a2e1bf2ae8e7cd4db22bf9c445de Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* | | eglfs_kms: Output cloning supportLaszlo Agocs2017-09-052-38/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | { "device": "/dev/dri/card0", "outputs": [ { "name": "HDMI1", "mode": "1920x1080" }, { "name": "DP1", "mode": "1920x1080", "clones": "HDMI1" } ] } Here, assuming the QScreen for DP1 is unused and the resolution is the same, DP1 will simply mirror whatever is on HDMI1. The plane-based mouse cursor is not currently supported. Same goes for any form of scaling since this simply scans out the same framebuffer on all target CRTCs. Task-number: QTBUG-62262 Change-Id: I391be204264284a1bff752ebc2a1dbe5c8592013 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* | | kms: Add support for filtering based on vrefreshLaszlo Agocs2017-09-051-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In addition to "mode": "1280x720", one can now also specify the vrefresh value: "mode": "1280x720@50". This way if there is both a 60 and 50 Hz variant, then it is now possible to choose the 50 Hz one. Task-number: QTBUG-62262 Change-Id: I9ca21c5a513621c83f2f5348c411d8d7c5492b3d Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* | | eglfs_kms: Add support for formats other than XRGB8888Laszlo Agocs2017-09-052-1/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Switch to drmModeAddFB2 and add mappings for RGB565 and ARGB8888, and some BGR variants. The default is XRGB8888, like before. Others can be requested in the config file with "format": "rgb565" or "argb8888" etc. on a per-output basis. If the primary plane does not support the format, modesetting and flipping will fail. Task-number: QTBUG-62262 Change-Id: I8537cbeed7f046c46aa63fcea6d6946c0e0038a7 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* | | eglfs_kms: Report the real preferred mode from QScreenLaszlo Agocs2017-09-051-6/+6
|/ / | | | | | | | | | | | | | | ...and make the struct initialization more readable while we are at it. Task-number: QTBUG-62262 Change-Id: I1af82d1b2fd5a3c94dcdb720920618d4da80c21c Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* | eglfs_kms: Decode EDID blobPier Luigi Fiorini2017-05-022-0/+25
| | | | | | | | | | | | | | | | | | | | Retrieve and parse EDID blob. Return screen product information from EDID. [ChangeLog][QPA][eglfs][kms] Add screen product information from EDID. Change-Id: I766999afd9298e82f6147fdeba5d14757bfb4b03 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-04-201-1/+0
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qbytearray.h src/corelib/tools/qdatetime.h src/corelib/tools/qstring.h src/corelib/tools/qversionnumber.h src/plugins/platforms/android/qandroidplatformintegration.cpp tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp Change-Id: Iefd92a435e687a76cd593099e40d9a9620a1454d
| * Disable precompiled headers for small modulesThiago Macieira2017-04-201-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | Creating a precompiled header exclusively for a one- or two-file module is wasteful. The time that it takes to build the precompiled source is on the same order as a regular compilation, so enabling precompiled headers for those modules just makes the build slower. Also make it possible to override the precompiled header by just setting PRECOMPILED_HEADER to empty. Change-Id: I0e1a09998253489388abfffd14b5f221288c4826 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | eglfs_kms: Mode supportPier Luigi Fiorini2017-02-242-0/+2
|/ | | | | | | | | Add support for reporting available modes. [ChangeLog][QPA][eglfs][kms] List screen modes, current and preferred mode. Change-Id: If64c1512271fadbafbb8c9fd715e64663d598599 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* DRM/KMS config: add support for specifying the primary screenLaszlo Agocs2017-01-182-7/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not having a way to say that a given output should be registered as the primary screen (meaning it comes first in the QGuiApplication::screens() list, emits primaryScreenChanged() signal etc.) can be a problem for some systems. The order of the outputs array in the JSON configuration file is not relevant in this respect since screens are registered either in the original DRM connector order, or, when the virtual desktop layout is specified via virtualIndex, in the order specified by virtualIndex. The primary screen status is independent from this. Therefore, add a new, optional boolean property: primary. For example, the following forces the QScreen corresponding to the VGA output to be the primary screen on the Renesas R-Car H2 board, even though by default it is the HDMI one that happens to be reported first by the system. { "device": "/dev/dri/card0", "outputs": [ { "name": "HDMI1", "mode": "1280x720" }, { "name": "VGA1", "mode": "1280x720", "primary": true }, { "name": "LVDS1", "mode": "off" } ] } In addition, improve the quality of the logging output. [ChangeLog][Platform Specific Changes] Added support for specifying the primary screen in the JSON config file in QT_QPA_EGLFS_KMS_CONFIG when running on DRM/KMS with eglfs. Task-number: QTBUG-57980 Change-Id: Iba490800dee3b7162c68c4d40b0822f3f6d81b69 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-12-132-1/+40
| | | | | | | | | | | | | | | | | | | | | | Conflicts: configure qmake/Makefile.unix.macos qmake/Makefile.unix.win32 qmake/generators/win32/msvc_vcproj.cpp src/3rdparty/pcre/qt_attribution.json src/corelib/io/qsettings.cpp src/corelib/kernel/qdeadlinetimer.cpp src/platformsupport/kmsconvenience/qkmsdevice.cpp src/platformsupport/kmsconvenience/qkmsdevice_p.h src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevicescreen.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsdevice.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.h tests/manual/qstorageinfo/printvolumes.cpp tools/configure/configureapp.cpp Change-Id: Ibaabcc8e965c44926f9fb018466e8b132b8df49e
* Add aliases for env vars common to eglfs and linuxfbLaszlo Agocs2016-11-241-6/+13
| | | | | | | | | | Now that the generic DRM code is shared between multiple platform plugins, the QT_QPA_EGLFS prefix is not that ideal anymore. Introduce aliases without EGLFS. Task-number: QTBUG-56306 Change-Id: I0cf374f8c8d12aa0eab2f026ffa9201b3af35ce2 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Move DRM/KMS code from eglfs into kmsconvenienceLaszlo Agocs2016-11-163-0/+793
The generic DRM code, not involving any GBM or EGLDevice stuff, can now be reused in components outside eglfs, for example linuxfb in order to get support for DRM dumb buffers. Task-number: QTBUG-56306 Change-Id: If7dffdb2415489dbc6470782fa76efcaeccf01c7 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io>