[platforms/drm] Mark outputs as disabled if we don't have any outputs
Needs ReviewPublic

Authored by graesslin on Sat, Jan 5, 11:54 AM.

Details

Reviewers
None
Group Reviewers
KWin
Maniphest Tasks
T10016: Improve Wayland zero output handling
Summary

So far we only stopped compositing if all outputs were in dpms off
state. But it seems also to be possible that we don't have any outputs.
In that case our compositor would still try to render and at some point
this has to result in a crash.

To prevent such conditions this change set outputs as disabled also if
there are no outputs.

This is an attempt in fixing bug #402827. Unfortunately I cannot test as
I don't get into the condition with my notebook and also don't have an
AMD gpu whose driver seems to go into the no output conditions.

CCBUG: 402827

Test Plan

Completely untested

Diff Detail

Repository
R108 KWin
Branch
drm-no-outputs-disable
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 6665
Build 6683: arc lint + arc unit
graesslin created this revision.Sat, Jan 5, 11:54 AM
Restricted Application added a project: KWin. · View Herald TranscriptSat, Jan 5, 11:54 AM
Restricted Application added a subscriber: kwin. · View Herald Transcript
graesslin requested review of this revision.Sat, Jan 5, 11:54 AM
romangg added a subscriber: romangg.Sun, Jan 6, 2:46 PM

Thanks for looking into this! I just tested it with my PC by disconnecting the display. Without the patch, KWin crashes, with the patch it doesn't and comes up again when reconnecting another display (the same or another one on a different connector).

But all Wayland-native clients crash on disconnect of the display including Plasmashell.

But all Wayland-native clients crash on disconnect of the display including Plasmashell.

No surprise to me. Qt 5 had always problems with no screen setups. It's also the reason why we internally fake to have a screen in our qpt plugin. And the check for at least one screen during startup.

We maybe should not delete the last output at all, so that to the outside world it looks like we still have a screen.