[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <DF2HL69KF83U.GX59AN7IN8L@bootlin.com>
Date: Fri, 19 Dec 2025 21:47:44 +0100
From: "Luca Ceresoli" <luca.ceresoli@...tlin.com>
To: "Louis Chauvet" <louis.chauvet@...tlin.com>, "Haneen Mohammed"
<hamohammed.sa@...il.com>, "Simona Vetter" <simona@...ll.ch>, "Melissa Wen"
<melissa.srw@...il.com>, "Maarten Lankhorst"
<maarten.lankhorst@...ux.intel.com>, "Maxime Ripard" <mripard@...nel.org>,
"Thomas Zimmermann" <tzimmermann@...e.de>, "David Airlie"
<airlied@...il.com>, <jose.exposito89@...il.com>, "Jonathan Corbet"
<corbet@....net>
Cc: <victoria@...tem76.com>, <sebastian.wick@...hat.com>,
<thomas.petazzoni@...tlin.com>, <dri-devel@...ts.freedesktop.org>,
<linux-kernel@...r.kernel.org>, <linux-doc@...r.kernel.org>
Subject: Re: [PATCH RESEND v2 32/32] drm/vkms: Introduce configfs for
dynamic connector creation
On Wed Oct 29, 2025 at 3:37 PM CET, Louis Chauvet wrote:
> DRM allows the connector to be created after the device. To allows
> emulating this, add two configfs attributes to connector to allows this.
>
> Using the dynamic attribute you can set if a connector will be dynamic or
> not.
> Using the enabled attribute, you can set at runtime if a dynamic connector
> is present or not.
>
> Co-developed-by: José Expósito <jose.exposito89@...il.com>
> Signed-off-by: José Expósito <jose.exposito89@...il.com>
> Signed-off-by: Louis Chauvet <louis.chauvet@...tlin.com>
> --- a/drivers/gpu/drm/vkms/vkms_configfs.c
> +++ b/drivers/gpu/drm/vkms/vkms_configfs.c
> @@ -1215,8 +1223,10 @@ static ssize_t connector_type_store(struct config_item *item,
> }
>
> scoped_guard(mutex, &connector->dev->lock) {
> - if (connector->dev->enabled)
> - return -EINVAL;
> + if (connector->dev->enabled) {
> + if (connector_is_enabled(connector->config))
> + return -EBUSY;
> + }
You are changing from -EINVAL to -EBUSY. Why? Was -EINVAL wrong in the
first place?
And you can avoid the nested if:
if (connector->dev->enabled && connector_is_enabled(connector->config))
return -E<WHATEVER>;
> +static ssize_t connector_dynamic_show(struct config_item *item, char *page)
> +{
> + struct vkms_configfs_connector *connector;
> + bool enabled;
^^^^^^^
dynamic
Luca
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Powered by blists - more mailing lists