Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Imre Deak <imre.deak@intel.com>
To: <intel-gfx@lists.freedesktop.org>, <intel-xe@lists.freedesktop.org>
Subject: [PATCH 02/10] drm/i915/dp: Limit max link bpp properly to a fractional value on SST
Date: Wed, 9 Apr 2025 00:43:32 +0300	[thread overview]
Message-ID: <20250408214342.1953197-3-imre.deak@intel.com> (raw)
In-Reply-To: <20250408214342.1953197-1-imre.deak@intel.com>

The maximum link bpp - determined by the link BW for instance - can be
fractional, handle this properly during computing the link bpp on SST.

This keeps the pipe joiner specific maximum link bpp as a rounded-down
integer value still, changing that to a fractional value is left for
later.

Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 drivers/gpu/drm/i915/display/intel_dp.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 713cc6e65faac..14c3d5e10a430 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -938,6 +938,7 @@ static u32 ultrajoiner_ram_max_bpp(u32 mode_hdisplay)
 	return ultrajoiner_ram_bits() / mode_hdisplay;
 }
 
+/* TODO: return a bpp_x16 value */
 static
 u32 get_max_compressed_bpp_with_joiner(struct intel_display *display,
 				       u32 mode_clock, u32 mode_hdisplay,
@@ -2148,24 +2149,16 @@ static int dsc_compute_compressed_bpp(struct intel_dp *intel_dp,
 	const struct intel_connector *connector = to_intel_connector(conn_state->connector);
 	const struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode;
 	int output_bpp;
-	int dsc_min_bpp;
-	int dsc_max_bpp;
-	int min_bpp_x16, max_bpp_x16, bpp_step_x16;
+	int max_bpp_x16, bpp_step_x16;
 	int dsc_joiner_max_bpp;
 	int num_joined_pipes = intel_crtc_num_joined_pipes(pipe_config);
 	int bpp_x16;
 	int ret;
 
-	dsc_min_bpp = fxp_q4_to_int_roundup(limits->link.min_bpp_x16);
-
 	dsc_joiner_max_bpp = get_max_compressed_bpp_with_joiner(display, adjusted_mode->clock,
 								adjusted_mode->hdisplay,
 								num_joined_pipes);
-	dsc_max_bpp = min(dsc_joiner_max_bpp, fxp_q4_to_int(limits->link.max_bpp_x16));
-
-	/* FIXME: remove the round trip via integers */
-	min_bpp_x16 = fxp_q4_from_int(dsc_min_bpp);
-	max_bpp_x16 = fxp_q4_from_int(dsc_max_bpp);
+	max_bpp_x16 = min(fxp_q4_from_int(dsc_joiner_max_bpp), limits->link.max_bpp_x16);
 
 	bpp_step_x16 = intel_dp_dsc_bpp_step_x16(connector);
 
@@ -2173,7 +2166,7 @@ static int dsc_compute_compressed_bpp(struct intel_dp *intel_dp,
 	output_bpp = intel_dp_output_bpp(pipe_config->output_format, pipe_bpp);
 	max_bpp_x16 = min(max_bpp_x16, fxp_q4_from_int(output_bpp) - bpp_step_x16);
 
-	for (bpp_x16 = max_bpp_x16; bpp_x16 >= min_bpp_x16; bpp_x16 -= bpp_step_x16) {
+	for (bpp_x16 = max_bpp_x16; bpp_x16 >= limits->link.min_bpp_x16; bpp_x16 -= bpp_step_x16) {
 		if (!intel_dp_dsc_valid_bpp(intel_dp, bpp_x16))
 			continue;
 
-- 
2.44.2


  parent reply	other threads:[~2025-04-08 21:44 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-08 21:43 [PATCH 00/10] drm/i915/dp_mst: Add support for fractional link bpps Imre Deak
2025-04-08 21:43 ` [PATCH 01/10] drm/i915/dp: Use the correct connector while computing the link BPP limit on MST Imre Deak
2025-04-08 21:43 ` Imre Deak [this message]
2025-04-08 21:43 ` [PATCH 03/10] drm/i915/dp_mst: Add support for fractional link bpps " Imre Deak
2025-04-08 21:43 ` [PATCH 04/10] drm/i915/dp_mst: Enable " Imre Deak
2025-04-08 21:43 ` [PATCH 05/10] drm/i915/display: Factor out intel_display_{min, max}_pipe_bpp() Imre Deak
2025-04-08 21:43 ` [PATCH 06/10] drm/i915/dp: Export intel_dp_dsc_min_src_compressed_bpp() Imre Deak
2025-04-08 21:43 ` [PATCH 07/10] drm/i915/dp: Use an intel_connector pointer everywhere Imre Deak
2025-04-09  8:26   ` Jani Nikula
2025-04-09 13:53     ` Imre Deak
2025-04-08 21:43 ` [PATCH 08/10] drm/i915/hdmi: " Imre Deak
2025-04-09  8:29   ` Jani Nikula
2025-04-09 14:01     ` Imre Deak
2025-04-08 21:43 ` [PATCH 09/10] drm/i915: Add support for forcing the link bpp on a connector Imre Deak
2025-04-09  2:55   ` kernel test robot
2025-04-09  4:28   ` kernel test robot
2025-04-08 21:43 ` [PATCH 10/10] drm/i915: Add force link bpp debugfs entry to connectors Imre Deak
2025-04-09  8:16   ` Jani Nikula
2025-04-09 13:37     ` Imre Deak
2025-04-09 14:00       ` Jani Nikula
2025-04-09 14:47         ` Imre Deak
2025-04-09  1:51 ` ✓ CI.Patch_applied: success for drm/i915/dp_mst: Add support for fractional link bpps Patchwork
2025-04-09  1:51 ` ✗ CI.checkpatch: warning " Patchwork
2025-04-09  1:52 ` ✓ CI.KUnit: success " Patchwork
2025-04-09  2:08 ` ✓ CI.Build: " Patchwork
2025-04-09  2:10 ` ✗ CI.Hooks: failure " Patchwork
2025-04-09  2:12 ` ✗ CI.checksparse: warning " Patchwork
2025-04-09  2:31 ` ✓ Xe.CI.BAT: success " Patchwork
2025-04-09  3:44 ` ✗ Xe.CI.Full: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250408214342.1953197-3-imre.deak@intel.com \
    --to=imre.deak@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox