]> git.baikalelectronics.ru Git - kernel.git/commit
drm/vc4: crtc: Rework the encoder retrieval code (again)
authorMaxime Ripard <maxime@cerno.tech>
Mon, 25 Oct 2021 15:28:58 +0000 (17:28 +0200)
committerMaxime Ripard <maxime@cerno.tech>
Thu, 4 Nov 2021 09:36:25 +0000 (10:36 +0100)
commitf8da60afbdc63f9bbd97604e9e9ec3156abd3731
tree4a8b093d3884a02b4d2f0a2c06fe2955bdd1ffbc
parent4e0f1f878c5b4120e57d180c869aff702718496e
drm/vc4: crtc: Rework the encoder retrieval code (again)

It turns out the encoder retrieval code, in addition to being
unnecessarily complicated, has a bug when only the planes and crtcs are
affected by a given atomic commit.

Indeed, in such a case, either drm_atomic_get_old_connector_state or
drm_atomic_get_new_connector_state will return NULL and thus our encoder
retrieval code will not match on anything.

We can however simplify the code by using drm_for_each_encoder_mask, the
drm_crtc_state storing the encoders a given CRTC is connected to
directly and without relying on any other state.

Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://lore.kernel.org/r/20211025152903.1088803-6-maxime@cerno.tech
drivers/gpu/drm/vc4/vc4_crtc.c
drivers/gpu/drm/vc4/vc4_drv.h