8a980e63d79d3682d1cddb7fc8a2e3de6e609a9a
[openwrt/staging/ldir.git] /
1 From 2163477b39ed25362d5679d0cf9b843fe2c4bfbb Mon Sep 17 00:00:00 2001
2 From: Maxime Ripard <maxime@cerno.tech>
3 Date: Thu, 6 May 2021 17:01:46 +0200
4 Subject: [PATCH] drm/vc4: crtc: Pass the drm_atomic_state to config_pv
5
6 The vc4_crtc_config_pv will need to access the drm_atomic_state
7 structure and its only parent function, vc4_crtc_atomic_enable already
8 has access to it. Let's pass it as a parameter.
9
10 Fixes: 792c3132bc1b ("drm/vc4: encoder: Add finer-grained encoder callbacks")
11 Signed-off-by: Maxime Ripard <maxime@cerno.tech>
12 ---
13 drivers/gpu/drm/vc4/vc4_crtc.c | 8 ++++----
14 1 file changed, 4 insertions(+), 4 deletions(-)
15
16 --- a/drivers/gpu/drm/vc4/vc4_crtc.c
17 +++ b/drivers/gpu/drm/vc4/vc4_crtc.c
18 @@ -305,7 +305,7 @@ static void vc4_crtc_pixelvalve_reset(st
19 CRTC_WRITE(PV_CONTROL, CRTC_READ(PV_CONTROL) | PV_CONTROL_FIFO_CLR);
20 }
21
22 -static void vc4_crtc_config_pv(struct drm_crtc *crtc)
23 +static void vc4_crtc_config_pv(struct drm_crtc *crtc, struct drm_atomic_state *state)
24 {
25 struct drm_device *dev = crtc->dev;
26 struct vc4_dev *vc4 = to_vc4_dev(dev);
27 @@ -313,8 +313,8 @@ static void vc4_crtc_config_pv(struct dr
28 struct vc4_encoder *vc4_encoder = to_vc4_encoder(encoder);
29 struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);
30 const struct vc4_pv_data *pv_data = vc4_crtc_to_vc4_pv_data(vc4_crtc);
31 - struct drm_crtc_state *state = crtc->state;
32 - struct drm_display_mode *mode = &state->adjusted_mode;
33 + struct drm_crtc_state *crtc_state = crtc->state;
34 + struct drm_display_mode *mode = &crtc_state->adjusted_mode;
35 bool interlace = mode->flags & DRM_MODE_FLAG_INTERLACE;
36 u32 pixel_rep = (mode->flags & DRM_MODE_FLAG_DBLCLK) ? 2 : 1;
37 bool is_dsi = (vc4_encoder->type == VC4_ENCODER_TYPE_DSI0 ||
38 @@ -540,7 +540,7 @@ static void vc4_crtc_atomic_enable(struc
39 if (vc4_encoder->pre_crtc_configure)
40 vc4_encoder->pre_crtc_configure(encoder, state);
41
42 - vc4_crtc_config_pv(crtc);
43 + vc4_crtc_config_pv(crtc, state);
44
45 CRTC_WRITE(PV_CONTROL, CRTC_READ(PV_CONTROL) | PV_CONTROL_EN);
46