]> git.baikalelectronics.ru Git - kernel.git/commit
drm/vc4: crtc: Fix vc4_get_crtc_encoder logic
authorMaxime Ripard <maxime@cerno.tech>
Fri, 7 May 2021 15:05:07 +0000 (17:05 +0200)
committerMaxime Ripard <maxime@cerno.tech>
Mon, 24 May 2021 12:41:50 +0000 (14:41 +0200)
commit9448956b891faebbcda872a0fb8c559b5dd51d58
treeead2343c293105d1dddf145d465482b116b50e5c
parent25994b20fb1acd71cd65c93555e8c67df5da37d7
drm/vc4: crtc: Fix vc4_get_crtc_encoder logic

The vc4_get_crtc_encoder function currently only works when the
connector->state->crtc pointer is set, which is only true when the
connector is currently enabled.

However, we use it as part of the disable path as well, and our lookup
will fail in that case, resulting in it returning a null pointer we
can't act on.

We can access the connector that used to be connected to that crtc
though using the old connector state in the disable path.

Since we want to support both the enable and disable path, we can
support it by passing the state accessor variant as a function pointer,
together with the atomic state.

Fixes: 1d042a254ce0 ("drm/vc4: encoder: Add finer-grained encoder callbacks")
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210507150515.257424-5-maxime@cerno.tech
drivers/gpu/drm/vc4/vc4_crtc.c