Skip to content

outputconfigurationstore: add new config system

Xaver Hugl requested to merge work/zamundaaa/kscreen-config into master

Instead of having an external service (KScreen) handle the storing and restoring of output configs, with this MR KWin takes over that responsibility itself. That has a few advantages:

  • when a yet-unknown set of outputs is connected, KWin can immediately configure the outputs with a correctly generated output config, instead of first configuring something temporary (even if that's leaving the new output(s) disabled) and then having KScreen apply something new afterwards
  • adding new settings is much easier (done here with HDR and wide color gamut settings for testing, custom modes or a path to an ICC profile could be next), and determining their defaults is also easier with the information available from directly within KWin
  • output settings are identified with a few key information pieces from the EDID instead of the whole hash, which prevents monitors that edit their EDID (for example because FreeSync is disabled on the monitor side, or because you connected the display with a cable that has different capabilities) from messing up output settings. As a fallback when two outputs have the same EDID information the connector name is used, and better fallbacks can be added later (like the MST path, or gpu + connector index)
  • all data is stored in one easily named file, which is nicer for debugging because you don't need to go hunt for the EDID hash or sort through 10 files to find out what applies for your output
  • I replaced random numbers with human-readable strings, so instead of "vrrpolicy": 2 in the KScreen config we get "vrrPolicy": "Automatic" here, which should make debugging a bit easier

Here's a sample config with the setups "monitor only", "TV only" and "monitor and TV": kwinoutputconfig.json

Existing KScreen configs automatically get transferred to the new config system when it encounters an output setup that isn't in the new system yet.

Draft because

  • the KScreen service still needs to stop touching the output config on Wayland, see kscreen!237 (merged)
  • lid handling doesn't seem to work correctly. The config says KWin is disabling the output, but KScreen thinks it's still enabled
  • this needs to call the KScreen OSD in appropriate situations to make that continue to work. With kscreen!237 (merged) that should be relatively easy to do
  • this needs to assign the Meta+P shortcut for the OSD action
  • this needs to take over autorotate as well
  • going forward, KWin also needs to set the Xwayland scale itself
  • this needs to offer some interface that plasma mobile and kscreen can use to change the autorotate setting

Depends on libraries/plasma-wayland-protocols!62 (merged), libkscreen!158 (merged) and kscreen!237 (merged)

Closes #116 (closed)

Edited by Vlad Zahorodnii

Merge request reports