drm/vc4: kms: Fix VBLANK reporting on a disabled CRTC 42/245642/1
authorMaxime Ripard <maxime@cerno.tech>
Mon, 12 Oct 2020 03:44:25 +0000 (12:44 +0900)
committerHoegeun Kwon <hoegeun.kwon@samsung.com>
Tue, 13 Oct 2020 09:01:35 +0000 (18:01 +0900)
commite805316d5d44b1f1f080fd8ae8a34b69329d940c
tree33c0d6ac6c53d5eb4761ecab7ddb666c576ba9d2
parent5d2fec61a25bacc49ee8e84b3c19aee1522f7289
drm/vc4: kms: Fix VBLANK reporting on a disabled CRTC

If a CRTC is enabled but not active, and that we're then doing a page flip
on another CRTC, drm_atomic_get_crtc_state will bring the first CRTC state
into the global state, and will make us wait for its vblank as well, even
though that might never occur.

Fix this by considering all the enabled CRTCs by either using their new
state in the global state, or using their current state if they aren't part
of the new state being checked, to remove their assigned channel from the
pool before started to assign channels to CRTCs enabled by the state.

Fixes: 87ebcd42fb7b ("drm/vc4: crtc: Assign output to channel automatically")
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
[hoegeun.kwon: Needed to fix page flip issue of dual hdmi.]
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
Change-Id: Ic8b8083a652df142a17ec0d50f6c2572494ba3c0
drivers/gpu/drm/vc4/vc4_kms.c