060b7659d4a7b6c273b96e55e69d33ba01dcaa89
[openwrt/staging/dangole.git] /
1 From 28f071bd81de9d9026587c9fe7a6f9c3781a30cf Mon Sep 17 00:00:00 2001
2 From: Maxime Ripard <maxime@cerno.tech>
3 Date: Mon, 14 Jun 2021 15:27:24 +0200
4 Subject: [PATCH] drm/vc4: crtc: Add encoder to vc4_crtc_config_pv
5 prototype
6
7 vc4_crtc_config_pv() retrieves the encoder again, even though its only
8 caller, vc4_crtc_atomic_enable(), already did.
9
10 Pass the encoder pointer as an argument instead of going through all the
11 connectors to retrieve it again.
12
13 Signed-off-by: Maxime Ripard <maxime@cerno.tech>
14 ---
15 drivers/gpu/drm/vc4/vc4_crtc.c | 7 +++----
16 1 file changed, 3 insertions(+), 4 deletions(-)
17
18 --- a/drivers/gpu/drm/vc4/vc4_crtc.c
19 +++ b/drivers/gpu/drm/vc4/vc4_crtc.c
20 @@ -315,12 +315,11 @@ static void vc4_crtc_pixelvalve_reset(st
21 CRTC_WRITE(PV_CONTROL, CRTC_READ(PV_CONTROL) | PV_CONTROL_FIFO_CLR);
22 }
23
24 -static void vc4_crtc_config_pv(struct drm_crtc *crtc, struct drm_atomic_state *state)
25 +static void vc4_crtc_config_pv(struct drm_crtc *crtc, struct drm_encoder *encoder,
26 + struct drm_atomic_state *state)
27 {
28 struct drm_device *dev = crtc->dev;
29 struct vc4_dev *vc4 = to_vc4_dev(dev);
30 - struct drm_encoder *encoder = vc4_get_crtc_encoder(crtc, state,
31 - drm_atomic_get_new_connector_state);
32 struct vc4_encoder *vc4_encoder = to_vc4_encoder(encoder);
33 struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);
34 const struct vc4_pv_data *pv_data = vc4_crtc_to_vc4_pv_data(vc4_crtc);
35 @@ -601,7 +600,7 @@ static void vc4_crtc_atomic_enable(struc
36 if (vc4_encoder->pre_crtc_configure)
37 vc4_encoder->pre_crtc_configure(encoder, state);
38
39 - vc4_crtc_config_pv(crtc, state);
40 + vc4_crtc_config_pv(crtc, encoder, state);
41
42 CRTC_WRITE(PV_CONTROL, CRTC_READ(PV_CONTROL) | PV_CONTROL_EN);
43