From: "José Expósito" <jose.exposito89@gmail.com>
To: Louis Chauvet <louis.chauvet@bootlin.com>
Cc: 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>,
Jonathan Corbet <corbet@lwn.net>,
victoria@system76.com, sebastian.wick@redhat.com,
thomas.petazzoni@bootlin.com, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org
Subject: Re: [PATCH 20/22] drm/vkms: Store the enabled/disabled status for connector
Date: Mon, 27 Oct 2025 15:52:30 +0100 [thread overview]
Message-ID: <aP-HLjiHzs2v5F8-@fedora> (raw)
In-Reply-To: <20251018-vkms-all-config-v1-20-a7760755d92d@bootlin.com>
On Sat, Oct 18, 2025 at 04:01:20AM +0200, Louis Chauvet wrote:
> In order to prepare for dynamic connector configuration, we need to store
> if a connector is dynamic and if it is enabled.
>
> The two new vkms_config_connector fields will helps for that.
>
> Co-developed-by: José Expósito <jose.exposito89@gmail.com>
> Signed-off-by: José Expósito <jose.exposito89@gmail.com>
> Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
> ---
> drivers/gpu/drm/vkms/tests/vkms_config_test.c | 4 ++
> drivers/gpu/drm/vkms/vkms_config.c | 2 +
> drivers/gpu/drm/vkms/vkms_config.h | 66 +++++++++++++++++++++++++++
> 3 files changed, 72 insertions(+)
>
> diff --git a/drivers/gpu/drm/vkms/tests/vkms_config_test.c b/drivers/gpu/drm/vkms/tests/vkms_config_test.c
> index d1e380da31ff..f4b5f8f59fab 100644
> --- a/drivers/gpu/drm/vkms/tests/vkms_config_test.c
> +++ b/drivers/gpu/drm/vkms/tests/vkms_config_test.c
> @@ -192,6 +192,10 @@ static void vkms_config_test_default_config(struct kunit *test)
> 0);
> KUNIT_EXPECT_EQ(test, vkms_config_connector_get_edid_enabled(connector_cfg),
> false);
> + KUNIT_EXPECT_EQ(test, vkms_config_connector_is_enabled(connector_cfg),
> + true);
> + KUNIT_EXPECT_EQ(test, vkms_config_connector_is_dynamic(connector_cfg),
> + false);
I missed this in other reviews, but you can use KUNIT_EXPECT_TRUE/FALSE instead.
> }
>
> KUNIT_EXPECT_TRUE(test, vkms_config_is_valid(config));
> diff --git a/drivers/gpu/drm/vkms/vkms_config.c b/drivers/gpu/drm/vkms/vkms_config.c
> index 56e2082b91c9..fd724ae2ebc9 100644
> --- a/drivers/gpu/drm/vkms/vkms_config.c
> +++ b/drivers/gpu/drm/vkms/vkms_config.c
> @@ -773,6 +773,8 @@ struct vkms_config_connector *vkms_config_create_connector(struct vkms_config *c
> connector_cfg->status = connector_status_connected;
> vkms_config_connector_set_type(connector_cfg, DRM_MODE_CONNECTOR_VIRTUAL);
> vkms_config_connector_set_supported_colorspaces(connector_cfg, 0);
> + vkms_config_connector_set_dynamic(connector_cfg, false);
> + vkms_config_connector_set_enabled(connector_cfg, true);
> xa_init_flags(&connector_cfg->possible_encoders, XA_FLAGS_ALLOC);
>
> list_add_tail(&connector_cfg->link, &config->connectors);
> diff --git a/drivers/gpu/drm/vkms/vkms_config.h b/drivers/gpu/drm/vkms/vkms_config.h
> index eaf76a58aab6..6716b5a85f0d 100644
> --- a/drivers/gpu/drm/vkms/vkms_config.h
> +++ b/drivers/gpu/drm/vkms/vkms_config.h
> @@ -128,6 +128,8 @@ struct vkms_config_encoder {
> * @link: Link to the others connector in vkms_config
> * @type: Store the type of connector using DRM_MODE_CONNECTOR_* values
> * @config: The vkms_config this connector belongs to
> + * @dynamic: Store if a connector should be created with drm_connector_dynamic_init
> + * @enabled: If @dynamic, this means that the correct is currently registered in drm
> * @status: Status (connected, disconnected...) of the connector
> * @edid: Stores the current EDID
> * @edid_len: Current EDID length
> @@ -142,6 +144,8 @@ struct vkms_config_connector {
> struct vkms_config *config;
>
> int type;
> + bool enabled;
> + bool dynamic;
In this patch we could also log this in vkms_config_show().
> enum drm_connector_status status;
> u32 supported_colorspaces;
> bool edid_enabled;
> @@ -185,6 +189,24 @@ struct vkms_config_connector {
> #define vkms_config_for_each_connector(config, connector_cfg) \
> list_for_each_entry((connector_cfg), &(config)->connectors, link)
>
> +/**
> + * vkms_config_for_each_connector_static - Iterate over the static vkms_config connectors
> + * @config: &struct vkms_config pointer
> + * @connector_cfg: &struct vkms_config_connector pointer used as cursor
> + */
> +#define vkms_config_for_each_connector_static(config, connector_cfg) \
> + vkms_config_for_each_connector((config), (connector_cfg)) \
> + if (!(connector_cfg)->dynamic)
> +
> +/**
> + * vkms_config_for_each_connector_dynamic - Iterate over the dynamic vkms_config connectors
> + * @config: &struct vkms_config pointer
> + * @connector_cfg: &struct vkms_config_connector pointer used as cursor
> + */
> +#define vkms_config_for_each_connector_dynamic(config, connector_cfg) \
> + vkms_config_for_each_connector((config), (connector_cfg)) \
> + if ((connector_cfg)->dynamic)
> +
> /**
> * vkms_config_plane_for_each_possible_crtc - Iterate over the vkms_config_plane
> * possible CRTCs
> @@ -441,6 +463,50 @@ vkms_config_connector_set_type(struct vkms_config_connector *connector_cfg,
> connector_cfg->type = type;
> }
>
> +/**
> + * vkms_config_connector_set_enabled() - If the connector is part of the device
> + * @crtc_cfg: Target connector
> + * @enabled: Add or remove the connector
> + */
> +static inline void
> +vkms_config_connector_set_enabled(struct vkms_config_connector *connector_cfg,
> + bool enabled)
> +{
> + connector_cfg->enabled = enabled;
> +}
> +
> +/**
> + * vkms_config_connector_is_enabled() - If the connector is part of the device
> + * @connector_cfg: The connector
> + */
> +static inline bool
> +vkms_config_connector_is_enabled(struct vkms_config_connector *connector_cfg)
> +{
> + return connector_cfg->enabled;
> +}
> +
> +/**
> + * vkms_config_connector_set_dynamic() - If the connector is dynamic
> + * @crtc_cfg: Target connector
> + * @enabled: Enable or disable the dynamic status
> + */
> +static inline void
> +vkms_config_connector_set_dynamic(struct vkms_config_connector *connector_cfg,
> + bool dynamic)
> +{
> + connector_cfg->dynamic = dynamic;
> +}
> +
> +/**
> + * vkms_config_connector_is_enabled() - If the connector is dynamic
> + * @connector_cfg: The connector
> + */
> +static inline bool
> +vkms_config_connector_is_dynamic(struct vkms_config_connector *connector_cfg)
> +{
> + return connector_cfg->dynamic;
> +}
> +
> /*
> * vkms_config_plane_get_default_rotation() - Get the default rotation for a plane
> * @plane_cfg: Plane to get the default rotation from
>
> --
> 2.51.0
>
next prev parent reply other threads:[~2025-10-27 14:52 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-18 2:01 [PATCH 00/22] VKMS: Introduce multiple configFS attributes Louis Chauvet
2025-10-18 2:01 ` [PATCH 01/22] drm/vkms: Introduce config for plane name Louis Chauvet
2025-10-24 11:16 ` José Expósito
2025-10-27 10:15 ` Jani Nikula
2025-10-18 2:01 ` [PATCH 02/22] drm/vkms: Introduce configfs " Louis Chauvet
2025-10-24 11:20 ` José Expósito
2025-10-18 2:01 ` [PATCH 03/22] drm/vkms: Introduce config for plane rotation Louis Chauvet
2025-10-24 11:53 ` José Expósito
2025-10-18 2:01 ` [PATCH 04/22] drm/vkms: Introduce configfs " Louis Chauvet
2025-10-24 14:50 ` José Expósito
2025-10-18 2:01 ` [PATCH 05/22] drm/vkms: Introduce config for plane color encoding Louis Chauvet
2025-10-24 15:14 ` José Expósito
2025-10-18 2:01 ` [PATCH 06/22] drm/vkms: Introduce configfs " Louis Chauvet
2025-10-24 15:16 ` José Expósito
2025-10-18 2:01 ` [PATCH 07/22] drm/vkms: Introduce config for plane color range Louis Chauvet
2025-10-24 15:25 ` José Expósito
2025-10-18 2:01 ` [PATCH 08/22] drm/vkms: Introduce configfs " Louis Chauvet
2025-10-24 15:27 ` José Expósito
2025-10-18 2:01 ` [PATCH 09/22] drm/vkms: Introduce config for plane format Louis Chauvet
2025-10-24 15:44 ` José Expósito
2025-10-18 2:01 ` [PATCH 10/22] drm/vkms: Introduce configfs " Louis Chauvet
2025-10-27 8:55 ` José Expósito
2025-10-18 2:01 ` [PATCH 11/22] drm/vkms: Properly render plane using their zpos Louis Chauvet
2025-10-18 2:01 ` [PATCH 12/22] drm/vkms: Introduce config for plane zpos property Louis Chauvet
2025-10-27 9:12 ` José Expósito
2025-10-18 2:01 ` [PATCH 13/22] drm/vkms: Introduce configfs " Louis Chauvet
2025-10-27 9:19 ` José Expósito
2025-10-18 2:01 ` [PATCH 14/22] drm/vkms: Introduce config for connector type Louis Chauvet
2025-10-27 9:27 ` José Expósito
2025-10-18 2:01 ` [PATCH 15/22] drm/vkms: Introduce configfs " Louis Chauvet
2025-10-18 2:01 ` [PATCH 16/22] drm/vkms: Introduce config for connector supported colorspace Louis Chauvet
2025-10-27 9:35 ` José Expósito
2025-10-27 9:38 ` José Expósito
2025-10-18 2:01 ` [PATCH 17/22] drm/vkms: Introduce configfs " Louis Chauvet
2025-10-18 2:01 ` [PATCH 18/22] drm/vkms: Introduce config for connector EDID Louis Chauvet
2025-10-27 10:02 ` José Expósito
2025-10-18 2:01 ` [PATCH 19/22] drm/vkms: Introduce configfs " Louis Chauvet
2025-10-27 10:16 ` José Expósito
2025-10-27 17:18 ` Louis Chauvet
2025-10-18 2:01 ` [PATCH 20/22] drm/vkms: Store the enabled/disabled status for connector Louis Chauvet
2025-10-27 14:52 ` José Expósito [this message]
2025-10-18 2:01 ` [PATCH 21/22] drm/vkms: Allow to hot-add connectors Louis Chauvet
2025-10-27 15:01 ` José Expósito
2025-10-18 2:01 ` [PATCH 22/22] drm/vkms: Allows the creation of connector at runtime Louis Chauvet
2025-10-27 15:17 ` José Expósito
2025-10-27 15:22 ` [PATCH 00/22] VKMS: Introduce multiple configFS attributes José Expósito
2025-10-27 15:53 ` Louis Chauvet
2025-10-28 7:32 ` José Expósito
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=aP-HLjiHzs2v5F8-@fedora \
--to=jose.exposito89@gmail.com \
--cc=airlied@gmail.com \
--cc=corbet@lwn.net \
--cc=dri-devel@lists.freedesktop.org \
--cc=hamohammed.sa@gmail.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=louis.chauvet@bootlin.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=melissa.srw@gmail.com \
--cc=mripard@kernel.org \
--cc=sebastian.wick@redhat.com \
--cc=simona@ffwll.ch \
--cc=thomas.petazzoni@bootlin.com \
--cc=tzimmermann@suse.de \
--cc=victoria@system76.com \
/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;
as well as URLs for NNTP newsgroup(s).