1 From 70e906d3c688491e181446afa27bea32ce241d6a Mon Sep 17 00:00:00 2001
2 From: Maxime Ripard <maxime@cerno.tech>
3 Date: Fri, 24 Mar 2023 09:58:15 +0100
4 Subject: [PATCH] drm/vc4: tests: Drop drm parameter for
5 vc4_find_crtc_for_encoder
7 The DRM device pointer and the DRM encoder pointer are redundant, since
8 the latter is attached to the former and we can just follow the
9 drm_encoder->dev pointer.
11 Let's remove the drm_device pointer argument.
13 Signed-off-by: Maxime Ripard <maxime@cerno.tech>
15 drivers/gpu/drm/vc4/tests/vc4_mock.h | 2 +-
16 drivers/gpu/drm/vc4/tests/vc4_mock_output.c | 4 ++--
17 drivers/gpu/drm/vc4/tests/vc4_test_pv_muxing.c | 2 +-
18 3 files changed, 4 insertions(+), 4 deletions(-)
20 --- a/drivers/gpu/drm/vc4/tests/vc4_mock.h
21 +++ b/drivers/gpu/drm/vc4/tests/vc4_mock.h
25 struct drm_crtc *vc4_find_crtc_for_encoder(struct kunit *test,
26 - struct drm_device *drm,
27 struct drm_encoder *encoder)
29 + struct drm_device *drm = encoder->dev;
30 struct drm_crtc *crtc;
32 KUNIT_ASSERT_EQ(test, hweight32(encoder->possible_crtcs), 1);
33 --- a/drivers/gpu/drm/vc4/tests/vc4_mock_output.c
34 +++ b/drivers/gpu/drm/vc4/tests/vc4_mock_output.c
35 @@ -77,7 +77,7 @@ int vc4_mock_atomic_add_output(struct ku
36 encoder = vc4_find_encoder_by_type(drm, type);
37 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, encoder);
39 - crtc = vc4_find_crtc_for_encoder(test, drm, encoder);
40 + crtc = vc4_find_crtc_for_encoder(test, encoder);
41 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, crtc);
43 output = container_of(encoder, struct vc4_dummy_output, encoder.base);
44 @@ -115,7 +115,7 @@ int vc4_mock_atomic_del_output(struct ku
45 encoder = vc4_find_encoder_by_type(drm, type);
46 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, encoder);
48 - crtc = vc4_find_crtc_for_encoder(test, drm, encoder);
49 + crtc = vc4_find_crtc_for_encoder(test, encoder);
50 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, crtc);
52 crtc_state = drm_atomic_get_crtc_state(state, crtc);
53 --- a/drivers/gpu/drm/vc4/tests/vc4_test_pv_muxing.c
54 +++ b/drivers/gpu/drm/vc4/tests/vc4_test_pv_muxing.c
55 @@ -132,7 +132,7 @@ get_vc4_crtc_state_for_encoder(struct ku
56 encoder = vc4_find_encoder_by_type(drm, type);
57 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, encoder);
59 - crtc = vc4_find_crtc_for_encoder(test, drm, encoder);
60 + crtc = vc4_find_crtc_for_encoder(test, encoder);
61 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, crtc);
63 new_crtc_state = drm_atomic_get_new_crtc_state(state, crtc);