summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/eglfs
Commit message (Collapse)AuthorAgeFilesLines
* Add support for forced VSYNC using the EGLFS platform plugin.Milian Wolff2013-02-223-22/+30
| | | | | | | | | | | | | | | | | | | | | | | | Before a buffer swap the new QEglFSHooks::waitForVSync method is called which looks at QT_QPA_EGLFS_FORCEVSYNC and - if that is set and non-null - calls ioctl with the FBIO_WAITFORVSYNC request on the framebuffer device. This is required on some embedded platforms where the driver does not support VSYNC yet the Kernel provides a generic implementation. I tested this using QML_RENDER_TIMING=1 which proofs that the frame rate for an example of mine drops from >125fps to a straight ~60fps with a few frames that take ~33ms (i.e. 30fps) as expected for VSYNC. To prevent excessive open/close calls on the frame buffer device per frame, the file descriptor is now cached. To keep the QEglFSHooks interface as clean as possible this is done via a global static in qeglfshooks_stub.cpp and initialized and freed in platformInit and platformDestroy. Change-Id: I4d31b227c65ff22aa089db0fbc62c89a59cbb6c7 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Fixed EGLFS reporting impossibly high physical dimensions.Samuel Rødal2013-02-191-13/+62
| | | | | | | | | If FBIOGET_VSCREENINFO doesn't give us sensible values we need to default to something instead. Refactor the code that queries the resolution and depth to behave the same way. Change-Id: Id2b3fc41349a74610856273b10281f744612890b Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Added QOffscreenSurface class.Yoann Lopes2013-02-183-6/+21
| | | | | | | | | | | | Inherits QSurface and allows to use OpenGL from an arbitrary thread. Platform plugins can implement QPlatformOffscreenSurface, otherwise an invisible QWindow is used by QOffscreenSurface. This patch includes an implementation of QOffscreenSurface for XCB and EglFS platform plugins using pbuffers. Change-Id: I57b4fc1db417331f34826dcfa754b7698782fde4 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Refactor QEglFSPandaHooks and add physicalScreenSize()Gunnar Sletta2013-01-304-5/+53
| | | | | Change-Id: I5a198af5347cc1fdce97031e0a1be99b2120c3ac Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Remove QT_{BEGIN,END}_HEADER macro usageSergio Ahumada2013-01-291-3/+0
| | | | | | | | | | | The macro was made empty in ba3dc5f3b56d1fab6fe37fe7ae08096d7dc68bcb and is no longer necessary or used. Discussed-on: http://lists.qt-project.org/pipermail/development/2013-January/009284.html Change-Id: Id2bb2e2cabde059305d4af5f12593344ba30f001 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
* Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵Frederik Gladhorn2013-01-2316-16/+16
|\ | | | | | | refs/staging/dev
| * Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-01-2216-16/+16
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1816-16/+16
| | | | | | | | | | | | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | | Support shared GL contexts in eglfs.Michael Brasser2013-01-231-1/+1
|/ / | | | | | | | | | | | | This allows shared texture uploads in a background thread. Change-Id: Ib390243bc9dfabd6c579dff9b74e7f44211739d3 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* | Regression: Fix setting of custom cursors for native widgets.Friedemann Kleint2013-01-211-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | eglfs: Introduce way of filtering out unwanted EGL configs.Samuel Rødal2013-01-186-3/+39
|/ | | | | | | | | | | | Some times a platform might want to exclude certain configs, for example based on EGL_NATIVE_VISUAL_ID. This patch introduces a new QEglConfigChooser class which has a virtual filterConfig() function which can be re-implemented in a sub-class to give finer control of how configs are chosen. Change-Id: I8b684f01be95a47307b1e429857f01337a9a38d8 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Fix warning about unused variableThiago Macieira2013-01-021-0/+1
| | | | | | | | | | | qeglfshooks.h:77:21: error: 'hooks' defined but not used [-Werror=unused-variable] Defining a static variable in a header file is a terrible idea. But if I remove it, other code breaks and I don't have the time to fix them all. Change-Id: I4f94cbc7f0790df91853662749701e8fb11c2347 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>
* Compile with QT_NO_CURSOR.Volker Krause2012-12-072-0/+8
| | | | | | | | | | | | | Mostly straightforward, the a11y changes might look a bit drastic, but the base class QAccessibleTextWidget was already disabled in this case, so we have to obviously take out its sub-classes as well. Change-Id: I682ace20d6938688ddb1da23c3463f3c025fab8e Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Tasuku Suzuki <stasuku@gmail.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com>
* Removed temporary backwards-compat properties and accessors in QWindowShawn Rutledge2012-12-031-1/+1
| | | | | | Change-Id: I718b877e3b6c0b1191a932d934599d5c2f5aa958 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* beef up qt_plugin.prfOswald Buddenhagen2012-11-011-5/+2
| | | | | | | it now defines the DESTDIR and creates an INSTALLS rule. Change-Id: I15a462ccad9acbe3521c352fa98327825dc27c05 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Check the EGL error before calling eglTerminate().Samuel Rødal2012-10-261-1/+2
| | | | | | | | Otherwise we always get EGL_SUCCESS, which is not very informative. Change-Id: I25311c14108ae385913aa9dc159a1f5fad142342 Reviewed-by: Rainer Keller <rainer.keller@digia.com> Reviewed-by: Andy Nichols <andy.nichols@digia.com>
* QPlatformWindow: change API for QPlatformWindow::setWindowStateRichard Moe Gustavsen2012-10-172-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | The current implementation requests the platform window to set the window state if it can, and return the actual window state back. The problem with this approach is that the platform window is created as late as possible, so a call to QWindow::setWindowState would in many (most?) cases never be forwarded to the platform window (instead, the platform window is responsible to check the current window state upon creation). As such, the window state might be left unsynched with the platform window. This patch suggests removing the return value from QPlatformWindow::setWindowState. This will at least be consistent, so that setting/getting state would produce the same result independent of delayed window creation. If needed, we can later add new API to QPlatformIntegration or QPlatformWindow for querying supported/actual window state. Change-Id: Ie43f56169656854a765ce88b47a808f8f3d51bb4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Remove handleSynchronous* functions.Morten Johan Sorvig2012-10-101-1/+2
| | | | | | | | | | | | | | | | | | | | There are now two different ways to implement synchronous event processing. The platform plugins can choose which one to use. 1) flushWindowSystemEvents() Use to flush the event queue at one point, making preceding calls synchronous. 2) setSynchronousWindowsSystemEvents(bool enable) Makes all handle* functions synchronous, bypassing the event queue completely. Change-Id: I020b80c731fd13f855a377d7c91d06a4e39b6a0b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-2216-385/+385
| | | | | | | | 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>
* Revert "Fix transformation in eglfs backingstore"Jon Trulson2012-08-291-2/+2
| | | | | | | | | | This reverts commit 12491f35bbea7008b15fb0ba0ee7ea5bf6eb6b6c. This change is not needed on eglfs. It causes widget based apps to be rendered with Y inverted. Change-Id: Idb23fa22c438442b81882b64bf84d6aa0662d27b Reviewed-by: Laszlo Agocs <lagocs83@gmail.com>
* Fix transformation in eglfs backingstoreLaszlo Agocs2012-08-221-2/+2
| | | | | | | | | | | | While not visible with forced-fullscreen windows, the formula used to set up positioning on the Y axis is wrong. (with the GL coordinate system Y goes 1..-1 when moving top-to-bottom) Taken from kms' version of the backingstore which had the formulas corrected. Change-Id: I460a4eec925e47b08453af4e093d719567af22ea Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Made eglfs work with backing store based applications again.Samuel Rødal2012-08-153-4/+10
| | | | | | | | | Make sure we pick the same config for the context and window surface, and do not create unnecessary window surfaces for the desktop widget. Change-Id: I3c8fb3df9ab8a658196e41dfa1705cfca625a2d7 Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com> Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
* Revert "Move QWindowSystemInterface out of qpa."Paul Olav Tvete2012-08-032-2/+2
| | | | | | | | | | | | | | 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>
* Move QWindowSystemInterface out of qpa.Stephen Kelly2012-07-192-2/+2
| | | | | | | | Public QtTest headers require it, so all unit tests would have to use private Qt headers otherwise, which is not practical. Change-Id: I5d4466ec30b6a57ebdfc34413e716e657eb51368 Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
* eglfs: add virtual destructor to QEglFsHooksRobin Burchell2012-07-111-0/+1
| | | | | | | | | Fixes: qeglfshooks.h:56: error: 'class QEglFSHooks' has virtual functions and accessible non-virtual destructor Change-Id: I5b8d96e764121c85fcc73d2231427cd123de8cd9 Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
* eglfs: Allow setting screen size through environment variables.Robin Burchell2012-07-061-0/+16
| | | | | | | | | | | | This adds: - QT_QPA_EGLFS_WIDTH - QT_QPA_EGLFS_HEIGHT If both are set, fb0 detection is completely bypassed, otherwise, the environment variables act as an override for the fb0 values. Change-Id: Iaf38c8b0d40ce0a921bb6c5dbf31af788802d3fa Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
* Suppress QWindowSystemInterface inclusion warnings.Girish Ramakrishnan2012-07-032-2/+2
| | | | | | | | | | | | | Since QWindowSystemInterface is now part of QPA API. The correct inclusion is: #include <qpa/qwindowsysteminterface.h> #include <qpa/qwindowsysteminterface_p.h> Bulk of the work was done by: find . -type f | xargs sed -i -e 's,#include <\(QtGui/\)\?QWindowSystemInterface>,#include <qpa/qwindowsysteminterface.h>,g' Change-Id: If75fc32611e72ef1cf58505794def375b1acf74a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Add QPA prefix and version number to QPA plugin factory interfaces.Friedemann Kleint2012-06-271-1/+1
| | | | | | | The interfaces may change in Qt minor versions. Change-Id: I43bc6245ddbba8232e00313bdc64e8e60c7eab6f Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Guard evdev specifics with QT_NO_EVDEV.Robin Burchell2012-06-241-0/+4
| | | | | | | Android fails the evdev configure test at present. Change-Id: I1cbaf2dab589f647c02c8c5b92f72bd5159ccfa9 Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
* eglfs: move m_pos into CursorGirish Ramakrishnan2012-06-222-8/+7
| | | | | Change-Id: I51e92d265e7ea6372ae58b357f75362e2d9a2df9 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* platform hooks: provide defaults for screen size and depth hooksJohannes Zellner2012-06-191-2/+42
| | | | | | | | Default hooks for querying screen size and color depth based on linux fbdev API. Change-Id: I7fc75c0df5e0f507cf679439416fe68c8f62f91d Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
* eglfs: Pass QSurfaceFormat to createNativeWindow() hookJohannes Zellner2012-06-144-5/+8
| | | | | Change-Id: Ib352d8591360a224359ef218b95cd27cdfaf81aa Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
* eglfs: Make QEglFSWindow respect the window formatGirish Ramakrishnan2012-06-145-31/+12
| | | | | | | | | | | | | | Prior to this change, eglfs code used to override the window format with it's own format. With this change, eglfs will respect the window format. This is useful when the application requires a surface with alpha (for example, so that the video layer below is visible) QEglFSHooks::surfaceFormatFor() allows the hook author to override the context and window surface format. Change-Id: I97f03a8b0871dfebfca73004fa0188b33d0d0367 Reviewed-by: Johannes Zellner <johannes.zellner@nokia.com> Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
* eglfs: mark overriden methods with Q_DECL_OVERRIDEGirish Ramakrishnan2012-06-131-4/+4
| | | | | | | | | The current cursor implementation can be a bit hard to read without hints about which methods are overriden. Change-Id: I3376890a13be46e1ece03d1442dd5a15ccd61382 Reviewed-by: Johannes Zellner <johannes.zellner@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* eglfs refactor: move window creation into qeglfswindowGirish Ramakrishnan2012-06-129-106/+212
| | | | | | | | | | This potentially allows the creation of multiple QWindows. The platform context is now in a seperate file and the integration provides a new instance of the context allowing creation of multiple contexts. Change-Id: If2b6fa29b573d87c0a4cd0a8eff1f044bd1ff9b8 Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Remove the QFactoryInterface dependency from platform pluginsLars Knoll2012-06-081-8/+0
| | | | | Change-Id: I4010e59dcd8a790e06bb9a0ccf3cc9a5c7737ed1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fixed compile error in eglfs plugin due to narrowing conversion.Samuel Rødal2012-06-061-4/+8
| | | | | | | | | qeglfscursor.cpp:300: error: narrowing conversion of ‘((const QRectF*)r)->QRectF::left()’ from ‘qreal’ to ‘const GLfloat’ inside { } Change-Id: Ic4273828ad361ffac5a68068372bf400d468fb38 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* eglfs refactor: Query screen and format info from hooksGirish Ramakrishnan2012-06-054-42/+42
| | | | | | | | This allows boards to customize what they really work best for without having to set environment variables. Change-Id: Ib40c3a870ade568f66e37e621a8abc6b17e39411 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* eglfs refactor: Move egl initialization to the integrationGirish Ramakrishnan2012-06-054-42/+44
| | | | | Change-Id: If2c870538c742fd034fb9e5c115e4ac0bd8e2e03 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* eglfs: Create mouse, keyboard and touch handlers by defaultGirish Ramakrishnan2012-06-022-2/+15
| | | | | | | | | | | | | | | | | Prior to this change, input support for eglfs was loaded as plugins. With this change, eglfs supports evdev based keyboard, mouse and touch input out of the box. The event dispatcher is created in the constructor because the evdev code creates QSocketNotifiers in the constructor which requires an event loop. Change-Id: I4e08f4121b9381ee5b414d0886eae2b8a2925800 Reviewed-by: Johannes Zellner <johannes.zellner@nokia.com> Reviewed-by: Romain Pokrzywka <romain.pokrzywka@kdab.com> Reviewed-by: Donald Carr <donald.carr@nokia.com> Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com> Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
* eglfs: implement hardware cursor for the raspberry-piGirish Ramakrishnan2012-06-017-41/+80
| | | | | | | | | | | | | | | | The cursor is rendered on a dispmanx layer and moved around. This approach saves us from having to update the underlying window each time the cursor moves. Dispmanx layers cannot be moved to negative coords. As a result, currently it is not possible to move to a location less than the hostpot. A future commit will fix this problem. Change-Id: Ida5ee961d03a6929860c515e503482756a4913ed Reviewed-by: Johannes Zellner <johannes.zellner@nokia.com> Reviewed-by: Andy Nichols <andy.nichols@nokia.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* eglfs: allow cursor to be created without a contextGirish Ramakrishnan2012-05-313-22/+39
| | | | | | | | Textures are now created and uploaded on demand on first render() call where we are guaranteed to have a current GL context. Change-Id: I352c876dd1d8b7ed73536de21fa2880cdc6bdb60 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* eglfs: keep context active only during flushGirish Ramakrishnan2012-05-301-2/+4
| | | | | | | | The OpenGL context needs to be current only while flushing the backing store. Change-Id: I4d6a10f22bcfe04f35a14a690180237f6c691829 Reviewed-by: Andy Nichols <andy.nichols@nokia.com>
* Fix compile error in eglconvenienceGirish Ramakrishnan2012-05-301-2/+1
| | | | | | Change-Id: Ic20d890a9c59e21a5f0c81f961074ab02083a266 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
* eglfs: Don't update screen for non mouse-move eventsGirish Ramakrishnan2012-05-291-0/+2
| | | | | | | Change-Id: I7df089a9dc87396e19c08cef3d76c7c7f95a8fbf Reviewed-by: Donald Carr <donald.carr@nokia.com> Reviewed-by: Andy Nichols <andy.nichols@nokia.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Add q_printEglConfig to qeglconvenienceGirish Ramakrishnan2012-05-291-43/+1
| | | | | | | The code was initially part of eglfs. Change-Id: I8aa6e77edec85ab2b23765ca04e4416757f3bed6 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* eglfs: remove support for widget rendering using opengl paint engineGirish Ramakrishnan2012-05-292-26/+0
| | | | | | | | | | The eglfs backing store code can render either using the raster paint engine (through QImage) or using the opengl paint engine. Rendering quality using the opengl paint engine is pretty poor so remove it. Change-Id: I64061ceb3a480049cfebe61aaf172ad1f1da7042 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* eglfs: release shader program after useGirish Ramakrishnan2012-05-291-1/+1
| | | | | Change-Id: Ibe89de88c6c01d182a240def92eb78c0cc896463 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* eglfs: rename QEglIntegration to QEglFSIntegrationGirish Ramakrishnan2012-05-292-6/+6
| | | | | | Change-Id: Ifa096537d417571ed660a63a501fed188186f400 Reviewed-by: Donald Carr <donald.carr@nokia.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>