From: Jani Nikula <jani.nikula@linux.intel.com>
To: "Louis Chauvet" <louis.chauvet@bootlin.com>,
"Maíra Canal" <mairacanal@riseup.net>,
"Haneen Mohammed" <hamohammed.sa@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>,
"Melissa Wen" <melissa.srw@gmail.com>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Maxime Ripard" <mripard@kernel.org>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"David Airlie" <airlied@gmail.com>
Cc: arthurgrillo@riseup.net, jeremie.dautheribes@bootlin.com,
miquel.raynal@bootlin.com, thomas.petazzoni@bootlin.com,
seanpaul@google.com, nicolejadeyee@google.com,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
Louis Chauvet <louis.chauvet@bootlin.com>
Subject: Re: [PATCH RFC v2 11/18] drm/vkms: Introduce config for CRTC name
Date: Mon, 25 Nov 2024 11:29:17 +0200 [thread overview]
Message-ID: <87r06zy842.fsf@intel.com> (raw)
In-Reply-To: <20241122-google-remove-crtc-index-from-parameter-v2-11-81540742535a@bootlin.com>
On Fri, 22 Nov 2024, Louis Chauvet <louis.chauvet@bootlin.com> wrote:
> As a CRTC will be a directory in ConfigFS, add the name configuration for
> CRTC name so we will be able to reflect the configfs directory name in the
> drm name.
>
> Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
> ---
> drivers/gpu/drm/vkms/vkms_config.c | 5 +++++
> drivers/gpu/drm/vkms/vkms_config.h | 2 ++
> drivers/gpu/drm/vkms/vkms_crtc.c | 2 +-
> 3 files changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/vkms/vkms_config.c b/drivers/gpu/drm/vkms/vkms_config.c
> index a2539fb56b602569b75748fdf9c4784f104b0bff..3252f657ce515c0193a8c0e709bfe861feba0aca 100644
> --- a/drivers/gpu/drm/vkms/vkms_config.c
> +++ b/drivers/gpu/drm/vkms/vkms_config.c
> @@ -37,6 +37,10 @@ struct vkms_config *vkms_config_alloc_default(bool enable_writeback, bool enable
> if (!crtc)
> goto err_alloc;
> crtc->writeback = enable_writeback;
> + crtc->name = kzalloc(sizeof("Main CRTC"), GFP_KERNEL);
> + if (!crtc->name)
> + goto err_alloc;
> + sprintf(crtc->name, "Main CRTC");
Ditto, kstrdup()
>
> encoder = vkms_config_create_encoder(vkms_config);
> if (!encoder)
> @@ -219,6 +223,7 @@ void vkms_config_delete_crtc(struct vkms_config_crtc *vkms_config_crtc,
> }
> }
>
> + kfree(vkms_config_crtc->name);
> kfree(vkms_config_crtc);
> }
>
> diff --git a/drivers/gpu/drm/vkms/vkms_config.h b/drivers/gpu/drm/vkms/vkms_config.h
> index 4223edd94ec270915dd658c0b5efd489554d33a5..4a4c16dea7855cf36060986ef247be698974fafc 100644
> --- a/drivers/gpu/drm/vkms/vkms_config.h
> +++ b/drivers/gpu/drm/vkms/vkms_config.h
> @@ -29,6 +29,7 @@ struct vkms_config {
> * struct vkms_config_crtc
> *
> * @link: Link to the others CRTCs
> + * @name: Name of the CRTC
> * @possible_planes: List of planes that can be used with this CRTC
> * @possible_encoders: List of encoders that can be used with this CRTC
> * @crtc: Internal usage. This pointer should never be considered as valid. It can be used to
> @@ -38,6 +39,7 @@ struct vkms_config {
> struct vkms_config_crtc {
> struct list_head link;
>
> + char *name;
> bool writeback;
> struct xarray possible_planes;
> struct xarray possible_encoders;
> diff --git a/drivers/gpu/drm/vkms/vkms_crtc.c b/drivers/gpu/drm/vkms/vkms_crtc.c
> index 3825fba57c012f84cbe67114e053dcd7fcfa283d..25a3d97a362afd0d40f3e023d9cce985d447a880 100644
> --- a/drivers/gpu/drm/vkms/vkms_crtc.c
> +++ b/drivers/gpu/drm/vkms/vkms_crtc.c
> @@ -292,7 +292,7 @@ struct vkms_crtc *vkms_crtc_init(struct vkms_device *vkms_device,
>
> vkms_crtc = drmm_crtc_alloc_with_planes(dev, struct vkms_crtc, base,
> primary, cursor,
> - &vkms_crtc_funcs, NULL);
> + &vkms_crtc_funcs, config->name);
> if (IS_ERR(vkms_crtc)) {
> DRM_DEV_ERROR(dev->dev, "Failed to init CRTC\n");
> return vkms_crtc;
--
Jani Nikula, Intel
next prev parent reply other threads:[~2024-11-25 9:29 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-22 17:20 [PATCH RFC v2 00/18] drm/vkms: Introduce detailed configuration Louis Chauvet
2024-11-22 17:20 ` [PATCH RFC v2 01/18] drm/vkms: Extract vkms_config header Louis Chauvet
2024-11-22 17:20 ` [PATCH RFC v2 02/18] drm/vkms: Add a validation function for vkms configuration Louis Chauvet
2024-11-22 17:20 ` [PATCH RFC v2 03/18] drm/vkms: Move default_config creation to its own function Louis Chauvet
2024-11-22 17:20 ` [PATCH RFC v2 04/18] drm/vkms: Introduce config for plane Louis Chauvet
2024-11-22 17:20 ` [PATCH RFC v2 05/18] drm/vkms: Introduce config for plane name Louis Chauvet
2024-11-22 17:20 ` [PATCH RFC v2 06/18] drm/vkms: Introduce config for plane rotation Louis Chauvet
2024-11-22 17:20 ` [PATCH RFC v2 07/18] drm/vkms: Introduce config for plane color encoding Louis Chauvet
2024-11-22 17:20 ` [PATCH RFC v2 08/18] drm/vkms: Introduce config for plane color range Louis Chauvet
2024-11-22 17:20 ` [PATCH RFC v2 09/18] drm/vkms: Introduce config for CRTCs and encoders Louis Chauvet
2024-11-22 17:20 ` [PATCH RFC v2 10/18] drm/vkms: Introduce config for encoder name Louis Chauvet
2024-11-25 9:28 ` Jani Nikula
2024-11-25 9:50 ` Louis Chauvet
2024-11-22 17:20 ` [PATCH RFC v2 11/18] drm/vkms: Introduce config for CRTC name Louis Chauvet
2024-11-25 9:29 ` Jani Nikula [this message]
2024-11-22 17:20 ` [PATCH RFC v2 12/18] drm/vkms: Add test for config structure Louis Chauvet
2024-11-22 17:20 ` [PATCH RFC v2 13/18] drm/vkms: Introduce config for connector Louis Chauvet
2024-11-22 17:20 ` [PATCH RFC v2 14/18] drm/vkms: Introduce config for connector type Louis Chauvet
2024-11-22 17:20 ` [PATCH RFC v2 15/18] drm/vkms: Introduce config for plane format Louis Chauvet
2024-11-22 17:20 ` [PATCH RFC v2 16/18] drm/vkms: Introduce config for connector status Louis Chauvet
2024-11-22 17:20 ` [PATCH RFC v2 17/18] drm/vkms: Introduce config for connector EDID Louis Chauvet
2024-11-22 21:28 ` Ian Forbes
2024-11-23 10:45 ` Louis Chauvet
2024-11-25 9:45 ` Jani Nikula
2024-11-25 10:19 ` Louis Chauvet
2024-11-22 17:20 ` [PATCH RFC v2 18/18] drm/vkms: Introduce config for encoder type Louis Chauvet
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=87r06zy842.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=airlied@gmail.com \
--cc=arthurgrillo@riseup.net \
--cc=dri-devel@lists.freedesktop.org \
--cc=hamohammed.sa@gmail.com \
--cc=jeremie.dautheribes@bootlin.com \
--cc=linux-kernel@vger.kernel.org \
--cc=louis.chauvet@bootlin.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mairacanal@riseup.net \
--cc=melissa.srw@gmail.com \
--cc=miquel.raynal@bootlin.com \
--cc=mripard@kernel.org \
--cc=nicolejadeyee@google.com \
--cc=seanpaul@google.com \
--cc=simona@ffwll.ch \
--cc=thomas.petazzoni@bootlin.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