summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/tests/drm_modes_test.c
diff options
context:
space:
mode:
authorMaxime Ripard <maxime@cerno.tech>2022-12-01 16:11:41 +0100
committerMaxime Ripard <maxime@cerno.tech>2022-12-08 09:56:55 +0100
commita9143c5852a7a13d60ef685d27f9617f2a52338b (patch)
tree1a7db5ecdb9d53e58eaf78632e6c394cf7ef90c2 /drivers/gpu/drm/tests/drm_modes_test.c
parent57a84a97bbda3a4bb38534e9e37634fa9f58c7fc (diff)
downloadlinux-a9143c5852a7a13d60ef685d27f9617f2a52338b.tar.gz
linux-a9143c5852a7a13d60ef685d27f9617f2a52338b.tar.bz2
linux-a9143c5852a7a13d60ef685d27f9617f2a52338b.zip
drm/tests: helpers: Allow for a custom device struct to be allocated
The current helper to allocate a DRM device doesn't allow for any subclassing by drivers, which is going to be troublesome as we work on getting some kunit testing on atomic modesetting code. Let's use a similar pattern to the other allocation helpers by providing the structure size and offset as arguments. Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://lore.kernel.org/r/20221123-rpi-kunit-tests-v3-10-4615a663a84a@cerno.tech Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Diffstat (limited to 'drivers/gpu/drm/tests/drm_modes_test.c')
-rw-r--r--drivers/gpu/drm/tests/drm_modes_test.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/drm/tests/drm_modes_test.c b/drivers/gpu/drm/tests/drm_modes_test.c
index d1e9f3c0433a..bc4aa2ce78be 100644
--- a/drivers/gpu/drm/tests/drm_modes_test.c
+++ b/drivers/gpu/drm/tests/drm_modes_test.c
@@ -26,8 +26,9 @@ static int drm_test_modes_init(struct kunit *test)
priv->dev = drm_kunit_helper_alloc_device(test);
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, priv->dev);
- priv->drm = drm_kunit_helper_alloc_drm_device(test, priv->dev,
- DRIVER_MODESET);
+ priv->drm = __drm_kunit_helper_alloc_drm_device(test, priv->dev,
+ sizeof(*priv->drm), 0,
+ DRIVER_MODESET);
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, priv->drm);
test->priv = priv;