From: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
To: Chaoyi Chen <chaoyi.chen@rock-chips.com>
Cc: Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>, Vinod Koul <vkoul@kernel.org>,
Kishon Vijay Abraham I <kishon@kernel.org>,
Heiko Stuebner <heiko@sntech.de>,
Sandy Huang <hjc@rock-chips.com>,
Andy Yan <andy.yan@rock-chips.com>,
Yubing Zhang <yubing.zhang@rock-chips.com>,
Frank Wang <frank.wang@rock-chips.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>,
Amit Sunil Dhamne <amitsd@google.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Dragan Simic <dsimic@manjaro.org>,
Johan Jonker <jbx6244@gmail.com>,
Diederik de Haas <didi.debian@cknow.org>,
Peter Robinson <pbrobinson@gmail.com>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-phy@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org,
dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v3 0/5] Add Type-C DP support for RK3399 EVB IND board
Date: Tue, 5 Aug 2025 09:56:57 +0530 [thread overview]
Message-ID: <3e880194-5ac8-4056-929c-ac103bedc737@oss.qualcomm.com> (raw)
In-Reply-To: <0207826d-a987-4464-b306-29bdbfac45bc@rock-chips.com>
On 05/08/2025 09:13, Chaoyi Chen wrote:
> Hi Dmitry,
>
> On 8/2/2025 5:55 PM, Dmitry Baryshkov wrote:
>
> [...]
>
>
>>> Currently, the software simply selects the first available port. So
>>> if user
>>> plugs in DP dongles in both USB-C ports, the DP driver will select
>>> the first
>>> port. This process is implemented in cdn_dp_connected_port() .
>>>
>> I think Stephen Boyd has been looking on similar issues for Chromebooks,
>> which were sharing DP controller between several USB-C ports. I don't
>> remember what was his last status. I think there it was easier since the
>> bifurcation point was the EC.
>
> I think the latest progress should be here: [0]. It seems that it hasn't
> been updated for a while.
Might be :-(
>
> [0]: https://lore.kernel.org/all/20240901040658.157425-1-
> swboyd@chromium.org/
>
>
>>
>> I think, CDN-DP needs to register up to two encoders and up to two
>> connectors, having a separate drm_bridge chain for each of the DP
>> signals paths (in the end, you can not guarantee that both branches will
>> have the same simple CDN-DP -> PHY -> USB-C configuration: there can be
>> different retimers, etc).
>>
>> Both encoders should list the same CRTC in possible_crtcs, etc. Of
>> course, it should not be possible to enable both of them.
>>
>> This way if the user plugs in two DP dongles, it would be possible to
>> select, which output actually gets a signal.
>
> That makes sense, but this might make the DP driver quite complex. I
> will see if I can make it happen.
I think it's trading one burden for another, because CDN-DP currently
has a complication of calling cdn_dp_get_port_lanes() /
cdn_dp_enable_phy() in a loop rather than just enabling one instance.
>
>
>>
>>>
>>>>> BTW, one of the important things to do is to implement extcon-like
>>>>> notifications. I found include/drm/bridge/aux-bridge.h , but if the
>>>>> aux-bridge is used, the bridge chain would look like this:
>>>>>
>>>>> PHY0 aux-bridge ---+
>>>>> | ----> CDN-DP bridge
>>>>> PHY1 aux-bridge ---+
>>>>>
>>>>> Oh, CDN-DP bridge has two previous aux-bridge!
>>>>>
>>>>> Now, I try to use drm_connector_oob_hotplug_event() to notify HPD
>>>>> state between PHY and CDN-DP controller.
>>>> Does it actually work? The OOB HPD event will be repoted for the usb-c
>>>> connector's fwnode, but the DP controller isn't connected to that node
>>>> anyhow. If I'm not mistaken, the HPD signal will not reach DP driver in
>>>> this case.
>>> Yes. What you mentioned is the case in
>>> drivers/usb/typec/altmodes/displayport.c . I have also added a new
>>> OOB event
>>> notify in the PHY driver in Patch 3, where the expected fwnode is
>>> used in
>>> the PHY. So now we have two OOB HPD events, one from altmodes/
>>> displayport.c
>>> and the other from PHY. Only the HPD from PHY is eventually passed to
>>> the DP
>>> driver.
>> This way you will loose IRQ_HPD pulse events from the DP. They are used
>> by DPRX (aka DP Sink) to signal to DPTX (DP Source) that there was a
>> change on the DPRX side and the DPTX should reread link params and maybe
>> retrain the link.
>
> Sorry, I still don't quite understand your point. I think the entire
> notification path is as follows:
>
> Type-C mux callback -> RK3399 USBDP PHY -> PHY calls
> drm_connector_oob_hotplug_event() -> DP driver
>
> Are you concerned that the IRQ_HPD event is not being handled somewhere
> along the path? Is it that the Type-C mux callback didn't notify the
> PHY, or that after the PHY passed the event to the DP driver via the OOB
> event, the DP driver didn't handle it?
The IRQ_HPD is an event coming from DPRX, it is delivered as a part of
the attention VDM, see DP_STATUS_IRQ_HPD. It's being handled by the
altmode displayport.c driver and is then delivered as an OOB hotplug
call. However, it's not a mux event, so it is not (and it should not)
being broadcasted over the typec_mux devices.
The way we were handling that is by having a chain of drm_aux_bridges
for all interim devices, ending up with a drm_dp_hpd_bridge registered
by the TCPM. This way when the DPRX triggers the IRQ_HPD event, it is
being handled by the displayport.c and then delivered through that
bridge to the DP driver.
--
With best wishes
Dmitry
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
next prev parent reply other threads:[~2025-08-05 4:28 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-29 9:00 [PATCH v3 0/5] Add Type-C DP support for RK3399 EVB IND board Chaoyi Chen
2025-07-29 9:00 ` [PATCH v3 1/5] dt-bindings: phy: rockchip: rk3399-typec-phy: Support mode-switch Chaoyi Chen
2025-07-30 7:20 ` Krzysztof Kozlowski
2025-07-29 9:00 ` [PATCH v3 2/5] phy: rockchip: phy-rockchip-typec: Add typec_mux/typec_switch support Chaoyi Chen
2025-07-30 0:50 ` kernel test robot
2025-08-06 2:04 ` kernel test robot
2025-07-29 9:00 ` [PATCH v3 3/5] drm/rockchip: cdn-dp: Support handle lane info and HPD without extcon Chaoyi Chen
2025-07-29 9:00 ` [PATCH v3 4/5] arm64: dts: rockchip: Add missing dp_out port for RK3399 CDN-DP Chaoyi Chen
2025-07-29 19:59 ` Diederik de Haas
2025-07-30 1:26 ` Chaoyi Chen
2025-07-29 9:00 ` [PATCH v3 5/5] arm64: dts: rockchip: rk3399-evb-ind: Add support for DisplayPort Chaoyi Chen
2025-07-30 19:13 ` [PATCH v3 0/5] Add Type-C DP support for RK3399 EVB IND board Dmitry Baryshkov
2025-07-31 2:19 ` Chaoyi Chen
2025-08-02 9:55 ` Dmitry Baryshkov
2025-08-05 3:43 ` Chaoyi Chen
2025-08-05 4:26 ` Dmitry Baryshkov [this message]
2025-08-05 6:32 ` Chaoyi Chen
2025-08-05 10:44 ` Dmitry Baryshkov
2025-08-05 11:07 ` Chaoyi Chen
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=3e880194-5ac8-4056-929c-ac103bedc737@oss.qualcomm.com \
--to=dmitry.baryshkov@oss.qualcomm.com \
--cc=airlied@gmail.com \
--cc=amitsd@google.com \
--cc=andy.yan@rock-chips.com \
--cc=chaoyi.chen@rock-chips.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=didi.debian@cknow.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=dsimic@manjaro.org \
--cc=frank.wang@rock-chips.com \
--cc=gregkh@linuxfoundation.org \
--cc=heiko@sntech.de \
--cc=hjc@rock-chips.com \
--cc=jbx6244@gmail.com \
--cc=kishon@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=pbrobinson@gmail.com \
--cc=robh@kernel.org \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
--cc=vkoul@kernel.org \
--cc=yubing.zhang@rock-chips.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