1 From c1e98dfad80bdb512cd04c9ed5d989a5f0f6b13d Mon Sep 17 00:00:00 2001
2 From: Maxime Ripard <maxime@cerno.tech>
3 Date: Fri, 9 Apr 2021 17:16:42 +0200
4 Subject: [PATCH] drm/vc4: hdmi: Signal the proper colorimetry info in
7 Our driver while supporting HDR didn't send the proper colorimetry info
10 Let's add the property needed so that the userspace can let us know what
11 the colorspace is supposed to be.
13 Signed-off-by: Maxime Ripard <maxime@cerno.tech>
15 drivers/gpu/drm/vc4/vc4_hdmi.c | 10 ++++++++--
16 1 file changed, 8 insertions(+), 2 deletions(-)
18 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c
19 +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
20 @@ -236,7 +236,8 @@ static int vc4_hdmi_connector_atomic_che
24 - if (!drm_connector_atomic_hdr_metadata_equal(old_state, new_state)) {
25 + if (old_state->colorspace != new_state->colorspace ||
26 + !drm_connector_atomic_hdr_metadata_equal(old_state, new_state)) {
27 struct drm_crtc_state *crtc_state;
29 crtc_state = drm_atomic_get_crtc_state(state, crtc);
30 @@ -326,6 +327,11 @@ static int vc4_hdmi_connector_init(struc
34 + ret = drm_mode_create_hdmi_colorspace_property(connector);
38 + drm_connector_attach_colorspace_property(connector);
39 drm_connector_attach_tv_margin_properties(connector);
40 drm_connector_attach_max_bpc_property(connector, 8, 12);
42 @@ -440,7 +446,7 @@ static void vc4_hdmi_set_avi_infoframe(s
43 vc4_encoder->limited_rgb_range ?
44 HDMI_QUANTIZATION_RANGE_LIMITED :
45 HDMI_QUANTIZATION_RANGE_FULL);
47 + drm_hdmi_avi_infoframe_colorspace(&frame.avi, cstate);
48 drm_hdmi_avi_infoframe_bars(&frame.avi, cstate);
50 vc4_hdmi_write_infoframe(encoder, &frame);