From: Louis Chauvet <louis.chauvet@bootlin.com>
To: Marius Vlad <marius.vlad@collabora.com>, dri-devel@lists.freedesktop.org
Cc: dmitry.baryshkov@oss.qualcomm.com, tzimmermann@suse.de,
simona.vetter@ffwll.ch, jani.nikula@linux.intel.com,
ian.forbes@broadcom.com, daniel.stone@collabora.com
Subject: Re: [PATCH v4 3/3] drm/vkms: Add polling for HPD
Date: Tue, 4 Nov 2025 11:21:28 +0100 [thread overview]
Message-ID: <cb53bb27-66d8-44ef-beec-48b093f50d8c@bootlin.com> (raw)
In-Reply-To: <20251103174558.7709-4-marius.vlad@collabora.com>
Le 03/11/2025 à 18:45, Marius Vlad a écrit :
> vkms is missing any kind of HPD (polling/irq), so add polling to handle
> hotplug events.
Hi,
I am a bit surprised by this addition, we currently have hotplug/unplug
in VKMS using configFS, and it seems to work. The current "irq" system
is writing in configFS the status and call drm_kms_helper_hotplug_event
after the status is updated [1].
I think the polling will not work, I read in the
drm_kms_helper_poll_init documentation that the connector is not polled
if some connector flags are not set [2]/[3].
If the polling works, I don't think it will be enough for the current
VKMS implementation. Currently setting status using configFS will do
everything synchronously:
- Set the connector status (next call to connector->detect will have the
new value)
- Call drm_kms_helper_hotplug_event
With your implementation, I think you expect something to update
connector->status_changed in between, using polling if I understood
correctly, which will probably happen after the call to
drm_kms_helper_hotplug_event.
[1]:https://gitlab.freedesktop.org/drm/misc/kernel/-/blob/drm-misc-next/drivers/gpu/drm/vkms/vkms_connector.c?ref_type=heads#L91-96
[2]:https://elixir.bootlin.com/linux/v6.17.7/source/drivers/gpu/drm/drm_probe_helper.c#L917-L918
[3]:https://elixir.bootlin.com/linux/v6.17.7/source/drivers/gpu/drm/drm_probe_helper.c#L793
> Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
> ---
> drivers/gpu/drm/vkms/vkms_drv.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/vkms/vkms_drv.c b/drivers/gpu/drm/vkms/vkms_drv.c
> index e8472d9b6e3b..ec815c42ef04 100644
> --- a/drivers/gpu/drm/vkms/vkms_drv.c
> +++ b/drivers/gpu/drm/vkms/vkms_drv.c
> @@ -198,6 +198,9 @@ static int vkms_create(struct vkms_config *config)
> if (ret)
> goto out_devres;
>
> + /* init kms poll for handling hpd */
> + drm_kms_helper_poll_init(&vkms_device->drm);
> +
> drm_client_setup(&vkms_device->drm, NULL);
>
> return 0;
> @@ -240,6 +243,7 @@ static void vkms_destroy(struct vkms_config *config)
>
> fdev = config->dev->faux_dev;
>
> + drm_kms_helper_poll_fini(&config->dev->drm);
> drm_dev_unregister(&config->dev->drm);
> drm_atomic_helper_shutdown(&config->dev->drm);
> devres_release_group(&fdev->dev, NULL);
--
--
Louis Chauvet, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2025-11-04 10:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-03 17:45 [PATCH v4 0/3] Pass down hot plug CONNECTOR ID to user-space Marius Vlad
2025-11-03 17:45 ` [PATCH v4 1/3] drm: Introduce a new connector status Marius Vlad
2025-11-03 17:45 ` [PATCH v4 2/3] drm: Propagate connector status change Marius Vlad
2025-11-03 17:45 ` [PATCH v4 3/3] drm/vkms: Add polling for HPD Marius Vlad
2025-11-04 10:21 ` Louis Chauvet [this message]
2025-11-04 14:19 ` Marius Vlad
2025-11-06 9:02 ` 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=cb53bb27-66d8-44ef-beec-48b093f50d8c@bootlin.com \
--to=louis.chauvet@bootlin.com \
--cc=daniel.stone@collabora.com \
--cc=dmitry.baryshkov@oss.qualcomm.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=ian.forbes@broadcom.com \
--cc=jani.nikula@linux.intel.com \
--cc=marius.vlad@collabora.com \
--cc=simona.vetter@ffwll.ch \
--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