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 B22D7606A32D for ; Fri, 4 Dec 2026 09:58:21 +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=JDAN4DaY Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BCF2110E689; Fri, 4 Dec 2026 09:58:15 +0000 (UTC) Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0461F10E68E; Fri, 4 Dec 2026 09:58:09 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 3731661135; Fri, 4 Dec 2026 09:58:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C4C321F000C2; Fri, 4 Dec 2026 09:58:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796378287; bh=9MhvlU6I68xRf0Rry/kKWWtCOu3ytvz11hdNu/fB5sE=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=JDAN4DaYfpthIlRvL6H+CfdL1/WQVkwU/Ze6vxvMhEK4CZU6Fzgn/V9KZhlEo/IDT hp1QU+PIa/ogcQ3U7GXg12zmKv4X2bjJwx2g4rtDwmdDdIQ1CMjx254qHVDBS6O/TU 8zB4EsKXPJhX0u60PCyINQjpd+xvTyd2nSup5u2cMJGLSNNOPWQHK8zF4k3DfvdLMG IBbU22dr1zFfdsFlbAolunFz6TITRVNXl/DitSaslC3aSZKIVNhQFLgGZtsT1yLUuu u5b4nmhTPb50AkZDg4/EePi0ehY4DznExouXwiZSLqMXZGhbHz+Umu6tf3y7cS9C3r tpzM6EJ40r3hQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v5 14/15] drm/i915/dp: Pick the bpc for a PCON DSC stream To: "Ankit Nautiyal" , intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org In-Reply-To: <20261204085746.391918-15-ankit.k.nautiyal@intel.com> References: <20261204085746.391918-1-ankit.k.nautiyal@intel.com> <20261204085746.391918-15-ankit.k.nautiyal@intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 09:58:07 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev Sender: "Intel-gfx" 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=unavailable 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 4 potential issues to consider: - [High] drm/i915/dp: intel_dp_hdmi_compute_bpc() ignores sink and PCON DSC bpc caps - [Medium] drm/i915/dp: PCON DSC ignores sink native_420 and PCON color format caps - [Medium] drm/i915/dp: intel_dp_check_frl_training() skips lower DSC FRL retraining - [Low] drm/i915/dp: intel_dp_hdmi_sink_max_frl() ignores zero DSC FRL rate -- commit 1707d6510af7a4b652b9374bcbb1a3e1c3e1df5a Author: Ankit Nautiyal drm/i915/dp: Pick the bpc for a PCON DSC stream This commit adds a fallback in intel_dp_hdmi_compute_bpc() to pick the highest bpc that an HDMI 2.1 PCON can DSC-encode when no bpc fits the HDMI FRL link uncompressed and the DP stream is compressed. > diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i9= 15/display/intel_dp.c > index f2505b707cad5..94744ead1a6e9 100644 > --- a/drivers/gpu/drm/i915/display/intel_dp.c > +++ b/drivers/gpu/drm/i915/display/intel_dp.c > @@ -1302,6 +1302,20 @@ intel_dp_pcon_dsc_enc_compute(struct intel_dp *int= el_dp, > return true; > } > =20 > +/* > + * Whether the PCON can compress a stream that doesn't fit the HDMI FRL = link > + * uncompressed. The DP stream has to be compressed for that as well. > + */ > +static bool > +intel_dp_hdmi_dsc_possible(struct intel_dp *intel_dp, > + const struct drm_display_mode *mode, int pixel_clock, > + int bpc, enum intel_output_format sink_format) > +{ > + return intel_dp_pcon_sink_support_frl(intel_dp) && > + intel_dp_pcon_dsc_enc_compute(intel_dp, mode, pixel_clock, bpc, > + sink_format, NULL); > +} [Severity: Medium] Can intel_dp_hdmi_dsc_possible() accept a sink_format that the HDMI sink or PCON DSC encoder cannot compress? intel_dp_pcon_dsc_enc_compute() only checks v_1p2 and PCON DSC 1.2 support via intel_dp_pcon_can_encode_dsc(). It never checks info->hdmi.dsc_cap.native_420 for INTEL_OUTPUT_FORMAT_YCBCR420 or DP_PCON_DSC_ENC_COLOR_FMT_CAP in intel_dp->pcon_dsc_dpcd. On an HDMI 2.1 sink that supports DSC 1.2 for RGB without native 4:2:0 DSC decoding, driving a 4:2:0 mode that requires FRL DSC will configure PCON DSC encoding in an unsupported format and produce blank or corrupted output. [Severity: Low] What happens here if the HDMI sink advertises DSC 1.2 support but reports a DSC_Max_FRL_Rate of 0 (or an unrecognized rate code that drm_get_max_frl_rate() maps to 0)? intel_dp_pcon_dsc_enc_compute() calls intel_dp_hdmi_frl_payload_bw(intel_dp, true), which reaches intel_dp_hdmi_sink_max_frl(): drivers/gpu/drm/i915/display/intel_dp.c:intel_dp_hdmi_sink_max_frl() { ... if (dsc && dsc_max_frl_rate) return min(max_frl_rate, dsc_max_frl_rate); return max_frl_rate; } When dsc is true and dsc_max_frl_rate is 0, this falls through and returns the uncompressed max_frl_rate instead of 0. PCON DSC is then enabled on a sink that does not advertise compressed FRL transport, causing link failure. Checking if (dsc) without && dsc_max_frl_rate would return 0 and let intel_dp_pcon_dsc_enc_compute() reject the mode cleanly. [ ... ] > @@ -1862,12 +1880,27 @@ static int intel_dp_hdmi_compute_bpc(struct intel= _dp *intel_dp, > return bpc; > } > =20 > + /* > + * No bpc fits the HDMI link uncompressed. If the DP stream is compress= ed > + * the PCON may be able to compress the stream for the HDMI link as wel= l. > + */ > + if (!dsc || !respect_downstream_limits) > + return -EINVAL; > + > + for (bpc =3D max_bpc; bpc >=3D 8; bpc -=3D 2) { > + if (intel_hdmi_bpc_possible(crtc_state, bpc, > + intel_dp_has_hdmi_sink(intel_dp)) && > + intel_dp_hdmi_dsc_possible(intel_dp, &crtc_state->hw.adjusted_mode, > + clock, bpc, crtc_state->sink_format)) > + return bpc; > + } > + > return -EINVAL; > } [Severity: High] Should this loop validate bpc against the sink and PCON DSC color depth capabilities rather than only uncompressed HDMI deep-color limits? intel_hdmi_bpc_possible() only checks uncompressed EDID deep-color flags, and neither intel_dp_hdmi_dsc_possible() nor intel_dp_pcon_dsc_enc_compute() checks info->hdmi.dsc_cap.bpc_supported or DP_PCON_DSC_ENC_COLOR_DEPTH_CAP in intel_dp->pcon_dsc_dpcd. On an HDMI 2.1 sink that advertises 12 bpc uncompressed deep color but only 8 or 10 bpc in its HF-VSDB DSC capabilities, this picks 12 bpc and configures an unsupported compressed color depth, resulting in a blank or corrupted screen. [Severity: Medium] Now that this loop allows switching to a PCON DSC stream, does intel_dp_check_frl_training() fail to retrain the FRL link down when the sink's DSC_Max_FRL_Rate is lower than its uncompressed Max_FRL_Rate? After an uncompressed modeset trains the FRL link at a higher rate (for example 48 Gbps), intel_dp->frl.is_trained stays true across modesets. A later PCON DSC modeset sets crtc_state->pcon_config.frl_rate_gbps to the lower compressed rate (for example 24 Gbps), but this returns early: drivers/gpu/drm/i915/display/intel_dp.c:intel_dp_check_frl_training() { ... if (intel_dp->frl.is_trained && intel_dp->frl.trained_rate_gbps >=3D crtc_state->pcon_config.frl_rate_= gbps) return; ... } intel_dp_pcon_is_frl_trained() has the same *frl_trained_mask >=3D max_frl_bw_mask check. The PCON then transmits compressed video above the sink's DSC_Max_FRL_Rate, breaking display output on the mode switch. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204085746.3919= 18-1-ankit.k.nautiyal@intel.com?part=3D14