mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Michel Dänzer" <michel.daenzer@mailbox.org>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: Julian Orth <ju.orth@gmail.com>,
	Nicolas Frattaroli <nicolas.frattaroli@collabora.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	Louis Chauvet <louis.chauvet@bootlin.com>,
	Haneen Mohammed <hamohammed.sa@gmail.com>,
	Melissa Wen <melissa.srw@gmail.com>,
	Daniel Stone <daniel.stone@collabora.com>,
	Ian Forbes <ian.forbes@broadcom.com>,
	Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	kernel@collabora.com, wayland-devel@lists.freedesktop.org,
	Marius Vlad <marius.vlad@collabora.com>,
	Imre Deak <imre.deak@intel.com>
Subject: Re: [PATCH RESEND v7 0/2] Pass down hot-plug CONNECTOR ID to user-space
Date: Tue, 21 Apr 2026 12:13:34 +0200	[thread overview]
Message-ID: <bcd00cbe-ba89-4927-a295-726856ab3d9c@mailbox.org> (raw)
In-Reply-To: <aeKA6D7Iei612FKa@intel.com>

On 4/17/26 20:50, Ville Syrjälä wrote:
> On Fri, Apr 17, 2026 at 06:40:51PM +0200, Michel Dänzer wrote:
>> On 4/17/26 16:55, Ville Syrjälä wrote:
>>> On Fri, Apr 17, 2026 at 04:17:45PM +0200, Michel Dänzer wrote:
>>>> On 4/17/26 12:57, Ville Syrjälä wrote:
>>>>>>>>>> I think the userspace behaviour there was that you get a disconnected,
>>>>> defer processing it, and then you get a reconnect, and then decide that
>>>>> nothing actually changed and a modeset is not needed after all. That is
>>>>> not correct IMO. Clearly a ->disconnect->reconnect should count as a
>>>>> change in the connector's state, and a full modeset is thus required.
>>>>
>>>> While that makes sense to me in principle, as Julian pointed out, the kernel can't rely on user space seeing the intermittent disconnected state.
>>>>
>>>> Seems like another argument for a serial number property. That would make the need for a modeset unambiguous.
>>>
>>> [...]
>>>
>>> But for the case where the kernel only sends the per-connector uevents
>>> and the drm master sees all of them the serial number would do nothing.
>>> In that case the kernel wouldn't even send the uevent unless the
>>> serial number has changed.
>>
>> The serial number is still necessary in cases where status flip-flops connected → disconnected → connected, user space never sees the disconnected state though.
> 
> I suppose that could happen if the flip flop is fast enough that the
> status has changed back to connected by the time userspace gets to
> process the first uevent. Although the fact that the uevent was sent
> in the first place (assuming it's the per-connector one) would imply
> that something did in fact change.

There are cases where hotplug events get triggered despite nothing changing from the user PoV,
e.g. due to monitors polling their other inputs. Reacting to such hotplug events can have various undesirable side effects, that's why compositors are trying to avoid it.

> But I do agree that having a clear signal in the form of the changed serial
> number would avoid a lot of weird guesswork in userspace.

Either that, or setting link-status to bad, yeah.

In the scenario we're discussing here, the latter might be even clearer actually, since a modeset isn't always required.


>>>> Note that the referenced issue is about a different scenario though:
>>>>
>>>> 1. mutter does modeset for DPMS off
>>>> 2. hotplug events during DPMS off (presumably triggered by the monitor scanning its inputs)
>>>> 3. mutter does modeset for DPMS on
>>>>
>>>> The monitor stays off after step 3. The argument in the comment I referenced is that mutter should repeat step 1 before step 3.
>>>
>>> That can't be it. We don't do anything if you try to disable an already  
>>> disabled output. And the analysis of the logs indicated that the disable
>>> (DPMS off) was completely missing.
>> The mutter debug log in https://gitlab.gnome.org/GNOME/mutter/-/issues/4145#note_2457199 disagrees.
> 
> I only see two modeset commits in that log. Both with CRTC 134 being
> enabled with connector 250. So far I can't find any DPMS off in there.
> Am I just blind?

It's subtle, line 12498:

[...] gnome-shell[2418]: KMS: [atomic] Committing disable-device transaction

(The issue is about the monitor not turning on after DPMS off, i.e. it does enter DPMS off in the first place :)

I do see now that the hotplug events happen only after mutter's modeset for DPMS on though (I previously mistook that for the modeset for DPMS off). The second modeset is presumably after switching to another VT and back.


In summary, the link-status property seems the best mechanism for solving this issue. I filed https://gitlab.gnome.org/GNOME/mutter/-/work_items/4760 about handling it in mutter.


-- 
Earthling Michel Dänzer       \        GNOME / Xwayland / Mesa developer
https://redhat.com             \               Libre software enthusiast

  reply	other threads:[~2026-04-21 10:13 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-15 17:59 Nicolas Frattaroli
2026-04-15 17:59 ` [PATCH RESEND v7 1/2] drm: Introduce pending_hp to drm_connector Nicolas Frattaroli
2026-04-19  0:45   ` Dmitry Baryshkov
2026-04-15 17:59 ` [PATCH RESEND v7 2/2] drm: Send per-connector hotplug events Nicolas Frattaroli
2026-04-19  1:02   ` Dmitry Baryshkov
2026-04-20 15:59     ` Nicolas Frattaroli
2026-04-15 18:57 ` [PATCH RESEND v7 0/2] Pass down hot-plug CONNECTOR ID to user-space Julian Orth
2026-04-16  7:45   ` Nicolas Frattaroli
2026-04-16 13:16     ` Julian Orth
2026-04-16 13:35       ` Marius Vlad
2026-04-16 13:55         ` Julian Orth
2026-04-16 14:21           ` Nicolas Frattaroli
2026-04-16 15:27             ` Julian Orth
2026-04-17  7:49       ` Michel Dänzer
2026-04-17 10:57         ` Ville Syrjälä
2026-04-17 12:18           ` Julian Orth
2026-04-17 12:36           ` Julian Orth
2026-04-17 14:36             ` Ville Syrjälä
2026-04-17 12:42           ` Nicolas Frattaroli
2026-04-17 14:16             ` Ville Syrjälä
2026-04-17 15:00               ` Nicolas Frattaroli
2026-04-17 15:19                 ` Ville Syrjälä
2026-04-17 14:17           ` Michel Dänzer
2026-04-17 14:55             ` Ville Syrjälä
2026-04-17 16:40               ` Michel Dänzer
2026-04-17 18:50                 ` Ville Syrjälä
2026-04-21 10:13                   ` Michel Dänzer [this message]
2026-04-20 18:13                 ` Ville Syrjälä
2026-04-17 14:25         ` Alex Deucher
2026-04-17 14:29           ` Michel Dänzer

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=bcd00cbe-ba89-4927-a295-726856ab3d9c@mailbox.org \
    --to=michel.daenzer@mailbox.org \
    --cc=airlied@gmail.com \
    --cc=daniel.stone@collabora.com \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hamohammed.sa@gmail.com \
    --cc=ian.forbes@broadcom.com \
    --cc=imre.deak@intel.com \
    --cc=ju.orth@gmail.com \
    --cc=kernel@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=louis.chauvet@bootlin.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=marius.vlad@collabora.com \
    --cc=melissa.srw@gmail.com \
    --cc=mripard@kernel.org \
    --cc=nicolas.frattaroli@collabora.com \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    --cc=ville.syrjala@linux.intel.com \
    --cc=wayland-devel@lists.freedesktop.org \
    /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

all inboxes | Powered by JetHome®