mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Maira Canal <mairacanal@riseup.net>
To: Jim Shargo <jshargo@chromium.org>,
	Daniel Vetter <daniel@ffwll.ch>, David Airlie <airlied@gmail.com>,
	Haneen Mohammed <hamohammed.sa@gmail.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Melissa Wen <melissa.srw@gmail.com>,
	Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>,
	Thomas Zimmermann <tzimmermann@suse.de>
Cc: dri-devel@lists.freedesktop.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 6/6] drm/vkms: Add a module param to enable/disable the default device
Date: Sun, 25 Jun 2023 15:04:05 -0300	[thread overview]
Message-ID: <64c40359-d0ee-5070-2a52-033c7e655e0a@riseup.net> (raw)
In-Reply-To: <20230623222353.97283-7-jshargo@chromium.org>

Hi Jim,

On 6/23/23 19:23, Jim Shargo wrote:
> In many testing circumstances, we will want to just create a new device
> and test against that. If we create a default device, it can be annoying
> to have to manually select the new device instead of choosing the only
> one that exists.
> 
> The param, enable_default, is defaulted to true to maintain backwards
> compatibility.
> 
> Signed-off-by: Jim Shargo <jshargo@chromium.org>
> ---
>   drivers/gpu/drm/vkms/vkms_drv.c | 44 ++++++++++++++++++++++-----------
>   1 file changed, 29 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/gpu/drm/vkms/vkms_drv.c b/drivers/gpu/drm/vkms/vkms_drv.c
> index 314a04659c5f..1cb56c090a65 100644
> --- a/drivers/gpu/drm/vkms/vkms_drv.c
> +++ b/drivers/gpu/drm/vkms/vkms_drv.c
> @@ -42,17 +42,26 @@
>   #define DRIVER_MAJOR	1
>   #define DRIVER_MINOR	0
>   
> +static bool enable_default_device = true;
> +module_param_named(enable_default_device, enable_default_device, bool, 0444);
> +MODULE_PARM_DESC(enable_default_device,
> +		 "Enable/Disable creating the default device");

Wouldn't be better to just call it "enable_default"?

Also, could you add this parameter to vkms_config debugfs file?

Best Regards,
- Maíra

> +
>   static bool enable_cursor = true;
>   module_param_named(enable_cursor, enable_cursor, bool, 0444);
> -MODULE_PARM_DESC(enable_cursor, "Enable/Disable cursor support");
> +MODULE_PARM_DESC(enable_cursor,
> +		 "Enable/Disable cursor support for the default device");
>   
>   static bool enable_writeback = true;
>   module_param_named(enable_writeback, enable_writeback, bool, 0444);
> -MODULE_PARM_DESC(enable_writeback, "Enable/Disable writeback connector support");
> +MODULE_PARM_DESC(
> +	enable_writeback,
> +	"Enable/Disable writeback connector support for the default device");
>   
>   static bool enable_overlay;
>   module_param_named(enable_overlay, enable_overlay, bool, 0444);
> -MODULE_PARM_DESC(enable_overlay, "Enable/Disable overlay support");
> +MODULE_PARM_DESC(enable_overlay,
> +		 "Enable/Disable overlay support for the default device");
>   
>   DEFINE_DRM_GEM_FOPS(vkms_driver_fops);
>   
> @@ -278,10 +287,7 @@ void vkms_remove_device(struct vkms_device *vkms_device)
>   static int __init vkms_init(void)
>   {
>   	int ret;
> -	struct platform_device *pdev;
> -	struct vkms_device_setup vkms_device_setup = {
> -		.configfs = NULL,
> -	};
> +	struct platform_device *default_pdev = NULL;
>   
>   	ret = platform_driver_register(&vkms_platform_driver);
>   	if (ret) {
> @@ -289,19 +295,27 @@ static int __init vkms_init(void)
>   		return ret;
>   	}
>   
> -	pdev = platform_device_register_data(NULL, DRIVER_NAME, 0,
> -					     &vkms_device_setup,
> -					     sizeof(vkms_device_setup));
> -	if (IS_ERR(pdev)) {
> -		DRM_ERROR("Unable to register default vkms device\n");
> -		platform_driver_unregister(&vkms_platform_driver);
> -		return PTR_ERR(pdev);
> +	if (enable_default_device) {
> +		struct vkms_device_setup vkms_device_setup = {
> +			.configfs = NULL,
> +		};
> +
> +		default_pdev = platform_device_register_data(
> +			NULL, DRIVER_NAME, 0, &vkms_device_setup,
> +			sizeof(vkms_device_setup));
> +		if (IS_ERR(default_pdev)) {
> +			DRM_ERROR("Unable to register default vkms device\n");
> +			platform_driver_unregister(&vkms_platform_driver);
> +			return PTR_ERR(default_pdev);
> +		}
>   	}
>   
>   	ret = vkms_init_configfs();
>   	if (ret) {
>   		DRM_ERROR("Unable to initialize configfs\n");
> -		platform_device_unregister(pdev);
> +		if (default_pdev)
> +			platform_device_unregister(default_pdev);
> +
>   		platform_driver_unregister(&vkms_platform_driver);
>   	}
>   

  reply	other threads:[~2023-06-25 18:04 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-23 22:23 [PATCH v2 0/6] Adds support for ConfigFS to VKMS! Jim Shargo
2023-06-23 22:23 ` [PATCH v2 1/6] drm/vkms: Back VKMS with DRM memory management instead of static objects Jim Shargo
2023-06-25 17:40   ` Maira Canal
2023-06-23 22:23 ` [PATCH v2 2/6] drm/vkms: Support multiple DRM objects (crtcs, etc.) per VKMS device Jim Shargo
2023-06-25 17:57   ` Maira Canal
2023-08-15 11:29   ` Marius Vlad
2023-08-18  3:36     ` Brandon Pollack
2023-08-18  5:26       ` Brandon Ross Pollack
2023-06-23 22:23 ` [PATCH v2 3/6] drm/vkms: Provide platform data when creating VKMS devices Jim Shargo
2023-06-23 22:23 ` [PATCH v2 4/6] drm/vkms: Add ConfigFS scaffolding to VKMS Jim Shargo
2023-06-25 18:19   ` Maira Canal
2023-06-28  2:00   ` kernel test robot
2023-06-23 22:23 ` [PATCH v2 5/6] drm/vkms: Support enabling ConfigFS devices Jim Shargo
2023-08-15 14:01   ` Marius Vlad
2023-08-18  5:24     ` Brandon Ross Pollack
2023-08-18  6:54       ` Marius Vlad
2023-06-23 22:23 ` [PATCH v2 6/6] drm/vkms: Add a module param to enable/disable the default device Jim Shargo
2023-06-25 18:04   ` Maira Canal [this message]
2023-08-18  5:39     ` Brandon Ross Pollack
2023-08-08  2:42 ` Brandon Pollack
2023-08-08  2:42 ` [PATCH] Initial backport of vkms changes from 6.4, including jshargo and brpols configs changes Brandon Pollack

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=64c40359-d0ee-5070-2a52-033c7e655e0a@riseup.net \
    --to=mairacanal@riseup.net \
    --cc=airlied@gmail.com \
    --cc=corbet@lwn.net \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hamohammed.sa@gmail.com \
    --cc=jshargo@chromium.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=melissa.srw@gmail.com \
    --cc=mripard@kernel.org \
    --cc=rodrigosiqueiramelo@gmail.com \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®