diff options
author | Maxime Ripard <maxime@cerno.tech> | 2022-12-01 16:11:46 +0100 |
---|---|---|
committer | Maxime Ripard <maxime@cerno.tech> | 2022-12-08 09:56:56 +0100 |
commit | 0656ce1240bc44c03ee31499e8e739b7d61138bb (patch) | |
tree | abab625b1bea9ae30bb0a9164f4cda9e6581fb9f /drivers/gpu/drm/vc4/vc4_crtc.c | |
parent | drm/vc4: crtc: Introduce a lower-level crtc init helper (diff) | |
download | linux-0656ce1240bc44c03ee31499e8e739b7d61138bb.tar.xz linux-0656ce1240bc44c03ee31499e8e739b7d61138bb.zip |
drm/vc4: crtc: Make encoder lookup helper public
We'll need a function that looks up an encoder by its vc4_encoder_type.
Such a function is already present in the CRTC code, so let's make it
public so that we can reuse it in the unit tests.
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: MaĆra Canal <mcanal@igalia.com>
Link: https://lore.kernel.org/r/20221123-rpi-kunit-tests-v3-15-4615a663a84a@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Diffstat (limited to 'drivers/gpu/drm/vc4/vc4_crtc.c')
-rw-r--r-- | drivers/gpu/drm/vc4/vc4_crtc.c | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c index 5f7f50add46e..195d2b61839d 100644 --- a/drivers/gpu/drm/vc4/vc4_crtc.c +++ b/drivers/gpu/drm/vc4/vc4_crtc.c @@ -486,21 +486,6 @@ static int vc4_crtc_disable(struct drm_crtc *crtc, return 0; } -static struct drm_encoder *vc4_crtc_get_encoder_by_type(struct drm_crtc *crtc, - enum vc4_encoder_type type) -{ - struct drm_encoder *encoder; - - drm_for_each_encoder(encoder, crtc->dev) { - struct vc4_encoder *vc4_encoder = to_vc4_encoder(encoder); - - if (vc4_encoder->type == type) - return encoder; - } - - return NULL; -} - int vc4_crtc_disable_at_boot(struct drm_crtc *crtc) { struct drm_device *drm = crtc->dev; @@ -536,7 +521,7 @@ int vc4_crtc_disable_at_boot(struct drm_crtc *crtc) pv_data = vc4_crtc_to_vc4_pv_data(vc4_crtc); encoder_type = pv_data->encoder_types[encoder_sel]; - encoder = vc4_crtc_get_encoder_by_type(crtc, encoder_type); + encoder = vc4_find_encoder_by_type(drm, encoder_type); if (WARN_ON(!encoder)) return 0; |