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 23A93606A684 for ; Fri, 4 Dec 2026 09:53:09 +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=TXvB+tBG Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DD663112E24; Fri, 4 Dec 2026 09:53:03 +0000 (UTC) Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 78576112E24; Fri, 4 Dec 2026 09:52:57 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 60AC141316; Fri, 4 Dec 2026 09:52:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 25EBB1F00931; Fri, 4 Dec 2026 09:52:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796377977; bh=1whJdWu6puk25b4/pPyiGBJ2+2vmE0fXVl1YXT6jAag=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=TXvB+tBGzP/sJJUNE3o48R5dNNsMt8RY1LiBDpNDIO6CUmMsT2Rl16gzuFCd4Qsv3 NxtHaIP1QGqpfnibF07RSXVpkd/CymQrPfz/idQCFnGP+iQsVv/2+11nNHV1fjRdsT XHc1KkKG+LCOc+gjKqHN7tfa1JpvlGEbmI7sjhqYKQI9Ri5uHbpU9vjNAfV3/V1Ma6 xZUbHSfIPs8vBryW4nGHXOrIrD3ibsG/dSMlsyalDV4sEd1sEJG632gfwQ5ufDWldq +JMg0KZD1CxK7Oo3sL9qMu9AdmbKryvHdrUtLyTTnumBvDP87FiIz865WHzFcpwl6f r2Gom6YHc/yeA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v5 10/15] drm/i915/dp: Compute the PCON DSC encoder parameters To: "Ankit Nautiyal" , intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org In-Reply-To: <20261204085746.391918-11-ankit.k.nautiyal@intel.com> References: <20261204085746.391918-1-ankit.k.nautiyal@intel.com> <20261204085746.391918-11-ankit.k.nautiyal@intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 09:52:56 +0000 X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev Sender: "Intel-xe" 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 1 potential issue to consider: - [Medium] drm/i915/dp: missing PCON and sink DSC capability checks in compute -- commit 436e850e3ddf87d0b01bc7a145ea30594fd044f0 Author: Ankit Nautiyal drm/i915/dp: Compute the PCON DSC encoder parameters This commit moves computation of the PCON DSC encoder slice height, slice width, and compressed bpp from enable time to compute config, storing the parameters in the crtc state for intel_dp_pcon_dsc_configure() to program. > diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i9= 15/display/intel_dp.c > index ca218481182fd..272837cc6efa4 100644 > --- a/drivers/gpu/drm/i915/display/intel_dp.c > +++ b/drivers/gpu/drm/i915/display/intel_dp.c > @@ -1232,6 +1232,69 @@ intel_dp_pcon_sink_support_frl(struct intel_dp *in= tel_dp) > intel_dp_hdmi_sink_max_frl(intel_dp); > } > =20 > +static bool intel_dp_pcon_can_encode_dsc(struct intel_dp *intel_dp) > +{ > + struct intel_connector *connector =3D intel_dp->attached_connector; > + > + return intel_dp_is_hdmi_2_1_sink(intel_dp) && > + connector->base.display_info.hdmi.dsc_cap.v_1p2 && > + drm_dp_pcon_enc_is_dsc_1_2(intel_dp->pcon_dsc_dpcd); > +} > + > +/* > + * Compute the PCON DSC encoder parameters for the stream sent to the HD= MI > + * sink, which is in @sink_format. @enc can be NULL to only check feasib= ility. > + */ > +static bool > +intel_dp_pcon_dsc_enc_compute(struct intel_dp *intel_dp, > + const struct drm_display_mode *mode, int pixel_clock, > + int bpc, enum intel_output_format sink_format, > + struct intel_pcon_dsc_enc_config *enc) > +{ > + struct intel_connector *connector =3D intel_dp->attached_connector; > + const struct drm_display_info *info =3D &connector->base.display_info; > + int pcon_max_slices =3D drm_dp_pcon_dsc_max_slices(intel_dp->pcon_dsc_d= pcd); > + int pcon_max_slice_width =3D drm_dp_pcon_dsc_max_slice_width(intel_dp->= pcon_dsc_dpcd); > + int slice_height, num_slices, slice_width, max_link_dsc_bpp, bpp_x16; > + > + if (!intel_dp_pcon_can_encode_dsc(intel_dp)) > + return false; > + > + slice_height =3D intel_hdmi_dsc_get_slice_height(mode->vdisplay); > + if (!slice_height) > + return false; > + > + num_slices =3D intel_hdmi_dsc_get_num_slices(mode, pixel_clock, sink_fo= rmat, > + pcon_max_slices, pcon_max_slice_width, > + info->hdmi.dsc_cap.max_slices, > + info->hdmi.dsc_cap.clk_per_slice); > + if (!num_slices) > + return false; > + > + slice_width =3D DIV_ROUND_UP(mode->hdisplay, num_slices); > + > + /* The compressed stream has to fit the FRL link */ > + max_link_dsc_bpp =3D intel_dp_hdmi_frl_payload_bw(intel_dp) / pixel_clo= ck; > + if (!max_link_dsc_bpp) > + return false; > + > + bpp_x16 =3D intel_hdmi_dsc_get_bpp(drm_dp_pcon_dsc_bpp_incr(intel_dp->p= con_dsc_dpcd), > + slice_width, num_slices, sink_format, bpc, > + info->hdmi.dsc_cap.all_bpp, > + info->hdmi.dsc_cap.total_chunk_kbytes * 1024, > + max_link_dsc_bpp); > + if (!bpp_x16) > + return false; > + > + if (enc) { > + enc->slice_height =3D slice_height; > + enc->slice_width =3D slice_width; > + enc->bpp_x16 =3D bpp_x16; > + } > + > + return true; > +} [Severity: Medium] Should intel_dp_pcon_can_encode_dsc() and intel_dp_pcon_dsc_enc_compute() validate the PCON and HDMI sink DSC capabilities before accepting a mode? intel_dp_pcon_can_encode_dsc() checks only the DSC 1.2 version flags and skips DP_PCON_DSC_ENCODER_SUPPORTED and DP_PCON_DSC_PPS_ENC_OVERRIDE in DP_PCON_DSC_ENCODER, even though intel_dp_pcon_dsc_configure() unconditionally writes PPS override parameters. intel_dp_pcon_dsc_enc_compute() also skips validating sink_format against info->hdmi.dsc_cap.native_420 (for INTEL_OUTPUT_FORMAT_YCBCR420) and DP_PCON_DSC_ENC_COLOR_FMT_CAP. Similarly, bpc is not checked against info->hdmi.dsc_cap.bpc_supported (which drm_parse_dsc_info() defaults to 8 bpc independently of uncompressed deep-color support) or DP_PCON_DSC_ENC_COLOR_DEPTH_CAP. On a PCON or HDMI 2.1 sink whose DSC capabilities are narrower than its uncompressed ones (for example, 10 bpc uncompressed but only 8 bpc with DSC), intel_dp_pcon_compute_config() will accept the mode and program unsupported parameters, causing blank or corrupted display output. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204085746.3919= 18-1-ankit.k.nautiyal@intel.com?part=3D10