Skip to content

Commit cb468c7

Browse files
committed
drm/vc4: plane: Prevent async update if we don't have a dlist
The vc4 planes are setup in hardware by creating a hardware descriptor in a dedicated RAM. As part of the process to setup a plane in KMS, we thus need to allocate some part of that dedicated RAM to store our descriptor there. The async update path will just reuse the descriptor already allocated for that plane and will modify it directly in RAM to match whatever has been asked for. In order to do that, it will compare the descriptor for the old plane state and the new plane state, will make sure they fit in the same size, and check that only the position or buffer address have changed. Reviewed-by: Melissa Wen <mwen@igalia.com> Signed-off-by: Maxime Ripard <maxime@cerno.tech> Link: https://lore.kernel.org/r/20220610115149.964394-2-maxime@cerno.tech
1 parent 1342b5b commit cb468c7

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

drivers/gpu/drm/vc4/vc4_plane.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,6 +1321,10 @@ static int vc4_plane_atomic_async_check(struct drm_plane *plane,
13211321

13221322
old_vc4_state = to_vc4_plane_state(plane->state);
13231323
new_vc4_state = to_vc4_plane_state(new_plane_state);
1324+
1325+
if (!new_vc4_state->hw_dlist)
1326+
return -EINVAL;
1327+
13241328
if (old_vc4_state->dlist_count != new_vc4_state->dlist_count ||
13251329
old_vc4_state->pos0_offset != new_vc4_state->pos0_offset ||
13261330
old_vc4_state->pos2_offset != new_vc4_state->pos2_offset ||

0 commit comments

Comments
 (0)