drm/vc4: Free all stale dlists if channel is disabled
authorDave Stevenson <dave.stevenson@raspberrypi.com>
Thu, 26 Oct 2023 17:23:31 +0000 (18:23 +0100)
committerDom Cobley <popcornmix@gmail.com>
Mon, 19 Feb 2024 11:35:11 +0000 (11:35 +0000)
commit87713c9d7e77f72404e655ec8cbb61819bdd2de0
treed836486a6e9256f5a9811c7a4ebdc1c9a87111d4
parentc6bbf02fdb094e5889fb7578a6074d1d71887e3a
drm/vc4: Free all stale dlists if channel is disabled

The code handling freeing stale dlists had 2 issues:
- it disabled the interrupt as soon as the first EOF interrupt
  occurred, even if it didn't clear all stale allocations, thus
  leading to stale entries
- It didn't free stale entries from disabled channels, so eg
  "kmstest -c 0" could leave a stale alloc on channel 1 floating
  around.

Keep the interrupt enabled whilst there are any outstanding
allocs, and discard those on disabled channels. This second
channel does require us to call vc4_hvs_stop_channel from
vc4_crtc_atomic_disable so that the channel actually gets stopped.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
drivers/gpu/drm/vc4/vc4_crtc.c
drivers/gpu/drm/vc4/vc4_hvs.c