drm/vc4: kms: Store the unassigned channel list in the state 05/246705/1
authorMaxime Ripard <maxime@cerno.tech>
Tue, 3 Nov 2020 08:09:14 +0000 (17:09 +0900)
committerHoegeun Kwon <hoegeun.kwon@samsung.com>
Tue, 3 Nov 2020 08:09:14 +0000 (17:09 +0900)
commit5a8a9828f9ee1fca4b545cb0eba095c7143da937
treef9519ffdb0436d18e506ed18d245c7b464299c15
parent29f6ebcf83fb4d1f1f407a9da191ccffc927cfd3
drm/vc4: kms: Store the unassigned channel list in the state

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.

Instead of creating the list of the free channels each time atomic_check
is called, and calling drm_atomic_get_crtc_state to retrieve the
allocated channels, let's create a private state object in the main
atomic state, and use it to store the available channels.

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 and for enable
force hotplug configure. fix to unsigned long unassigned_channels instead
of integer to fix build errors.]
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
Change-Id: Ic8bf07502f614595070e21ecc7912e671a193b09
drivers/gpu/drm/vc4/vc4_drv.h
drivers/gpu/drm/vc4/vc4_kms.c