[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <65C56D17-EDFE-42E6-A8E0-57DEFF577886@bootlin.com>
Date: Mon, 25 Nov 2024 09:50:01 +0000
From: Louis Chauvet <louis.chauvet@...tlin.com>
To: dri-devel@...ts.freedesktop.org, Jani Nikula <jani.nikula@...ux.intel.com>,
Maíra Canal <mairacanal@...eup.net>,
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>
CC: arthurgrillo@...eup.net, jeremie.dautheribes@...tlin.com,
miquel.raynal@...tlin.com, thomas.petazzoni@...tlin.com, seanpaul@...gle.com,
nicolejadeyee@...gle.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH RFC v2 10/18] drm/vkms: Introduce config for encoder name
Le 25 novembre 2024 09:28:44 UTC, Jani Nikula <jani.nikula@...ux.intel.com> a écrit :
>On Fri, 22 Nov 2024, Louis Chauvet <louis.chauvet@...tlin.com> wrote:
>> As an encoder will be a directory in ConfigFS, add the configuration for
>> encoder name so we will be able to reflect the configfs directory name in
>> the drm name.
>>
>> Signed-off-by: Louis Chauvet <louis.chauvet@...tlin.com>
>> ---
>> drivers/gpu/drm/vkms/vkms_config.c | 6 ++++++
>> drivers/gpu/drm/vkms/vkms_config.h | 2 ++
>> drivers/gpu/drm/vkms/vkms_output.c | 2 +-
>> 3 files changed, 9 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/vkms/vkms_config.c b/drivers/gpu/drm/vkms/vkms_config.c
>> index e44ed904cefb97b8b6ab8fc27623e315397e0106..a2539fb56b602569b75748fdf9c4784f104b0bff 100644
>> --- a/drivers/gpu/drm/vkms/vkms_config.c
>> +++ b/drivers/gpu/drm/vkms/vkms_config.c
>> @@ -41,6 +41,10 @@ struct vkms_config *vkms_config_alloc_default(bool enable_writeback, bool enable
>> encoder = vkms_config_create_encoder(vkms_config);
>> if (!encoder)
>> goto err_alloc;
>> + encoder->name = kzalloc(sizeof("Main Encoder"), GFP_KERNEL);
>> + if (!encoder->name)
>> + goto err_alloc;
>> + sprintf(encoder->name, "Main Encoder");
>
>Drive-by comment, maybe kstrdup()?
Nice catch, thank you!
I will update for next version.
Thanks,
Louis Chauvet
>>
>> if (vkms_config_encoder_attach_crtc(encoder, crtc))
>> goto err_alloc;
>> @@ -238,6 +242,7 @@ void vkms_config_delete_encoder(struct vkms_config_encoder *vkms_config_encoder,
>> }
>> }
>>
>> + kfree(vkms_config_encoder->name);
>> kfree(vkms_config_encoder);
>> }
>>
>> @@ -403,6 +408,7 @@ static int vkms_config_show(struct seq_file *m, void *data)
>>
>> list_for_each_entry(config_encoder, &vkmsdev->config->encoders, link) {
>> seq_puts(m, "encoder:\n");
>> + seq_printf(m, "\tname: %s\n", config_encoder->name);
>> }
>>
>> list_for_each_entry(config_crtc, &vkmsdev->config->crtcs, link) {
>> diff --git a/drivers/gpu/drm/vkms/vkms_config.h b/drivers/gpu/drm/vkms/vkms_config.h
>> index 8f247fc09373fb2c8145e83be05c6afec1ffac1c..4223edd94ec270915dd658c0b5efd489554d33a5 100644
>> --- a/drivers/gpu/drm/vkms/vkms_config.h
>> +++ b/drivers/gpu/drm/vkms/vkms_config.h
>> @@ -50,6 +50,7 @@ struct vkms_config_crtc {
>> * struct vkms_config_encoder
>> *
>> * @link: Link to the others encoders
>> + * @name: Name of the encoder
>> * @possible_crtcs: List of CRTC that can be used with this encoder
>> * @encoder: Internal usage. This pointer should never be considered as valid. It can be used to
>> * store a temporary reference to a vkms encoder during device creation. This pointer is
>> @@ -58,6 +59,7 @@ struct vkms_config_crtc {
>> struct vkms_config_encoder {
>> struct list_head link;
>>
>> + char *name;
>> struct xarray possible_crtcs;
>>
>> /* Internal usage */
>> diff --git a/drivers/gpu/drm/vkms/vkms_output.c b/drivers/gpu/drm/vkms/vkms_output.c
>> index 03498a20d78dd8a66f9fc66b360c5ea57fc48d88..6277ad72fdd476d1eff52ad037389bdb1a254f5e 100644
>> --- a/drivers/gpu/drm/vkms/vkms_output.c
>> +++ b/drivers/gpu/drm/vkms/vkms_output.c
>> @@ -92,7 +92,7 @@ int vkms_output_init(struct vkms_device *vkmsdev)
>> if (!config_encoder->encoder)
>> return -ENOMEM;
>> ret = drmm_encoder_init(dev, config_encoder->encoder, NULL,
>> - DRM_MODE_ENCODER_VIRTUAL, NULL);
>> + DRM_MODE_ENCODER_VIRTUAL, config_encoder->name);
>> if (ret) {
>> DRM_ERROR("Failed to init encoder\n");
>> return ret;
>
Powered by blists - more mailing lists