Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Luo Liu" <Luo.Liu@cixtech.com>
Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
	robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v11 2/5] drm/bridge: trilinear: add the DPTX hardware layer
Date: Fri, 04 Dec 2026 13:48:05 +0000	[thread overview]
Message-ID: <sashiko-outbox-249896@kernel.org> (raw)
In-Reply-To: <20261204131053.351956-3-Luo.Liu@cixtech.com>

Thank you for your contribution! Sashiko AI review found 3 potential
issues to consider:
- [High] drm/bridge: trilinear: dptx_hw_link_clock_recovery() skips max
  vswing
- [Low] drm/bridge: trilinear: unnecessary single-implementation
  dptx_hw_ops vtable
- [Low] drm/bridge: trilinear: dptx_hw_stream_misc() omits BT.709 bit in
  MISC0
--

commit 3a1226e38ee04edc4132811d9716694adb22dd13
Author: Luo Liu <Luo.Liu@cixtech.com>

drm/bridge: trilinear: add the DPTX hardware layer

This commit adds the register and PHY programming layer for the Trilinear
DisplayPort transmitter, including AUX transfers, DPCD capability parsing,
link training, and per-stream video and VSC SDP setup.

> diff --git a/drivers/gpu/drm/bridge/trilinear/dptx_hw.c b/drivers/gpu/drm/bridge/trilinear/dptx_hw.c
> new file mode 100644
> index 0000000000000..d16d4b68a6cdd
> --- /dev/null
> +++ b/drivers/gpu/drm/bridge/trilinear/dptx_hw.c

[ ... ]

> +	for (i = 0; i < max_tries; i++) {
> +		ret = dptx_hw_link_vs_emph(hw, phy, lane_cnt);
> +		if (ret)
> +			return ret;
> +
> +		drm_dp_link_train_clock_recovery_delay(&hw->aux, hw->dpcd);
> +		ret = drm_dp_dpcd_read_link_status(&hw->aux, link_status);
> +		if (ret < 0)
> +			return ret;
> +
> +		train_done = drm_dp_clock_recovery_ok(link_status, lane_cnt);
> +		if (train_done)
> +			break;
> +
> +		memcpy(prev, hw->train_setting, lane_cnt);
> +		dptx_hw_link_adjust_train(hw, lane_cnt, link_status);
> +
> +		if (dptx_hw_link_max_vswing_reached(hw->train_setting, lane_cnt))
> +			break;

[Severity: High]
Does dptx_hw_link_clock_recovery() abort before voltage swing level 3 is
ever applied?

When the sink requests level 3 on all active lanes,
dptx_hw_link_adjust_train() sets DP_TRAIN_MAX_SWING_REACHED in
hw->train_setting and the check breaks out before the next iteration's
dptx_hw_link_vs_emph() programs it to the PHY and DPCD.

Any link needing maximum voltage swing will therefore fail clock recovery
with -EIO and either fail training or downshift unnecessarily.  Checking
prev (or checking hw->train_setting before dptx_hw_link_adjust_train())
would test level 3 before stopping.

[ ... ]

> +static void dptx_hw_stream_misc(struct dp_hw *hw, unsigned int stream_id,
> +				enum dp_pixelformat format, u8 bpc,
> +				bool vsc)
> +{
> +	u8 override_bpc;
> +	u8 override = 0;
> +	u8 misc1 = 0;
> +	u8 misc0;
> +
> +	switch (format) {
> +	case DP_PIXELFORMAT_YUV444:
> +		misc0 = DPTX_STREAM_MISC0_COMP_FORMAT_YCRCB_444;
> +		break;
> +	case DP_PIXELFORMAT_YUV422:
> +		misc0 = DPTX_STREAM_MISC0_COMP_FORMAT_YCRCB_422;
> +		break;

[Severity: Low]
Should dptx_hw_stream_misc() set MISC0 bit 4 (BT.709) for YCbCr formats
when VSC SDP is not used?

DPTX_STREAM_MISC0_COMP_FORMAT_YCRCB_422 (5 << 1) leaves bit 4 cleared, so
YCbCr 4:2:2 with DRM_MODE_COLORIMETRY_DEFAULT signals BT.601 in MSA MISC0.
That contradicts dptx_hw_vsc_colorimetry(), which treats unspecified YCbCr
as BT.709 for VSC SDP, causing a colorimetry mismatch on YCbCr 4:2:2 modes.

Passing colorspace into dptx_hw_stream_misc() and setting BIT(4) for BT.709
would keep MISC0 consistent with the VSC SDP path.

[ ... ]

> diff --git a/drivers/gpu/drm/bridge/trilinear/dptx_hw.h b/drivers/gpu/drm/bridge/trilinear/dptx_hw.h
> new file mode 100644
> index 0000000000000..420ef242a4f61
> --- /dev/null
> +++ b/drivers/gpu/drm/bridge/trilinear/dptx_hw.h

[ ... ]

> +struct dptx_hw_ops {
> +	bool (*hpd_state)(struct dp_hw *hw);
> +	bool (*sink_present)(struct dp_hw *hw);

[Severity: Low]
This isn't a bug, but is the 20-callback struct dptx_hw_ops indirection
needed?

There is only a single implementation (dptx_hw_ops in dptx_hw.c,
unconditionally assigned in dptx_hw_init()) and struct dp_hw is already
exposed in dptx_hw.h.  Declaring direct dptx_hw_*() functions in dptx_hw.h
would avoid the boilerplate and indirect-call overhead.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261204131053.351956-1-Luo.Liu@cixtech.com?part=2

  reply	other threads:[~2026-12-04 13:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04 13:10 [PATCH v11 0/5] drm/bridge: trilinear: add the Sky1 DisplayPort transmitter Luo Liu
2026-12-04 13:10 ` [PATCH v11 1/5] dt-bindings: display: add CIX " Luo Liu
2026-12-04 13:10 ` [PATCH v11 2/5] drm/bridge: trilinear: add the DPTX hardware layer Luo Liu
2026-12-04 13:48   ` sashiko-bot [this message]
2026-12-04 13:10 ` [PATCH v11 3/5] drm/bridge: trilinear: add the DPTX DRM bridge Luo Liu
2026-12-04 14:19   ` sashiko-bot
2026-12-04 13:10 ` [PATCH v11 4/5] drm/bridge: trilinear: add the DPTX core and build glue Luo Liu
2026-12-04 14:53   ` sashiko-bot
2026-12-04 13:10 ` [PATCH v11 5/5] drm/cix: add the Sky1 DisplayPort platform glue Luo Liu
2026-12-04 15:06   ` sashiko-bot

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-249896@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Luo.Liu@cixtech.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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