All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Jani Nikula <jani.nikula@linux.intel.com>,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>
Cc: linux-usb@vger.kernel.org,
	Maxime Ripard <maxime.ripard@bootlin.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	intel-gfx <intel-gfx@lists.freedesktop.org>,
	dri-devel@lists.freedesktop.org, David Airlie <airlied@linux.ie>,
	Sean Paul <seanpaul@chromium.org>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Daniel Vetter <daniel.vetter@intel.com>
Subject: Re: [PATCH 0/3] Propagate DP-over-Type-C hotplug events from Type-C subsys to drm-drivers
Date: Wed, 27 Feb 2019 16:45:32 +0100	[thread overview]
Message-ID: <14e6877b-eb78-f331-6e54-572f7d8e8535@redhat.com> (raw)
In-Reply-To: <87o96xo510.fsf@intel.com>

Hi,

On 27-02-19 12:16, Jani Nikula wrote:
> On Wed, 27 Feb 2019, Heikki Krogerus <heikki.krogerus@linux.intel.com> wrote:
>> One thing that this series does not consider is the DP lane count
>> problem. The GPU drivers (i915 in this case) does not know is four,
>> two or one DP lanes in use.
> 
> Also, orientation.

The orientation should simply be correct with Type-C over DP. The mux /
orientation-switch used will take care of (physically) swapping the
lanes if the connector is inserted upside-down.

>> I guess that is not a critical issue since there is a workaround (I
>> think) where the driver basically does trial and error, but ideally we
>> should be able to tell i915 also the pin assignment that was
>> negotiated with the partner device so it knows the DP lane count.
> 
> Yeah, if the information is there, we'd like to know.

So far machines actually using a setup where the kernel does the
USB-PD / Type-C negotiation rather then this being handled in firmware
in say the Alpine Ridge controller, are very rare.

AFAIK in the Alpine Ridge controller case, there is no communication
with the i915 driver, the only thing the Alpine Ridge controller does
which the everything done in the kernel approach does not, is that
it actually has a pin connected to the HDP pin of the displayport in
question.  But that just lets the i915 driver know about hotplug-events,
not how many lanes are used.

Currently I'm aware of only 2 x86 models which actually need the
hotplug event propagation from the Type-C subsystem to the i915 driver.
Do we really want to come up with a much more complex solution to
optimize for this corner case, while the much more common case
(Alpine Ridge controller) does not provide this info to the i915 driver?

To give some idea of the complexity, first of all we need some
mechanism to let the kernel know which drm_connector is connected
to which Type-C port. For the 2 models I know if which need this, this
info is not available and we would need to hardcode it in the kernel
based on e.g. DMI matching.

Then once we have this link, we need to start thinking about probe
ordering. Likely we need the typec framework to find the drm_connector,
since the typec-partner device is only created when there actually is
a DP capable "dongle" connected, making doing it the other way around
tricky. Then the typec-partner device needs to get a reference or some
such to make sure the drm_connector does not fgo away during the lifetime
of the typec-partner device.

I would really like to avoid this, so if we want to send more info to
the i915 driver, I suggest we create some event struct for this which
gets passed to the notifier, this could include a string to
describe the DP connector which the Type-C connector is connected to
when the mux is set to DP mode, e.g. "i915/DP-1" should be unique
or probably better, use the PCI device name, so: "0000:00:02.0/DP-1"

Then we still have a loose coupling avoiding lifetime issues, while
the receiving drm driver can check which connector the event is for
and we can then also include other info such as lane-count and orientation
in the event struct.

> With the orientation

As said, the orientation *should* be corrected by the mux switch,
it is corrected by the mux switch on the hardware I know about and
actually getting it wrong breaks the display output (we had a bug there),
so I guess that getting it wrong leads to the lines being swizzled in a way
which the i915 driver does not check for ...

Regards,

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

  parent reply	other threads:[~2019-02-27 15:45 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-25 13:20 [PATCH 0/3] Propagate DP-over-Type-C hotplug events from Type-C subsys to drm-drivers Hans de Goede
2019-02-25 14:41 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2019-02-25 14:43 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-02-25 15:02 ` ✓ Fi.CI.BAT: success " Patchwork
2019-02-25 19:55 ` ✓ Fi.CI.IGT: " Patchwork
2019-02-27 10:55 ` [PATCH 0/3] " Heikki Krogerus
2019-02-27 11:16   ` Jani Nikula
2019-02-27 11:49     ` Heikki Krogerus
2019-02-27 15:45     ` Hans de Goede [this message]
2019-02-28  9:15       ` Heikki Krogerus
2019-02-28 11:24         ` Hans de Goede
2019-02-28 14:47           ` Heikki Krogerus
2019-02-28 16:54             ` Hans de Goede
2019-03-04 15:17               ` Heikki Krogerus
2019-03-05  7:45                 ` Hans de Goede
2019-02-25 13:20 [1/3] drm: Add support for out-of-band hotplug notification Hans de Goede
2019-02-25 13:20 ` [PATCH 1/3] " Hans de Goede
2019-02-25 13:20 [2/3] i915: Add support for out-of-bound hotplug events Hans de Goede
2019-02-25 13:20 ` [PATCH 2/3] " Hans de Goede
2019-02-25 13:20 [3/3] usb: typec: altmodes/displayport: Notify drm subsys of " Hans de Goede
2019-02-25 13:20 ` [PATCH 3/3] " Hans de Goede
2019-02-25 14:06 [3/3] " Greg Kroah-Hartman
2019-02-25 14:06 ` [PATCH 3/3] " Greg Kroah-Hartman
2019-02-25 16:19 [3/3] " Hans de Goede
2019-02-25 16:19 ` [PATCH 3/3] " Hans de Goede
2019-02-26  7:40 [3/3] " kbuild test robot
2019-02-26  7:40 ` [PATCH 3/3] " kbuild test robot
2019-02-26 16:04 [3/3] " kbuild test robot
2019-02-26 16:04 ` [PATCH 3/3] " kbuild test robot
2019-02-27  9:44 [3/3] " Heikki Krogerus
2019-02-27  9:44 ` [PATCH 3/3] " Heikki Krogerus
2019-02-27 15:51 [3/3] " Hans de Goede
2019-02-27 15:51 ` [PATCH 3/3] " Hans de Goede

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=14e6877b-eb78-f331-6e54-572f7d8e8535@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=airlied@linux.ie \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=maxime.ripard@bootlin.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=seanpaul@chromium.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.