1 From 8c8b3c5a94eb8b5f6a2b0c0c20a25643842646f7 Mon Sep 17 00:00:00 2001
2 From: Maxime Ripard <maxime@cerno.tech>
3 Date: Mon, 18 Jan 2021 09:51:12 +0100
4 Subject: [PATCH] drm/vc4: hdmi: Change CSC callback prototype
6 In order to support the YUV output, we'll need the atomic state to know
7 what is the state of the associated property in the CSC setup callback.
9 Let's change the prototype of that callback to allow us to access it.
11 Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
12 Signed-off-by: Maxime Ripard <maxime@cerno.tech>
14 drivers/gpu/drm/vc4/vc4_hdmi.c | 7 ++++++-
15 drivers/gpu/drm/vc4/vc4_hdmi.h | 1 +
16 2 files changed, 7 insertions(+), 1 deletion(-)
18 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c
19 +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
20 @@ -742,6 +742,7 @@ static void vc4_hdmi_encoder_post_crtc_p
23 static void vc4_hdmi_csc_setup(struct vc4_hdmi *vc4_hdmi,
24 + struct drm_connector_state *state,
25 const struct drm_display_mode *mode)
28 @@ -829,6 +830,7 @@ static void vc5_hdmi_set_csc_coeffs(stru
31 static void vc5_hdmi_csc_setup(struct vc4_hdmi *vc4_hdmi,
32 + struct drm_connector_state *state,
33 const struct drm_display_mode *mode)
36 @@ -1141,13 +1143,16 @@ static void vc4_hdmi_encoder_pre_crtc_en
37 struct drm_atomic_state *state)
39 struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
40 + struct drm_connector *connector = &vc4_hdmi->connector;
41 struct drm_display_mode *mode = &vc4_hdmi->saved_adjusted_mode;
42 + struct drm_connector_state *conn_state =
43 + drm_atomic_get_new_connector_state(state, connector);
46 mutex_lock(&vc4_hdmi->mutex);
48 if (vc4_hdmi->variant->csc_setup)
49 - vc4_hdmi->variant->csc_setup(vc4_hdmi, mode);
50 + vc4_hdmi->variant->csc_setup(vc4_hdmi, conn_state, mode);
52 spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
53 HDMI_WRITE(HDMI_FIFO_CTL, VC4_HDMI_FIFO_CTL_MASTER_SLAVE_N);
54 --- a/drivers/gpu/drm/vc4/vc4_hdmi.h
55 +++ b/drivers/gpu/drm/vc4/vc4_hdmi.h
56 @@ -77,6 +77,7 @@ struct vc4_hdmi_variant {
58 /* Callback to enable / disable the CSC */
59 void (*csc_setup)(struct vc4_hdmi *vc4_hdmi,
60 + struct drm_connector_state *state,
61 const struct drm_display_mode *mode);
63 /* Callback to configure the video timings in the HDMI block */