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 <gunnar.sletta@nokia.com>
Reviewed-by: Thomas Senyk <thomas.senyk@nokia.com>
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
bb10
Girish Ramakrishnan 2012-07-06 18:48:38 +05:30 committed by Qt by Nokia
parent f0922c9baf
commit b47bded2f3
1 changed files with 5 additions and 2 deletions

View File

@ -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);