From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 324B4606A322 for ; Fri, 4 Dec 2026 13:48:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=SFJGCJ6a Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A162210E6EC; Fri, 4 Dec 2026 13:48:13 +0000 (UTC) Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4D3C710E6EC for ; Fri, 4 Dec 2026 13:48:07 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 33A89622D0; Fri, 4 Dec 2026 13:48:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B4D981F000CE; Fri, 4 Dec 2026 13:48:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796392085; bh=KFiEQz4dosUixoFBu39XfJNoZmIHYLw1Ua9t5v4UJUs=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=SFJGCJ6aDwkOfJyemtXg51kZ9Y/nuzs+kaGsxSx9pXhXBGBlVW2C34Zn5aqa1zasR 12R6IikXCq9GzVbCqkr1jDHoPbADFbRuruqrBL/xFy6CunQNs85/aaQ30P5079G5xx nUnvWNU0PFArdUVhatlp2lZJu+7AJ64GlEMVBp6aIM17mS7LiC+oYXJJhu6hpzbpT3 ufskqkGW5RQM4lrQChx/9oEW5BJNsEz/uZn7j2eNEoruIWs0UyoiKUDVdqU9/5+ULa dRX90lI2nig7+rn44WgVniyNmk3GhREfnsbMd/2i1WYBleCcIcxe7wUTaseFKwxfZz TPHB98osrvpJw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v11 2/5] drm/bridge: trilinear: add the DPTX hardware layer To: "Luo Liu" Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org In-Reply-To: <20261204131053.351956-3-Luo.Liu@cixtech.com> References: <20261204131053.351956-1-Luo.Liu@cixtech.com> <20261204131053.351956-3-Luo.Liu@cixtech.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 13:48:05 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev Sender: "dri-devel" X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 X-Archived-By: 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 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 =3D 0; i < max_tries; i++) { > + ret =3D 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 =3D drm_dp_dpcd_read_link_status(&hw->aux, link_status); > + if (ret < 0) > + return ret; > + > + train_done =3D 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 =3D 0; > + u8 misc1 =3D 0; > + u8 misc0; > + > + switch (format) { > + case DP_PIXELFORMAT_YUV444: > + misc0 =3D DPTX_STREAM_MISC0_COMP_FORMAT_YCRCB_444; > + break; > + case DP_PIXELFORMAT_YUV422: > + misc0 =3D 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. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204131053.3519= 56-1-Luo.Liu@cixtech.com?part=3D2