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 587A6606A32D for ; Fri, 4 Dec 2026 09:21:02 +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=jnSun+QS Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 18744112DFF; Fri, 4 Dec 2026 09:20:56 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.4]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4B35C112DFF; Fri, 4 Dec 2026 09:20:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796376050; x=1827912050; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Zu9Aq6FqcYrm9C90RZZcUNq73b6w+N1gbwhxNQSJmd4=; b=jnSun+QSAA/k9ZJ5IbGzfxIPEQtRGPuV+hAEn9JTZwBbhIPLmlJm4OEl 5eVktV++uSbGM0v39VxUOqYPX1GBD7VkSWWjbZI2YTbD7ehO+IGchPm32 uaGFB5XR697wRethuVNQ+F4suMyDh4JLaBBmYQZ1ofjIgy7kD2yykiddD 3/HnmfU17jo+hVPYXv0Bj5NDmVE8a8uyfvfBYkhbJVNeXgW6Xc6wqSJ9o 8iI47ZsWyK9w+RydY8Ey03RfpORPM5OAY0igtts5ZPcxomQaaXUVIz7D/ D3UcfB7MOzZCCsG1lRnoXQ6y3pwiXVGTg75fAr6TCivyxQv2WTJgg/S8S Q==; X-CSE-ConnectionGUID: cU16/TQ6SXWxRYmH2WOBCw== X-CSE-MsgGUID: YLP27oMER6SzrH7gWkbIEg== X-IronPort-AV: E=McAfee;i="6800,10657,11985"; a="109070" X-IronPort-AV: E=Sophos;i="6.29,78,1794902400"; d="scan'208";a="109070" 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:42 -0800 X-CSE-ConnectionGUID: 8CkkSq1tRHCz0iGbVlIsWQ== X-CSE-MsgGUID: 7lqox00zRvKdgZ22vTzoNw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.29,78,1794902400"; d="scan'208";a="13864236" 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:40 -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 14/15] drm/i915/dp: Pick the bpc for a PCON DSC stream Date: Fri, 4 Dec 2026 14:27:45 +0530 Message-ID: <20261204085746.391918-15-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: 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: , Sender: "Intel-gfx" 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 Currently the bpc for the HDMI link is picked only from the bpcs that fit the FRL link uncompressed. No bpc is found for a mode that needs DSC on the HDMI link, even though an HDMI 2.1 PCON can decode the DP stream and encode DSC 1.2 for the HDMI sink. If the DP stream is compressed and no bpc fits the HDMI link uncompressed, pick the highest bpc the PCON can encode for the HDMI link. The PCON can't encode an uncompressed stream, so this is done only in the pass that compresses the DP stream, after the uncompressed bpcs are tried. The mode valid check still prunes such modes. The next change lets them through. Signed-off-by: Ankit Nautiyal --- drivers/gpu/drm/i915/display/intel_dp.c | 43 ++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index f2505b707cad..94744ead1a6e 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 *intel_dp, return true; } +/* + * 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); +} + static enum drm_mode_status intel_dp_hdmi_bw_valid(struct intel_dp *intel_dp, int target_clock, int bpc, @@ -1835,9 +1849,11 @@ bool intel_dp_supports_dsc(struct intel_dp *intel_dp, static int intel_dp_hdmi_compute_bpc(struct intel_dp *intel_dp, const struct intel_crtc_state *crtc_state, - int bpc, bool respect_downstream_limits) + int bpc, bool respect_downstream_limits, + bool dsc) { int clock = crtc_state->hw.adjusted_mode.crtc_clock; + int max_bpc; /* * Current bpc could already be below 8bpc due to @@ -1854,6 +1870,8 @@ static int intel_dp_hdmi_compute_bpc(struct intel_dp *intel_dp, if (!respect_downstream_limits) bpc = 8; + max_bpc = bpc; + for (; bpc >= 8; bpc -= 2) { if (intel_hdmi_bpc_possible(crtc_state, bpc, intel_dp_has_hdmi_sink(intel_dp)) && @@ -1862,12 +1880,27 @@ static int intel_dp_hdmi_compute_bpc(struct intel_dp *intel_dp, return bpc; } + /* + * No bpc fits the HDMI link uncompressed. If the DP stream is compressed + * the PCON may be able to compress the stream for the HDMI link as well. + */ + if (!dsc || !respect_downstream_limits) + return -EINVAL; + + for (bpc = max_bpc; bpc >= 8; bpc -= 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; } static int intel_dp_max_bpp(struct intel_dp *intel_dp, const struct intel_crtc_state *crtc_state, - bool respect_downstream_limits) + bool respect_downstream_limits, bool dsc) { struct intel_display *display = to_intel_display(intel_dp); struct intel_connector *connector = intel_dp->attached_connector; @@ -1882,7 +1915,8 @@ static int intel_dp_max_bpp(struct intel_dp *intel_dp, int max_hdmi_bpc; max_hdmi_bpc = intel_dp_hdmi_compute_bpc(intel_dp, crtc_state, bpc, - respect_downstream_limits); + respect_downstream_limits, + dsc); if (max_hdmi_bpc < 0) return 0; @@ -2964,7 +2998,8 @@ intel_dp_compute_config_limits(struct intel_dp *intel_dp, limits->pipe.max_bpp = min(crtc_state->max_pipe_bpp, 24); } else { limits->pipe.max_bpp = intel_dp_max_bpp(intel_dp, crtc_state, - respect_downstream_limits); + respect_downstream_limits, + dsc); } if (!dsc && intel_dp_in_hdr_mode(conn_state)) { -- 2.50.1