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

@ -1317,6 +1317,14 @@ void scan_drm_connectors(struct wlr_drm_backend *drm,
wlr_conn->output.non_desktop = non_desktop;
}
wlr_conn->max_bpc = 0;
if (wlr_conn->props.max_bpc != 0) {
if (!introspect_drm_prop_range(drm->fd, wlr_conn->props.max_bpc,
NULL, &wlr_conn->max_bpc)) {
wlr_log(WLR_ERROR, "Failed to introspect 'max bpc' property");
}
}
size_t edid_len = 0;
uint8_t *edid = get_drm_prop_blob(drm->fd,
wlr_conn->id, wlr_conn->props.edid, &edid_len);