backend/drm: set "max bpc" to the max

"max bpc" is a maximum value, the driver is free to choose a
smaller value depending on the bandwidth available.

Some faulty monitors misbehave with higher bpc values. We'll add
a workaround if users get hit by these in practice.

References: https://gitlab.freedesktop.org/wayland/weston/-/issues/612
This commit is contained in:
Simon Ser 2022-06-07 15:03:39 +02:00 committed by Isaac Freund
parent 1f1c0275be
commit 1d581656c7
5 changed files with 43 additions and 0 deletions

View file

@ -284,6 +284,9 @@ static bool atomic_crtc_commit(struct wlr_drm_connector *conn,
atomic_add(&atom, conn->id, conn->props.content_type,
DRM_MODE_CONTENT_TYPE_GRAPHICS);
}
if (active && conn->props.max_bpc != 0 && conn->max_bpc > 0) {
atomic_add(&atom, conn->id, conn->props.max_bpc, conn->max_bpc);
}
atomic_add(&atom, crtc->id, crtc->props.mode_id, mode_id);
atomic_add(&atom, crtc->id, crtc->props.active, active);
if (active) {