drm/vkms: Set device name from vkms_config

In order to be able to create multiple devices, the device name needs to
be unique.

Allow to set it in the VKMS configuration.

Reviewed-by: Louis Chauvet <louis.chauvet@bootlin.com>
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250218101214.5790-7-jose.exposito89@gmail.com
Signed-off-by: Maxime Ripard <mripard@kernel.org>
This commit is contained in:
José Expósito
2025-02-18 11:12:06 +01:00
committed by Maxime Ripard
parent 8b059b0c3f
commit 969a3a4e2b
5 changed files with 40 additions and 5 deletions

View File

@@ -15,10 +15,15 @@ struct default_config_case {
static void vkms_config_test_empty_config(struct kunit *test)
{
struct vkms_config *config;
const char *dev_name = "test";
config = vkms_config_create();
config = vkms_config_create(dev_name);
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, config);
/* The dev_name string and the config have different lifetimes */
dev_name = NULL;
KUNIT_EXPECT_STREQ(test, vkms_config_get_device_name(config), "test");
vkms_config_destroy(config);
}