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 207E6606A33B for ; Fri, 4 Dec 2026 09:20:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=nPOsXIrg Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 12CAB112E09; Fri, 4 Dec 2026 09:20:46 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.4]) by gabe.freedesktop.org (Postfix) with ESMTPS id 54026112DEA; Fri, 4 Dec 2026 09:20:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796376039; x=1827912039; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xETMFwf7bwcQux7aoZ8R1hqmA+7uPMeIthFEuDKJk3w=; b=nPOsXIrgkaUHqBgD5I9AXKvmmqCWaYklxcnnTJpZSYNvpXtGc4HcmAoZ HXZnNqA41LDcK/Dlv0iCwO+bdY++Kxtb8ClherY7gYS4TVJAH+6rBRmxK ZfFBrJzEmfdPLeQwn8wusHOvzeTuA2zfok3YhgWNy7rKBHvVrN87deLto P1FNFSZL6tdcU8N3tkPZvvbsJJr3olrhagYBiwPVjuZcxQmNlw1btdp+X KmhvGLxWe4yjmFmli/i9c3bFuwGpa0CRhEx8BOfawmdlHyB+mu7uStbgd dW9kvzpDrgCRZ4oqT3RMsSSkvPbmDqPEwVX+AHDG049aVRoPLztDX5A8+ w==; X-CSE-ConnectionGUID: 8bBSgs56STC3EETY5J0nDQ== X-CSE-MsgGUID: UR2RkAkKTHiLAeNIkTB7aw== X-IronPort-AV: E=McAfee;i="6800,10657,11985"; a="109031" X-IronPort-AV: E=Sophos;i="6.29,78,1794902400"; d="scan'208";a="109031" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa114.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2026 01:13:30 -0800 X-CSE-ConnectionGUID: 8xXNnFTnRIq07eEBIp68lQ== X-CSE-MsgGUID: k+MsXwNGQkqlreGZaWazng== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.29,78,1794902400"; d="scan'208";a="13864130" Received: from srr4-3-linux-103-aknautiy.iind.intel.com ([10.223.34.160]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2026 01:13:28 -0800 From: Ankit Nautiyal To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org, alexander.kaplan@sms-medipool.de, suraj.kandpal@intel.com, Ankit Nautiyal Subject: [PATCH v5 08/15] drm/i915/dp: Clamp PCON DSC bpp to the FRL link bandwidth Date: Fri, 4 Dec 2026 14:27:39 +0530 Message-ID: <20261204085746.391918-9-ankit.k.nautiyal@intel.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20261204085746.391918-1-ankit.k.nautiyal@intel.com> References: <20261204085746.391918-1-ankit.k.nautiyal@intel.com> X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: , Sender: "dri-devel" X-Spam-Status: No, score=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT 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 While configuring the PCON DSC encoder, intel_hdmi_dsc_get_bpp() picks the highest compressed bpp that fits the sink's per-scanline chunk-bytes limit. However it does not account for the FRL link bandwidth, so the selected bpp can end up exceeding what the trained PCON/sink FRL link can actually carry. Add a parameter to limit the maximum bpp to what the link can carry. All callers pass 0 for now, which means no limit. Signed-off-by: Ankit Nautiyal --- drivers/gpu/drm/i915/display/intel_dp.c | 2 +- drivers/gpu/drm/i915/display/intel_hdmi.c | 8 +++++++- drivers/gpu/drm/i915/display/intel_hdmi.h | 3 ++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index a469766c0a6b..e84c060e5563 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -4578,7 +4578,7 @@ intel_dp_pcon_dsc_enc_bpp(struct intel_dp *intel_dp, return intel_hdmi_dsc_get_bpp(pcon_fractional_bpp, slice_width, num_slices, output_format, bpc, hdmi_all_bpp, - hdmi_max_chunk_bytes); + hdmi_max_chunk_bytes, 0); } void diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c index b4b39f5edfae..834900b0d11a 100644 --- a/drivers/gpu/drm/i915/display/intel_hdmi.c +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c @@ -3469,13 +3469,15 @@ get_dsc_compressed_bpp(enum intel_output_format output_format, int bpc, * @bpc: bits per color * @hdmi_all_bpp: sink supports decoding of 1/16th bpp setting * @hdmi_max_chunk_bytes: max bytes in a line of chunks supported by sink + * @max_link_dsc_bpp: max compressed bpp the link bandwidth can carry, or 0 if not limited * * @return: compressed bits_per_pixel in step of 1/16 of bits_per_pixel */ int intel_hdmi_dsc_get_bpp(int src_fractional_bpp, int slice_width, int num_slices, enum intel_output_format output_format, int bpc, - bool hdmi_all_bpp, int hdmi_max_chunk_bytes) + bool hdmi_all_bpp, int hdmi_max_chunk_bytes, + int max_link_dsc_bpp) { int max_dsc_bpp, min_dsc_bpp; int dsc_bpp_x16; @@ -3483,6 +3485,10 @@ intel_hdmi_dsc_get_bpp(int src_fractional_bpp, int slice_width, int num_slices, intel_hdmi_dsc_get_min_max_bpp(output_format, bpc, hdmi_all_bpp, &min_dsc_bpp, &max_dsc_bpp); + /* Limit the bpp to what the link bandwidth can carry */ + if (max_link_dsc_bpp) + max_dsc_bpp = min(max_dsc_bpp, max_link_dsc_bpp); + dsc_bpp_x16 = get_dsc_compressed_bpp(output_format, bpc, num_slices, slice_width, hdmi_max_chunk_bytes, diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.h b/drivers/gpu/drm/i915/display/intel_hdmi.h index 375f1b4decfb..acc025ae507c 100644 --- a/drivers/gpu/drm/i915/display/intel_hdmi.h +++ b/drivers/gpu/drm/i915/display/intel_hdmi.h @@ -56,7 +56,8 @@ bool intel_hdmi_bpc_possible(const struct intel_crtc_state *crtc_state, int intel_hdmi_tmds_clock(int clock, int bpc, enum intel_output_format sink_format); int intel_hdmi_dsc_get_bpp(int src_fractional_bpp, int slice_width, int num_slices, enum intel_output_format output_format, - int bpc, bool hdmi_all_bpp, int hdmi_max_chunk_bytes); + int bpc, bool hdmi_all_bpp, int hdmi_max_chunk_bytes, + int max_link_dsc_bpp); void intel_hdmi_dsc_get_min_max_bpp(enum intel_output_format output_format, u8 bpc, bool hdmi_all_bpp, int *min_dsc_bpp, int *max_dsc_bpp); bool intel_hdmi_dsc_bpp_fits_chunk_bytes(int bpp, int num_slices, int slice_width, -- 2.50.1