From b47bded2f35c584cb89e2c0e6167e549f0426728 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Fri, 6 Jul 2012 18:48:38 +0530 Subject: linuxfb: Add option to not switch to graphics mode When in graphics mode, printf/qDebug doesn't get printed on the console. So, it's nice to have this option for debugging. Change-Id: Idd552292da2526e07d9c74d2a901e0d675edb2e1 Reviewed-by: Gunnar Sletta Reviewed-by: Thomas Senyk Reviewed-by: Girish Ramakrishnan --- src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/plugins/platforms/linuxfb') diff --git a/src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp b/src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp index 7b9eacf59f..a63979cc8f 100644 --- a/src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp +++ b/src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp @@ -333,10 +333,13 @@ bool QLinuxFbScreen::initialize(const QStringList &args) QString fbDevice, ttyDevice; QSize userMmSize; QRect userGeometry; + bool doSwitchToGraphicsMode = true; // Parse arguments foreach (const QString &arg, args) { - if (sizeRx.indexIn(arg) != -1) + if (arg == QLatin1String("nographicsmodeswitch")) + doSwitchToGraphicsMode = false; + else if (sizeRx.indexIn(arg) != -1) userGeometry.setSize(QSize(sizeRx.cap(1).toInt(), sizeRx.cap(2).toInt())); else if (offsetRx.indexIn(arg) != -1) userGeometry.setTopLeft(QPoint(offsetRx.cap(1).toInt(), offsetRx.cap(2).toInt())); @@ -399,7 +402,7 @@ bool QLinuxFbScreen::initialize(const QStringList &args) if (mTtyFd == -1) qWarning() << "Failed to open tty" << strerror(errno); - if (!switchToGraphicsMode(mTtyFd, &mOldTtyMode)) + if (doSwitchToGraphicsMode && !switchToGraphicsMode(mTtyFd, &mOldTtyMode)) qWarning() << "Failed to set graphics mode" << strerror(errno); blankScreen(mFbFd, false); -- cgit v1.2.3