]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/vkms: Allow to configure the default device creation
authorJosé Expósito <jose.exposito89@gmail.com>
Thu, 16 Oct 2025 17:56:14 +0000 (19:56 +0200)
committerLuca Ceresoli <luca.ceresoli@bootlin.com>
Wed, 22 Oct 2025 11:19:26 +0000 (13:19 +0200)
Add a new module param to allow to create or not the default VKMS
instance. Useful when combined with configfs to avoid having additional
VKMS instances.

Tested-by: Mark Yacoub <markyacoub@google.com>
Reviewed-by: Louis Chauvet <louis.chauvet@bootlin.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Link: https://lore.kernel.org/r/20251016175618.10051-13-jose.exposito89@gmail.com
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
drivers/gpu/drm/vkms/vkms_drv.c

index c1f23e6a4b076140fba7d1f66ad78ab1fad16cb6..6d299903fab2c131f0f48200950c75076f69421b 100644 (file)
@@ -50,6 +50,10 @@ static bool enable_overlay;
 module_param_named(enable_overlay, enable_overlay, bool, 0444);
 MODULE_PARM_DESC(enable_overlay, "Enable/Disable overlay support");
 
+static bool create_default_dev = true;
+module_param_named(create_default_dev, create_default_dev, bool, 0444);
+MODULE_PARM_DESC(create_default_dev, "Create or not the default VKMS device");
+
 DEFINE_DRM_GEM_FOPS(vkms_driver_fops);
 
 static void vkms_atomic_commit_tail(struct drm_atomic_state *old_state)
@@ -219,6 +223,9 @@ static int __init vkms_init(void)
        if (ret)
                return ret;
 
+       if (!create_default_dev)
+               return 0;
+
        config = vkms_config_default_create(enable_cursor, enable_writeback, enable_overlay);
        if (IS_ERR(config))
                return PTR_ERR(config);