07a36b16928c98706e1e8729b4d84aa1021b41b8
[openwrt/staging/ansuel.git] /
1 From 5fb9452f3a1c8adbd7828ed1b4382c25c2b95c72 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Wed, 17 Jan 2024 17:00:35 +0000
4 Subject: [PATCH 0834/1085] drm/vc4: Fix atomic_async_check to call the right
5 mode_set function
6
7 vc4_plane_atomic_async_check was always calling vc4_plane_mode_set
8 to validate and generate the dlist for the check. If async_check
9 decided it had to fall back to a sync commit, then this GEN4/5
10 dlist could get used on GEN6.
11
12 Call either vc4_plane_mode_set or vc6_plane_mode_set as appropriate.
13
14 Fixes: 1ab1fbbb7e76 ("drm/vc4: hvs: Support BCM2712 HVS")
15 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
16 ---
17 drivers/gpu/drm/vc4/vc4_plane.c | 6 +++++-
18 1 file changed, 5 insertions(+), 1 deletion(-)
19
20 --- a/drivers/gpu/drm/vc4/vc4_plane.c
21 +++ b/drivers/gpu/drm/vc4/vc4_plane.c
22 @@ -2205,11 +2205,15 @@ static int vc4_plane_atomic_async_check(
23 {
24 struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state,
25 plane);
26 + struct vc4_dev *vc4 = to_vc4_dev(plane->dev);
27 struct vc4_plane_state *old_vc4_state, *new_vc4_state;
28 int ret;
29 u32 i;
30
31 - ret = vc4_plane_mode_set(plane, new_plane_state);
32 + if (vc4->gen >= VC4_GEN_6)
33 + ret = vc6_plane_mode_set(plane, new_plane_state);
34 + else
35 + ret = vc4_plane_mode_set(plane, new_plane_state);
36 if (ret)
37 return ret;
38