Skip to content
This repository was archived by the owner on Nov 1, 2021. It is now read-only.

backend/drm: add support for hotplug_mode_update #2712

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

hedgepigdaniel
Copy link

@hedgepigdaniel hedgepigdaniel commented Feb 3, 2021

Fixes #2188
Depends on #2693
Replaces #2628

As @emersion suggested in #2628 (comment), in the case that the hotplug_mode_update prop is set on a connector, the DRM backend should behave more like the Wayland/X11 backends:

  • don't populate the output->modes list
  • treat the preferred mode as a custom mode
  • send a request state event when the preferred mode changes, to request that the compositor perform a modeset with the new preferred mode

When hotplug_mode_update is not set, (struct wlr_drm_connector).desired_mode. and (struct wlr_output).current_mode point to modes in the (struct wlr_output).modes array. For connectors with hotplug_mode_update, this is not the case, so they have to be freed when the desired/current mode changes.

@emersion
Copy link
Member

emersion commented Feb 3, 2021

Do we really need that new WLR_OUTPUT_STATE_MODE_HOT_PLUGGABLE mode type? Why can't we just use WLR_OUTPUT_STATE_MODE_CUSTOM like the Wayland/X11 backends?

@hedgepigdaniel hedgepigdaniel force-pushed the feat/hotplug_mode_update branch 6 times, most recently from 8203e97 to 74cac23 Compare February 3, 2021 12:13
For connectors that set the hotplug_mode_update prop (usually connectors
corresponding to virtualised outputs), ignore modes other than the
preferred mode, treat the preferred mode as a custom mode, and do not add it
to the output->modes list. When the preferred mode changes, send a
request_state event on the output to request for the compositor to change to
the new mode.
@hedgepigdaniel hedgepigdaniel force-pushed the feat/hotplug_mode_update branch from 74cac23 to e0b4379 Compare February 3, 2021 12:18
@hedgepigdaniel
Copy link
Author

Ok, I think I've managed to simplify it including not introducing a new mode type.

@emersion
Copy link
Member

emersion commented Nov 1, 2021

wlroots has migrated to gitlab.freedesktop.org. This pull request has been moved to:

https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/2712

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

Successfully merging this pull request may close these issues.

Add support for hotplug_mode_update
2 participants