mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
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>
This commit is contained in:
committed by
Dom Cobley
parent
3f9dcda96a
commit
b0f7178b0a
@@ -21,6 +21,24 @@ struct drm_crtc *vc4_find_crtc_for_encoder(struct kunit *test,
|
|||||||
return NULL;
|
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;
|
||||||
|
};
|
||||||
|
|
||||||
struct drm_plane *vc4_dummy_plane(struct kunit *test, struct drm_device *drm,
|
struct drm_plane *vc4_dummy_plane(struct kunit *test, struct drm_device *drm,
|
||||||
enum drm_plane_type type);
|
enum drm_plane_type type);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user