backend/drm: support hotplug_mode_update connector prop

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.
This commit is contained in:
Daniel Playfair Cal 2021-01-30 16:18:11 +11:00
parent 4abd26ac55
commit e0b4379ce5
4 changed files with 151 additions and 35 deletions

View file

@ -116,6 +116,7 @@ struct wlr_drm_connector {
char name[24];
enum wlr_drm_connector_state state;
struct wlr_output_mode *desired_mode;
bool hot_plug_mode;
bool desired_enabled;
uint32_t id;
@ -153,6 +154,11 @@ bool drm_connector_set_mode(struct wlr_drm_connector *conn,
struct wlr_output_mode *mode);
bool drm_connector_is_cursor_visible(struct wlr_drm_connector *conn);
bool drm_connector_supports_vrr(struct wlr_drm_connector *conn);
bool drm_connector_has_hotplug_mode(struct wlr_drm_connector *conn);
bool drm_connector_get_preferred_mode(drmModeConnector *drm_conn,
drmModeModeInfo *drm_mode);
struct wlr_drm_mode *wlr_drm_connector_create_mode(struct wlr_output *output,
const drmModeModeInfo *modeinfo);
size_t drm_crtc_get_gamma_lut_size(struct wlr_drm_backend *drm,
struct wlr_drm_crtc *crtc);

View file

@ -18,6 +18,7 @@ union wlr_drm_connector_props {
uint32_t path;
uint32_t vrr_capable; // not guaranteed to exist
uint32_t subconnector; // not guaranteed to exist
uint32_t hotplug_mode_update; // not guaranteed to exist
// atomic-modesetting only