Skip to content

output: reapply output config when fixed modes change #5942

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

hedgepigdaniel
Copy link

Fixes #5902

Depends on wlroots change: swaywm/wlroots#2628

Add a handler for the available_modes signal from wlroots and reapply the output config in the handler.

The effect is that if there is no configured output mode, then the mode is updated to match the new preferred mode of the output. If the user has configured an output mode, then there is no effect.

Listen to the signal `available_modes` which indicates that an output
has changed its set of available fixed modes, and reapply the output
config.
@hedgepigdaniel hedgepigdaniel changed the title Reapply output config when fixed modes change output: reapply output config when fixed modes change Jan 10, 2021
@emersion
Copy link
Member

I'm worried about a real driver changing the mode list. I don't want that to trigger an automatic modeset.

@hedgepigdaniel
Copy link
Author

I'm assuming that reapplying the existing config will never trigger a modeset unless the hardware situation has changed? Wouldn't it be a driver bug, if the modes changed for a physical output with a hardware edid?

We could instead only reapply the config if the output has the hotplug_mode_update DRM prop set - (e.g. by not updating the available modes in wlroots unless that prop was set, or alternatively by adding a member hotplug_mode_update to struct wlr_output so that Sway can make the decision). Would either of those be better?

@emersion
Copy link
Member

Wouldn't it be a driver bug, if the modes changed for a physical output with a hardware edid?

Not necessarily. The kernel can prune modes, e.g. when the physical link has partially failed and cannot support higher resolutions anymore.

  • If the link has partially failed and the current mode is still usable, the kernel will prune some modes and everything will continue to work normally. The current mode could disappear from the list but still continue to work, I think, because of mode flag changes for instance.
  • If the link has failed and the current mode can't be used anymore, the kernel will set link-status = BAD to signal it. We already handle that in wlroots.

So yeah, I'd prefer to perform a modeset only if hotplug_mode_update = 1. Related: swaywm/wlroots#2300 (comment).

@hedgepigdaniel
Copy link
Author

Closed in favour of swaywm/wlroots#2712

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Respond to changed modes on DRM connectors (e.g. resized/maximised virtual machine window)
2 participants