dc74123d64787ffd40cd962a1ba91a3223599392
[openwrt/staging/pepe2k.git] /
1 From eba335e843ae7e9672c43ce39394d5d975cf2f1d Mon Sep 17 00:00:00 2001
2 From: Maxime Ripard <maxime@cerno.tech>
3 Date: Fri, 14 Apr 2023 11:26:58 +0200
4 Subject: [PATCH 0630/1085] drm/vc4: tests: Add function to lookup a plane for
5 a CRTC
6
7 Some tests will need to find a plane to run a test on for a given CRTC.
8 Let's create a small helper to do that.
9
10 Signed-off-by: Maxime Ripard <maxime@cerno.tech>
11 ---
12 drivers/gpu/drm/vc4/tests/vc4_mock.h | 14 ++++++++++++++
13 1 file changed, 14 insertions(+)
14
15 --- a/drivers/gpu/drm/vc4/tests/vc4_mock.h
16 +++ b/drivers/gpu/drm/vc4/tests/vc4_mock.h
17 @@ -21,6 +21,20 @@ struct drm_crtc *vc4_find_crtc_for_encod
18 return NULL;
19 }
20
21 +static inline
22 +struct drm_plane *vc4_mock_find_plane_for_crtc(struct kunit *test,
23 + struct drm_crtc *crtc)
24 +{
25 + struct drm_device *drm = crtc->dev;
26 + struct drm_plane *plane;
27 +
28 + drm_for_each_plane(plane, drm)
29 + if (plane->possible_crtcs & drm_crtc_mask(crtc))
30 + return plane;
31 +
32 + return NULL;
33 +}
34 +
35 struct vc4_dummy_plane {
36 struct vc4_plane plane;
37 };