[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5b173e9e-bcff-4b19-b16f-fe57796b99ae@bootlin.com>
Date: Fri, 19 Dec 2025 23:01:09 +0100
From: Louis Chauvet <louis.chauvet@...tlin.com>
To: Luca Ceresoli <luca.ceresoli@...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 12/19/25 21:47, Luca Ceresoli wrote:
> 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?
EINVAL was wrong in the first place, we try to remove EBUSY when you
can't do something because the device is already enabled and EINVAL when
the value is false.
>
> And you can avoid the nested if:
>
> if (connector->dev->enabled && connector_is_enabled(connector->config))
> return -E<WHATEVER>;
It is probably a remaining of previous implementation, thanks!
>> +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