Skip to content

Commit d354699

Browse files
committed
drm/vc4: kms: Don't duplicate pending commit
Our HVS global state, when duplicated, will also copy the pointer to the drm_crtc_commit (and increase the reference count) for each FIFO if the pointer is not NULL. However, our atomic_setup function will overwrite that pointer without putting the reference back leading to a memory leak. Since the commit is only relevant during the atomic commit process, it doesn't make sense to duplicate the reference to the commit anyway. Let's remove it. Fixes: 9ec03d7 ("drm/vc4: kms: Wait on previous FIFO users before a commit") Signed-off-by: Maxime Ripard <[email protected]> Reviewed-by: Dave Stevenson <[email protected]> Tested-by: Jian-Hong Pan <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent d134c5f commit d354699

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

drivers/gpu/drm/vc4/vc4_kms.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -676,12 +676,6 @@ vc4_hvs_channels_duplicate_state(struct drm_private_obj *obj)
676676

677677
for (i = 0; i < HVS_NUM_CHANNELS; i++) {
678678
state->fifo_state[i].in_use = old_state->fifo_state[i].in_use;
679-
680-
if (!old_state->fifo_state[i].pending_commit)
681-
continue;
682-
683-
state->fifo_state[i].pending_commit =
684-
drm_crtc_commit_get(old_state->fifo_state[i].pending_commit);
685679
}
686680

687681
return &state->base;

0 commit comments

Comments
 (0)