1 From d04c74e3f30be64b0e14d7ed2b6088f91ac6ea64 Mon Sep 17 00:00:00 2001
2 From: Maxime Ripard <maxime@cerno.tech>
3 Date: Wed, 16 Mar 2022 16:44:45 +0100
4 Subject: [PATCH] drm/vc4: plane: Prevent async update if we don't have
7 The vc4 planes are setup in hardware by creating a hardware descriptor
8 in a dedicated RAM. As part of the process to setup a plane in KMS, we
9 thus need to allocate some part of that dedicated RAM to store our
12 The async update path will just reuse the descriptor already allocated
13 for that plane and will modify it directly in RAM to match whatever has
16 In order to do that, it will compare the descriptor for the old plane
17 state and the new plane state, will make sure they fit in the same size,
18 and check that only the position or buffer address have changed.
20 Signed-off-by: Maxime Ripard <maxime@cerno.tech>
22 drivers/gpu/drm/vc4/vc4_plane.c | 4 ++++
23 1 file changed, 4 insertions(+)
25 --- a/drivers/gpu/drm/vc4/vc4_plane.c
26 +++ b/drivers/gpu/drm/vc4/vc4_plane.c
27 @@ -1431,6 +1431,10 @@ static int vc4_plane_atomic_async_check(
29 old_vc4_state = to_vc4_plane_state(plane->state);
30 new_vc4_state = to_vc4_plane_state(new_plane_state);
32 + if (!new_vc4_state->hw_dlist)
35 if (old_vc4_state->dlist_count != new_vc4_state->dlist_count ||
36 old_vc4_state->pos0_offset != new_vc4_state->pos0_offset ||
37 old_vc4_state->pos2_offset != new_vc4_state->pos2_offset ||