diff options
author | Maxime Ripard <maxime@cerno.tech> | 2022-12-01 16:11:41 +0100 |
---|---|---|
committer | Maxime Ripard <maxime@cerno.tech> | 2022-12-08 09:56:55 +0100 |
commit | a9143c5852a7a13d60ef685d27f9617f2a52338b (patch) | |
tree | 1a7db5ecdb9d53e58eaf78632e6c394cf7ef90c2 /drivers/gpu/drm/tests/drm_client_modeset_test.c | |
parent | 57a84a97bbda3a4bb38534e9e37634fa9f58c7fc (diff) | |
download | linux-stable-a9143c5852a7a13d60ef685d27f9617f2a52338b.tar.gz linux-stable-a9143c5852a7a13d60ef685d27f9617f2a52338b.tar.bz2 linux-stable-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_client_modeset_test.c')
-rw-r--r-- | drivers/gpu/drm/tests/drm_client_modeset_test.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/tests/drm_client_modeset_test.c b/drivers/gpu/drm/tests/drm_client_modeset_test.c index 053dbc0106d9..416a279b6dae 100644 --- a/drivers/gpu/drm/tests/drm_client_modeset_test.c +++ b/drivers/gpu/drm/tests/drm_client_modeset_test.c @@ -63,7 +63,9 @@ static int drm_client_modeset_test_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); ret = drmm_connector_init(priv->drm, &priv->connector, |