Skip to content

Commit 1f7093b

Browse files
committed
drm/vc4: hdmi: Change CSC callback prototype
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 <[email protected]>
1 parent 9cd5194 commit 1f7093b

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

drivers/gpu/drm/vc4/vc4_hdmi.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -882,6 +882,7 @@ static void vc4_hdmi_encoder_disable(struct drm_encoder *encoder)
882882
}
883883

884884
static void vc4_hdmi_csc_setup(struct vc4_hdmi *vc4_hdmi,
885+
struct drm_connector_state *state,
885886
const struct drm_display_mode *mode)
886887
{
887888
u32 csc_ctl;
@@ -962,6 +963,7 @@ static void vc5_hdmi_set_csc_coeffs(struct vc4_hdmi *vc4_hdmi,
962963
}
963964

964965
static void vc5_hdmi_csc_setup(struct vc4_hdmi *vc4_hdmi,
966+
struct drm_connector_state *state,
965967
const struct drm_display_mode *mode)
966968
{
967969
u32 csc_ctl = VC5_MT_CP_CSC_CTL_ENABLE | VC4_SET_FIELD(VC4_HD_CSC_CTL_MODE_CUSTOM,
@@ -1248,9 +1250,11 @@ static void vc4_hdmi_encoder_pre_crtc_enable(struct drm_encoder *encoder,
12481250
{
12491251
struct drm_display_mode *mode = &encoder->crtc->state->adjusted_mode;
12501252
struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
1253+
struct drm_connector_state *conn_state =
1254+
vc4_hdmi_encoder_get_connector_state(encoder, state);
12511255

12521256
if (vc4_hdmi->variant->csc_setup)
1253-
vc4_hdmi->variant->csc_setup(vc4_hdmi, true);
1257+
vc4_hdmi->variant->csc_setup(vc4_hdmi, conn_state, mode);
12541258

12551259
HDMI_WRITE(HDMI_FIFO_CTL, VC4_HDMI_FIFO_CTL_MASTER_SLAVE_N);
12561260
}

drivers/gpu/drm/vc4/vc4_hdmi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ struct vc4_hdmi_variant {
7777

7878
/* Callback to enable / disable the CSC */
7979
void (*csc_setup)(struct vc4_hdmi *vc4_hdmi,
80+
struct drm_connector_state *state,
8081
const struct drm_display_mode *mode);
8182

8283
/* Callback to configure the video timings in the HDMI block */

0 commit comments

Comments
 (0)