diff --git a/backend/drm/atomic.c b/backend/drm/atomic.c index 530ee2545..8b98e4fab 100644 --- a/backend/drm/atomic.c +++ b/backend/drm/atomic.c @@ -335,6 +335,10 @@ static bool atomic_crtc_commit(struct wlr_drm_connector *conn, if (modeset && active && conn->props.max_bpc != 0 && conn->max_bpc_bounds[1] != 0) { atomic_add(&atom, conn->id, conn->props.max_bpc, pick_max_bpc(conn, state->primary_fb)); } + if (modeset && active && conn->props.force_color_format && state->base->color_format) { + uint32_t format = 1 << (state->base->color_format - 1); + atomic_add(&atom, conn->id, conn->props.force_color_format, format); + } atomic_add(&atom, crtc->id, crtc->props.mode_id, mode_id); atomic_add(&atom, crtc->id, crtc->props.active, active); if (active) { diff --git a/backend/drm/properties.c b/backend/drm/properties.c index 4f4951771..c8337d10d 100644 --- a/backend/drm/properties.c +++ b/backend/drm/properties.c @@ -26,6 +26,7 @@ static const struct prop_info connector_info[] = { { "EDID", INDEX(edid) }, { "PATH", INDEX(path) }, { "content type", INDEX(content_type) }, + { "force color format", INDEX(force_color_format) }, { "link-status", INDEX(link_status) }, { "max bpc", INDEX(max_bpc) }, { "non-desktop", INDEX(non_desktop) }, diff --git a/include/backend/drm/properties.h b/include/backend/drm/properties.h index 103d12593..7456758e9 100644 --- a/include/backend/drm/properties.h +++ b/include/backend/drm/properties.h @@ -23,6 +23,7 @@ union wlr_drm_connector_props { uint32_t panel_orientation; // not guaranteed to exist uint32_t content_type; // not guaranteed to exist uint32_t max_bpc; // not guaranteed to exist + uint32_t force_color_format; // not guaranteed to exist // atomic-modesetting only