Skip to content

Commit bc406aa

Browse files
mripardpelwell
authored andcommitted
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. Acked-by: Thomas Zimmermann <tzimmermann@suse.de> Signed-off-by: Maxime Ripard <maxime@cerno.tech>
1 parent 4d1cd9d commit bc406aa

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

‎drivers/gpu/drm/vc4/vc4_hdmi.c‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,6 +751,7 @@ static void vc4_hdmi_encoder_post_crtc_powerdown(struct drm_encoder *encoder,
751751
}
752752

753753
static void vc4_hdmi_csc_setup(struct vc4_hdmi *vc4_hdmi,
754+
struct drm_connector_state *state,
754755
const struct drm_display_mode *mode)
755756
{
756757
unsigned long flags;
@@ -838,6 +839,7 @@ static void vc5_hdmi_set_csc_coeffs(struct vc4_hdmi *vc4_hdmi,
838839
}
839840

840841
static void vc5_hdmi_csc_setup(struct vc4_hdmi *vc4_hdmi,
842+
struct drm_connector_state *state,
841843
const struct drm_display_mode *mode)
842844
{
843845
unsigned long flags;
@@ -1140,13 +1142,16 @@ static void vc4_hdmi_encoder_pre_crtc_enable(struct drm_encoder *encoder,
11401142
struct drm_atomic_state *state)
11411143
{
11421144
struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
1145+
struct drm_connector *connector = &vc4_hdmi->connector;
11431146
struct drm_display_mode *mode = &vc4_hdmi->saved_adjusted_mode;
1147+
struct drm_connector_state *conn_state =
1148+
drm_atomic_get_new_connector_state(state, connector);
11441149
unsigned long flags;
11451150

11461151
mutex_lock(&vc4_hdmi->mutex);
11471152

11481153
if (vc4_hdmi->variant->csc_setup)
1149-
vc4_hdmi->variant->csc_setup(vc4_hdmi, mode);
1154+
vc4_hdmi->variant->csc_setup(vc4_hdmi, conn_state, mode);
11501155

11511156
spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
11521157
HDMI_WRITE(HDMI_FIFO_CTL, VC4_HDMI_FIFO_CTL_MASTER_SLAVE_N);

‎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)