diff mbox series

[14/18] drm/vc4: hdmi: Change CSC callback prototype

Message ID 20210317154352.732095-15-maxime@cerno.tech (mailing list archive)
State New, archived
Headers show
Series drm/vc4: hdmi: Add Support for the YUV output | expand

Commit Message

Maxime Ripard March 17, 2021, 3:43 p.m. UTC
In order to support the YUV output, we'll need the atomic state to know
what is the state of the associated property in the CSC setup callback.

Let's change the prototype of that callback to allow us to access it.

Signed-off-by: Maxime Ripard <maxime@cerno.tech>
---
 drivers/gpu/drm/vc4/vc4_hdmi.c | 4 +++-
 drivers/gpu/drm/vc4/vc4_hdmi.h | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

Comments

Thomas Zimmermann April 14, 2021, 1:56 p.m. UTC | #1
Am 17.03.21 um 16:43 schrieb Maxime Ripard:
> In order to support the YUV output, we'll need the atomic state to know
> what is the state of the associated property in the CSC setup callback.
> 
> Let's change the prototype of that callback to allow us to access it.
> 
> Signed-off-by: Maxime Ripard <maxime@cerno.tech>
> ---
>   drivers/gpu/drm/vc4/vc4_hdmi.c | 4 +++-
>   drivers/gpu/drm/vc4/vc4_hdmi.h | 1 +
>   2 files changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
> index 9614de7303b8..56b5654c820f 100644
> --- a/drivers/gpu/drm/vc4/vc4_hdmi.c
> +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
> @@ -490,6 +490,7 @@ static void vc4_hdmi_bridge_post_crtc_powerdown(struct drm_bridge *bridge,
>   }
>   
>   static void vc4_hdmi_csc_setup(struct vc4_hdmi *vc4_hdmi,
> +			       struct drm_atomic_state *state,

With the line length updated to 100 characters, this might just fit onto 
the previous line. Anyway

Acked-by: Thomas Zimmermann <tzimmermann@suse.de>

>   			       const struct drm_display_mode *mode)
>   {
>   	u32 csc_ctl;
> @@ -570,6 +571,7 @@ static void vc5_hdmi_set_csc_coeffs(struct vc4_hdmi 
*vc4_hdmi,
>   }
>   
>   static void vc5_hdmi_csc_setup(struct vc4_hdmi *vc4_hdmi,
> +			       struct drm_atomic_state *state,
>   			       const struct drm_display_mode *mode)
>   {
>   	u32 csc_ctl = VC5_MT_CP_CSC_CTL_ENABLE | VC4_SET_FIELD(VC4_HD_CSC_CTL_MODE_CUSTOM,
> @@ -860,7 +862,7 @@ static void vc4_hdmi_bridge_pre_crtc_enable(struct drm_bridge *bridge,
>   	struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
>   
>   	if (vc4_hdmi->variant->csc_setup)
> -		vc4_hdmi->variant->csc_setup(vc4_hdmi, mode);
> +		vc4_hdmi->variant->csc_setup(vc4_hdmi, state, mode);
>   
>   	HDMI_WRITE(HDMI_FIFO_CTL, VC4_HDMI_FIFO_CTL_MASTER_SLAVE_N);
>   }
> diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.h b/drivers/gpu/drm/vc4/vc4_hdmi.h
> index d03c849d6ea0..cf5e58a08eb4 100644
> --- a/drivers/gpu/drm/vc4/vc4_hdmi.h
> +++ b/drivers/gpu/drm/vc4/vc4_hdmi.h
> @@ -78,6 +78,7 @@ struct vc4_hdmi_variant {
>   
>   	/* Callback to enable / disable the CSC */
>   	void (*csc_setup)(struct vc4_hdmi *vc4_hdmi,
> +			  struct drm_atomic_state *state,
>   			  const struct drm_display_mode *mode);
>   
>   	/* Callback to configure the video timings in the HDMI block */
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
index 9614de7303b8..56b5654c820f 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
@@ -490,6 +490,7 @@  static void vc4_hdmi_bridge_post_crtc_powerdown(struct drm_bridge *bridge,
 }
 
 static void vc4_hdmi_csc_setup(struct vc4_hdmi *vc4_hdmi,
+			       struct drm_atomic_state *state,
 			       const struct drm_display_mode *mode)
 {
 	u32 csc_ctl;
@@ -570,6 +571,7 @@  static void vc5_hdmi_set_csc_coeffs(struct vc4_hdmi *vc4_hdmi,
 }
 
 static void vc5_hdmi_csc_setup(struct vc4_hdmi *vc4_hdmi,
+			       struct drm_atomic_state *state,
 			       const struct drm_display_mode *mode)
 {
 	u32 csc_ctl = VC5_MT_CP_CSC_CTL_ENABLE | VC4_SET_FIELD(VC4_HD_CSC_CTL_MODE_CUSTOM,
@@ -860,7 +862,7 @@  static void vc4_hdmi_bridge_pre_crtc_enable(struct drm_bridge *bridge,
 	struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
 
 	if (vc4_hdmi->variant->csc_setup)
-		vc4_hdmi->variant->csc_setup(vc4_hdmi, mode);
+		vc4_hdmi->variant->csc_setup(vc4_hdmi, state, mode);
 
 	HDMI_WRITE(HDMI_FIFO_CTL, VC4_HDMI_FIFO_CTL_MASTER_SLAVE_N);
 }
diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.h b/drivers/gpu/drm/vc4/vc4_hdmi.h
index d03c849d6ea0..cf5e58a08eb4 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi.h
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.h
@@ -78,6 +78,7 @@  struct vc4_hdmi_variant {
 
 	/* Callback to enable / disable the CSC */
 	void (*csc_setup)(struct vc4_hdmi *vc4_hdmi,
+			  struct drm_atomic_state *state,
 			  const struct drm_display_mode *mode);
 
 	/* Callback to configure the video timings in the HDMI block */