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>
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;
};