kms: Add support for "skip" key in the output config

"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>
bb10
Laszlo Agocs 2019-04-12 10:24:09 +02:00
parent 09228604d8
commit 2593463eaf
1 changed files with 8 additions and 0 deletions

View File

@ -59,6 +59,7 @@ enum OutputConfiguration {
OutputConfigOff,
OutputConfigPreferred,
OutputConfigCurrent,
OutputConfigSkip,
OutputConfigMode,
OutputConfigModeline
};
@ -191,6 +192,8 @@ QPlatformScreen *QKmsDevice::createScreenForConnector(drmModeResPtr resources,
configuration = OutputConfigPreferred;
} else if (mode == "current") {
configuration = OutputConfigCurrent;
} else if (mode == "skip") {
configuration = OutputConfigSkip;
} else if (sscanf(mode.constData(), "%dx%d@%d", &configurationSize.rwidth(), &configurationSize.rheight(),
&configurationRefresh) == 3)
{
@ -229,6 +232,11 @@ QPlatformScreen *QKmsDevice::createScreenForConnector(drmModeResPtr resources,
return nullptr;
}
if (configuration == OutputConfigSkip) {
qCDebug(qLcKmsDebug) << "Skipping output" << connectorName;
return nullptr;
}
// Get the current mode on the current crtc
drmModeModeInfo crtc_mode;
memset(&crtc_mode, 0, sizeof crtc_mode);