Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Pekka Paalanen <ppaalanen@gmail.com>
To: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: "paul.kocialkowski@bootlin.com" <paul.kocialkowski@bootlin.com>,
	"maxime.ripard@bootlin.com" <maxime.ripard@bootlin.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"Mun, Gwan-gyeong" <gwan-gyeong.mun@intel.com>,
	"Ser, Simon" <simon.ser@intel.com>,
	"airlied@linux.ie" <airlied@linux.ie>,
	"thomas.petazzoni@bootlin.com" <thomas.petazzoni@bootlin.com>,
	"Vetter, Daniel" <daniel.vetter@intel.com>,
	"sean@poorly.run" <sean@poorly.run>
Subject: Re: [PATCH v7 09/11] drm: uevent for connector status change
Date: Tue, 14 May 2019 16:36:02 +0300	[thread overview]
Message-ID: <20190514163602.7d252b12@eldfell.localdomain> (raw)
In-Reply-To: <CAKMK7uHJPugRWJx32oWVF94jBf28P0nBirZNbSBRMS1SbUaS9A@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 7309 bytes --]

On Tue, 14 May 2019 13:02:09 +0200
Daniel Vetter <daniel.vetter@ffwll.ch> wrote:

> On Tue, May 14, 2019 at 10:18 AM Ser, Simon <simon.ser@intel.com> wrote:
> >
> > On Tue, 2019-05-14 at 11:02 +0300, Pekka Paalanen wrote:  
> > > On Mon, 13 May 2019 11:34:58 +0200
> > > Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> > >  
> > > > On Mon, May 13, 2019 at 11:02 AM Paul Kocialkowski
> > > > <paul.kocialkowski@bootlin.com> wrote:  
> > > > > Hi,
> > > > >
> > > > > On Fri, 2019-05-10 at 16:54 +0200, Daniel Vetter wrote:  
> > > > > > On Fri, May 10, 2019 at 2:12 PM Paul Kocialkowski
> > > > > > <paul.kocialkowski@bootlin.com> wrote:  
> > > > > > > Hi,
> > > > > > >
> > > > > > > On Tue, 2019-05-07 at 21:57 +0530, Ramalingam C wrote:  
> > > > > > > > DRM API for generating uevent for a status changes of connector's
> > > > > > > > property.
> > > > > > > >
> > > > > > > > This uevent will have following details related to the status change:
> > > > > > > >
> > > > > > > >   HOTPLUG=1, CONNECTOR=<connector_id> and PROPERTY=<property_id>
> > > > > > > >
> > > > > > > > Need ACK from this uevent from userspace consumer.  
> > > > > > >
> > > > > > > So we just had some discussions over on IRC and at about the hotplug
> > > > > > > issue and came up with similar ideas:
> > > > > > > https://lists.freedesktop.org/archives/dri-devel/2019-May/217408.html
> > > > > > >
> > > > > > > The conclusions of these discussions so far would be to have a more or
> > > > > > > less fine grain of uevent reporting depending on what happened. The
> > > > > > > point is that we need to cover different cases:
> > > > > > > - one or more properties changed;
> > > > > > > - the connector status changed;
> > > > > > > - something else about the connector changed (e.g. EDID/modes)
> > > > > > >
> > > > > > > For the first case, we can send out:
> > > > > > > HOTPLUG=1
> > > > > > > CONNECTOR=<id>
> > > > > > > PROPERTY=<id>
> > > > > > >
> > > > > > > and no reprobe is required.
> > > > > > >
> > > > > > > For the second one, something like:
> > > > > > > HOTPLUG=1
> > > > > > > CONNECTOR=<id>
> > > > > > > STATUS=Connected/Disconnected
> > > > > > >
> > > > > > > and a connector probe is needed for connected, but not for
> > > > > > > disconnected;
> > > > > > >
> > > > > > > For the third one, we can only indicate the connector:
> > > > > > > HOTPLUG=1
> > > > > > > CONNECTOR=<id>
> > > > > > >
> > > > > > > and a reprobe of the connector is always needed  
> > > > > >
> > > > > > There's no material difference between this one and the previous one.
> > > > > > Plus there's no beenfit in supplying the actual value of the property,
> > > > > > i.e. we can reuse the same PROPERTY=<id-of-status-property> trick.  
> > > > >
> > > > > That's the idea, but we need to handle status changes differently than
> > > > > properties, since as far as I know, connected/unconnected status is not
> > > > > exposed as a prop for the connector.  
> > > >
> > > > Oops, totally missed that. "Everything is a property" is kinda
> > > > new-ish, at least compared to kms. Kinda tempted to just make status
> > > > into a property. Or another excuse why we should expose the epoch
> > > > property :-)  
> > >
> > > Hi Daniel,
> > >
> > > just to clarify the first case, specific to one very particular
> > > property:
> > >
> > > With HDCP, there is a property that may change dynamically at runtime
> > > (the undesired/desired/enabled tristate). Userspace must be notified
> > > when it changes, I do not want userspace have to poll that property
> > > with a timer.
> > >
> > > When that property alone changes, and userspace is prepared to handle
> > > that property changing alone, it must not trigger a reprobe of the
> > > connector. There is no reason to reprobe at that point AFAIU.
> > >
> > > How do you ensure that userspace can avoid triggering a reprobe with the
> > > epoch approach or with any alternate uevent design?
> > >
> > > We need an event to userspace that indicates that re-reading the
> > > properties is enough and reprobe of the connector is not necessary.
> > > This is complementary to indicating to userspace that only some
> > > connectors need to be reprobed instead of everything.  
> >
> > Can't you use the PROPERTY hint? If PROPERTY is the HDCP one, skip the
> > reprobing. Would that work?  

Hi,

yes, that would work, if it was acceptable to DRM upstream. The replies
to Paul seemed to be going south so fast that I thought we wouldn't get
any new uevent fields in favour of "epoch counters".

> Yes that's the idea, depending upon which property you get you know
> it's a sink change (needs full reprobe) or something else like hdcp
> state machinery update.

Right.

> Wrt avoiding the full reprobe for sink changes: I think we should
> indeed decouple that from the per-connector event for sink changes.
> That along is a good win already, since you know for which connector
> you need to call drmGetConnector (which forces the reprobe). It would
> be nice to only call drmGetConnectorCurrent (avoids the reprobe), but
> historically speaking every time we tried to rely on this we ended up
> regretting things.

What changed? This sounds very much what Paul suggested. Looking at it
from userspace side:

HOTPLUG=1 CONNECTOR=xx PROPERTY=yy

- If yy is "Content Protection", no need to drmModeGetConnector(), just
  re-get the connector properties.

- Kernel probably shouldn't bother sending this for properties where
  re-probe could be necessary, and send the below instead.

HOTPLUG=1 CONNECTOR=xx

- Needs to drmModeGetConnector() on the one connector, no need to probe
  others. Implies that one needs to re-get the connector properties as
  well.

HOTPLUG=1

- Need to do drmModeGetResouces() to discover new/disappeared
  connectors, and need to drmModeGetConnector to re-probe every
  connector. (As always.)

That should be also backwards-compatible: any userspace that doesn't
understand CONNECTOR will see HOTPLUG=1 and re-probe everything. Any
userspace that doesn't understand PROPERTY or the property it refers to
will fall back to probing either the connector or everything.

I would be happy to get that behaviour into Weston, particularly as the
HDCP feature is brewing for Weston too.

--------

When discussing this in IRC, I had the concern about how uevents are
delivered in userspace. Is there a possibility that they might be
overwritten, contain stale attributes, or get squashed together?

Particularly if a display server is current on the VT and active and
monitoring udev, but stuck doing something and cannot service uevents
very fast, and the kernel sends more than one event before the process
gets back to dispatching. The terminology in libudev API confused me as
an event is a device. Squashing together would make sense if the
uevent were just updating a device attribute list. Previously when we
had just a single kind of uevent, that would not have made a
difference, but if we gain different kinds of uevents like here, it
starts to matter.

However, Paul came to the conclusion that we will be ok as long as the
events come via netlink.


Thanks,
pq

[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2019-05-14 13:36 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-07 16:27 [PATCH v7 00/11] HDCP2.2 Phase II Ramalingam C
2019-05-07 16:27 ` [PATCH v7 01/11] drm: move content protection property to mode_config Ramalingam C
2019-05-07 16:27 ` [PATCH v7 02/11] drm/i915: debugfs: HDCP2.2 capability read Ramalingam C
2019-05-07 16:27 ` [PATCH v7 03/11] drm: generic fn converting be24 to cpu and vice versa Ramalingam C
2019-05-07 16:27 ` [PATCH v7 04/11] drm: revocation check at drm subsystem Ramalingam C
2019-07-04 10:53   ` Pekka Paalanen
2019-09-12  0:15   ` Harry Wentland
2019-09-12  1:14     ` Deucher, Alexander
2019-09-12  6:54     ` Ramalingam C
2019-09-12 15:49       ` Harry Wentland
2019-05-07 16:27 ` [PATCH v7 05/11] drm/i915: SRM revocation check for HDCP1.4 and 2.2 Ramalingam C
2019-05-07 16:27 ` [PATCH v7 06/11] drm/hdcp: gathering hdcp related code into drm_hdcp.c Ramalingam C
2019-05-07 16:27 ` [PATCH v7 07/11] drm: Add Content protection type property Ramalingam C
2019-07-04 11:11   ` Pekka Paalanen
2019-07-04 10:36     ` Ramalingam C
2019-07-05 13:00       ` Pekka Paalanen
2019-07-05  6:33         ` Ramalingam C
2019-07-05 14:12           ` Pekka Paalanen
2019-05-07 16:27 ` [PATCH v7 08/11] drm/i915: Attach content " Ramalingam C
2019-05-07 16:27 ` [PATCH v7 09/11] drm: uevent for connector status change Ramalingam C
2019-05-10 12:12   ` Paul Kocialkowski
2019-05-10 14:54     ` Daniel Vetter
2019-05-13  9:02       ` Paul Kocialkowski
2019-05-13  9:34         ` Daniel Vetter
2019-05-13 10:11           ` Ser, Simon
2019-05-13 15:04             ` Daniel Vetter
2019-05-14  6:18               ` Ser, Simon
2019-05-13 17:14           ` Paul Kocialkowski
2019-05-14 11:09             ` Daniel Vetter
2019-05-14 14:12               ` Paul Kocialkowski
2019-05-14 14:28                 ` Daniel Vetter
2019-05-15  7:43                   ` Paul Kocialkowski
2019-05-15  7:48                     ` Daniel Vetter
2019-05-14  8:02           ` Pekka Paalanen
2019-05-14  8:18             ` Ser, Simon
2019-05-14 11:02               ` Daniel Vetter
2019-05-14 13:36                 ` Pekka Paalanen [this message]
2019-05-14 13:58                   ` Paul Kocialkowski
2019-05-14 14:34                   ` Daniel Vetter
2019-05-15  7:37                     ` Pekka Paalanen
2019-05-15  7:49                       ` Paul Kocialkowski
2019-05-15  8:24                       ` Daniel Vetter
2019-05-16  8:22                         ` Pekka Paalanen
2019-05-16 12:24                           ` Daniel Vetter
2019-05-17 10:08                             ` Pekka Paalanen
2019-05-20 16:11                               ` Daniel Vetter
2019-05-20 16:24                                 ` Paul Kocialkowski
2019-05-21  6:55                                 ` Pekka Paalanen
2019-05-21  7:52                                   ` Daniel Vetter
2019-05-21  9:01                                     ` Pekka Paalanen
2019-05-21  9:42                                       ` Daniel Vetter
2019-06-03  9:50                                     ` Michel Dänzer
2019-06-03 15:08                                       ` Daniel Vetter
2019-06-03 15:19                                         ` Ser, Simon
2019-06-04  7:06                                           ` Pekka Paalanen
2019-05-13 21:20     ` Lyude Paul
2019-05-14 11:12       ` Daniel Vetter
2019-07-04 11:12   ` Pekka Paalanen
2019-07-04 10:42     ` Ramalingam C
2019-07-05 13:36       ` Pekka Paalanen
2019-05-07 16:27 ` [PATCH v7 10/11] drm/hdcp: update content protection property with uevent Ramalingam C
2019-07-04 11:14   ` Pekka Paalanen
2019-07-04 11:11     ` Ramalingam C
2019-07-05 13:59       ` Pekka Paalanen
2019-07-04 23:51     ` Ramalingam C
2019-05-07 16:27 ` [PATCH v7 11/11] drm/i915: update the hdcp state " Ramalingam C
2019-05-07 16:45 ` ✗ Fi.CI.CHECKPATCH: warning for HDCP2.2 Phase II (rev9) Patchwork
2019-05-07 16:52 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-05-07 17:37 ` ✓ Fi.CI.BAT: success " Patchwork
2019-05-08  0:41 ` ✓ Fi.CI.IGT: " Patchwork

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=20190514163602.7d252b12@eldfell.localdomain \
    --to=ppaalanen@gmail.com \
    --cc=airlied@linux.ie \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gwan-gyeong.mun@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=maxime.ripard@bootlin.com \
    --cc=paul.kocialkowski@bootlin.com \
    --cc=sean@poorly.run \
    --cc=simon.ser@intel.com \
    --cc=thomas.petazzoni@bootlin.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