dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Mario Limonciello" <superm1@kernel.org>
Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v4] drm/amd/display: Route connector DDC over AUX for native DP sinks
Date: Thu, 19 Nov 2026 05:35:50 +0000	[thread overview]
Message-ID: <sashiko-outbox-222493@kernel.org> (raw)
In-Reply-To: <20261118-superm1-amdgpu-ddc-v4-1-539eaeb4edd7@kernel.org>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] drm/amd/display: stale link->aux_mode in amdgpu_dm_i2c_xfer()
  breaks DP++
--

commit bd7217b6334d8e26e4a44e7561c8afe2462a790d
Author: Mario Limonciello <superm1@kernel.org>

drm/amd/display: Route connector DDC over AUX for native DP sinks

This commit routes transfers on a connector's DDC i2c adapter through the
AUX DDC adapter when link->aux_mode is set so that native DisplayPort, eDP,
and MST sinks can be reached via the connector's ddc bus.

> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c
> index b498fc5fbb140..f80de9e7f850c 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c
> @@ -3373,6 +3373,22 @@ STATIC_IFN_KUNIT int amdgpu_dm_i2c_xfer(struct i2c_adapter *i2c_adap,
>  	int i;
>  	int result = -EIO;
>  
> +	if (!i2c->oem && ddc_service->link) {
> +		struct dc_link *link = ddc_service->link;
> +		struct amdgpu_dm_connector *aconnector = link->priv;
> +
> +		/*
> +		 * DDC to a native DisplayPort sink (SST, MST or eDP) is
> +		 * tunneled over the AUX channel; the physical i2c pins only
> +		 * reach DVI/HDMI sinks (e.g. DP++ with a passive adapter).
> +		 * Use the same aux_mode selection as the EDID read helpers so
> +		 * the connector's single "ddc" bus works for either sink.
> +		 */
> +		if (aconnector && link->aux_mode &&
> +		    aconnector->dm_dp_aux.aux.ddc.algo)
> +			return i2c_transfer(&aconnector->dm_dp_aux.aux.ddc, msgs, num);
> +	}

[Severity: High]
As reported by Eren Özen on v2 [1], can a stale link->aux_mode misroute the
passive DP++ dongle identification read over AUX when a native DisplayPort
sink is unplugged and replaced with a passive DP-to-HDMI adapter on the
same port?

link->aux_mode is not cleared on disconnect, and
detect_link_and_local_sink() only updates it after detect_dp() returns:

drivers/gpu/drm/amd/display/dc/link/link_detection.c:detect_link_and_local_sink() {
	...
			if (!detect_dp(link, &sink_caps, reason)) {
	...
		set_ddc_transaction_type(link->ddc,
						     sink_caps.transaction_type);

		link->aux_mode =
			link_is_in_aux_transaction_mode(link->ddc);
	...
}

During detect_dp(), dp_passive_dongle_detection() ->
query_dp_dual_mode_adaptor() reads DP_HDMI_DONGLE_ADDRESS (0x40) via
i2c_read() -> dm_helpers_submit_i2c() -> i2c_transfer(&aconnector->i2c->base)
-> amdgpu_dm_i2c_xfer() while link->aux_mode is still true from the
previous native DP sink.  Forwarding that read to I2C-over-AUX fails on a
passive DP++ adapter, causing query_dp_dual_mode_adaptor() to fall back to
DISPLAY_DONGLE_DP_DVI_DONGLE (SIGNAL_TYPE_DVI_SINGLE_LINK), which caps the
pixel clock to 165 MHz and disables HDMI audio and infoframes.

[1] https://lore.kernel.org/r/QU464501lRPW3X8es-jXBFOvvwqS3eKR3HRS33U6x6o5eYC6h5AKV7f3ZXRCaU7-sEcupJMHereqyDUsUSG_fsOMNwvGO_CcZRKsz1AgObk=@protonmail.com

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261118-superm1-amdgpu-ddc-v4-1-539eaeb4edd7@kernel.org?part=1

  reply	other threads:[~2026-11-19  5:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19  5:17 [PATCH v4] drm/amd/display: Route connector DDC over AUX for native DP sinks Mario Limonciello
2026-11-19  5:35 ` sashiko-bot [this message]
2026-11-19  8:36 ` Eren Özen
2026-11-19 11:23   ` Mario Limonciello

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=sashiko-outbox-222493@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=superm1@kernel.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