mirror of
https://github.com/Ysurac/openmptcprouter.git
synced 2025-02-15 04:42:02 +00:00
43 lines
1.2 KiB
Diff
43 lines
1.2 KiB
Diff
|
From 3320e449e40eeb49b601dcbbd4bd72b8cb8f3054 Mon Sep 17 00:00:00 2001
|
||
|
From: Maxime Ripard <maxime@cerno.tech>
|
||
|
Date: Fri, 14 Apr 2023 11:26:58 +0200
|
||
|
Subject: [PATCH 0983/1016] drm/vc4: tests: Add function to lookup a plane for
|
||
|
a CRTC
|
||
|
|
||
|
Some tests will need to find a plane to run a test on for a given CRTC.
|
||
|
Let's create a small helper to do that.
|
||
|
|
||
|
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||
|
---
|
||
|
drivers/gpu/drm/vc4/tests/vc4_mock.h | 14 ++++++++++++++
|
||
|
1 file changed, 14 insertions(+)
|
||
|
|
||
|
diff --git a/drivers/gpu/drm/vc4/tests/vc4_mock.h b/drivers/gpu/drm/vc4/tests/vc4_mock.h
|
||
|
index 678382c9a8fc..436cd85896cf 100644
|
||
|
--- a/drivers/gpu/drm/vc4/tests/vc4_mock.h
|
||
|
+++ b/drivers/gpu/drm/vc4/tests/vc4_mock.h
|
||
|
@@ -21,6 +21,20 @@ struct drm_crtc *vc4_find_crtc_for_encoder(struct kunit *test,
|
||
|
return NULL;
|
||
|
}
|
||
|
|
||
|
+static inline
|
||
|
+struct drm_plane *vc4_mock_find_plane_for_crtc(struct kunit *test,
|
||
|
+ struct drm_crtc *crtc)
|
||
|
+{
|
||
|
+ struct drm_device *drm = crtc->dev;
|
||
|
+ struct drm_plane *plane;
|
||
|
+
|
||
|
+ drm_for_each_plane(plane, drm)
|
||
|
+ if (plane->possible_crtcs & drm_crtc_mask(crtc))
|
||
|
+ return plane;
|
||
|
+
|
||
|
+ return NULL;
|
||
|
+}
|
||
|
+
|
||
|
struct vc4_dummy_plane {
|
||
|
struct vc4_plane plane;
|
||
|
};
|
||
|
--
|
||
|
2.42.0
|
||
|
|