drm/vc4: hvs: Test if the EOF interrupts are enabled
authorMaxime Ripard <maxime@cerno.tech>
Thu, 27 Apr 2023 11:46:53 +0000 (13:46 +0200)
committerDom Cobley <popcornmix@gmail.com>
Mon, 19 Feb 2024 11:34:55 +0000 (11:34 +0000)
commitdae0b2b296db8695402200b53d3aa5f1653d4894
treeb4a87e9697bb940233ff5cc9bc17cad0f7512e2b
parentaf2abcc186b20accf13fd7f81189cfd9c3162577
drm/vc4: hvs: Test if the EOF interrupts are enabled

We currently enable the EOF interrupts through the CRTC destroy_state
implementation.

However, nothing guarantees that we can't call destroy_state multiple
times in a row, and therefore before the EOF interrupt even happens.

This means we would enable the interrupt multiple times but disable it
only once. It wasn't an issue so far since the interrupts were only
enabled by setting a bit in a register, but with BCM2712 we will use an
external interrupt controller, with a refcounted interrupt.

Signed-off-by: Maxime Ripard <maxime@cerno.tech>
drivers/gpu/drm/vc4/vc4_drv.h
drivers/gpu/drm/vc4/vc4_hvs.c