summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMaxime Ripard <mripard@kernel.org>2024-02-22 21:13:50 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-04-25 11:45:07 +0300
commit60f481fdf1e75187975ba86945f0be68eb22c511 (patch)
tree74b0ec425741c110a56b689b1dfca2747dd2d01b /include
parentaf1dccab386f46ec8da07cf80a794bf19ae3cc96 (diff)
downloadlinux-60f481fdf1e75187975ba86945f0be68eb22c511.tar.xz
drm/tests: Add helper to create mock crtc
[ Upstream commit 51f90720381dea79208513d059e0eb426dee511e ] We're going to need a full-blown, functional, KMS device to test more components of the atomic modesetting infrastructure. Let's add a new helper to create a dumb, mocked, CRTC. By default it will create a CRTC relying only on the default helpers, but drivers are free to deviate from that. Reviewed-by: MaĆ­ra Canal <mcanal@igalia.com> Signed-off-by: Maxime Ripard <mripard@kernel.org> Link: https://patchwork.freedesktop.org/patch/msgid/20240222-kms-hdmi-connector-state-v7-4-8f4af575fce2@kernel.org Stable-dep-of: 70f29ca3117a ("drm/tests: cmdline: Fix drm_display_mode memory leak") Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/drm/drm_kunit_helpers.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/drm/drm_kunit_helpers.h b/include/drm/drm_kunit_helpers.h
index 38667d624aa8..6e99627edf45 100644
--- a/include/drm/drm_kunit_helpers.h
+++ b/include/drm/drm_kunit_helpers.h
@@ -9,6 +9,8 @@
#include <kunit/test.h>
+struct drm_crtc_funcs;
+struct drm_crtc_helper_funcs;
struct drm_device;
struct drm_plane_funcs;
struct drm_plane_helper_funcs;
@@ -110,4 +112,12 @@ drm_kunit_helper_create_primary_plane(struct kunit *test,
unsigned int num_formats,
const uint64_t *modifiers);
+struct drm_crtc *
+drm_kunit_helper_create_crtc(struct kunit *test,
+ struct drm_device *drm,
+ struct drm_plane *primary,
+ struct drm_plane *cursor,
+ const struct drm_crtc_funcs *funcs,
+ const struct drm_crtc_helper_funcs *helper_funcs);
+
#endif // DRM_KUNIT_HELPERS_H_