backend/drm: add support for hotplug_mode_update
Fixes https://github.com/swaywm/wlroots/issues/2188 Depends on https://github.com/swaywm/wlroots/pull/2693 Replaces https://github.com/swaywm/wlroots/pull/2628
As @emersion suggested in https://github.com/swaywm/wlroots/pull/2628#issuecomment-767431813, 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.