Limit VRR policy in support information only to Wayland session

Adaptive sync is only supported on Wayland.

BUG: 436623
This commit is contained in:
Vlad Zahorodnii 2021-05-05 16:50:19 +03:00
parent caaabf84df
commit 018177b576
2 changed files with 18 additions and 14 deletions

View file

@ -279,7 +279,9 @@ RenderLoop::VrrPolicy Screens::vrrPolicy(int screen) const
return RenderLoop::VrrPolicy::Never;
#else
if (auto output = findOutput(screen)) {
return output->renderLoop()->vrrPolicy();
if (auto waylandOutput = dynamic_cast<AbstractWaylandOutput *>(output)) {
return waylandOutput->vrrPolicy();
}
}
return RenderLoop::VrrPolicy::Never;
#endif

View file

@ -1538,21 +1538,23 @@ QString Workspace::supportInformation() const
.arg(geo.height()));
support.append(QStringLiteral("Scale: %1\n").arg(screens()->scale(i)));
support.append(QStringLiteral("Refresh Rate: %1\n").arg(screens()->refreshRate(i)));
QString vrr = QStringLiteral("incapable");
if (screens()->isVrrCapable(i)) {
switch(screens()->vrrPolicy(i)) {
case RenderLoop::VrrPolicy::Never:
vrr = QStringLiteral("never");
break;
case RenderLoop::VrrPolicy::Always:
vrr = QStringLiteral("always");
break;
case RenderLoop::VrrPolicy::Automatic:
vrr = QStringLiteral("automatic");
break;
if (waylandServer()) {
QString vrr = QStringLiteral("incapable");
if (screens()->isVrrCapable(i)) {
switch(screens()->vrrPolicy(i)) {
case RenderLoop::VrrPolicy::Never:
vrr = QStringLiteral("never");
break;
case RenderLoop::VrrPolicy::Always:
vrr = QStringLiteral("always");
break;
case RenderLoop::VrrPolicy::Automatic:
vrr = QStringLiteral("automatic");
break;
}
}
support.append(QStringLiteral("Adaptive Sync: %1\n").arg(vrr));
}
support.append(QStringLiteral("Adaptive Sync: %1\n").arg(vrr));
}
support.append(QStringLiteral("\nCompositing\n"));
support.append(QStringLiteral( "===========\n"));