All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Nautiyal, Ankit K" <ankit.k.nautiyal@intel.com>
To: Imre Deak <imre.deak@intel.com>,
	<intel-gfx@lists.freedesktop.org>,
	<intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH v2 07/12] drm/i915/dp: Limit max link bpp properly to a fractional value on SST
Date: Tue, 6 May 2025 18:04:09 +0530	[thread overview]
Message-ID: <707ea5e3-2376-4a85-97d4-cd16e436889d@intel.com> (raw)
In-Reply-To: <20250428133135.3396080-8-imre.deak@intel.com>


On 4/28/2025 7:01 PM, Imre Deak wrote:
> 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.
>
> v2: Align the min/max bpp value to the bpp step.
>
> Signed-off-by: Imre Deak <imre.deak@intel.com>
> ---
>   drivers/gpu/drm/i915/display/intel_dp.c | 17 ++++++++---------
>   1 file changed, 8 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 42b45598a0134..7abc5286f4ccc 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -27,6 +27,8 @@
>   
>   #include <linux/export.h>
>   #include <linux/i2c.h>
> +#include <linux/log2.h>
> +#include <linux/math.h>
>   #include <linux/notifier.h>
>   #include <linux/seq_buf.h>
>   #include <linux/slab.h>
> @@ -938,6 +940,7 @@ static u32 ultrajoiner_ram_max_bpp(u32 mode_hdisplay)
>   	return ultrajoiner_ram_bits() / mode_hdisplay;
>   }
>   
> +/* TODO: return a bpp_x16 value */

Makes sense, I can take this up later.

Patch LGTM.

Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>

>   static
>   u32 get_max_compressed_bpp_with_joiner(struct intel_display *display,
>   				       u32 mode_clock, u32 mode_hdisplay,
> @@ -2152,24 +2155,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 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);
>   
> @@ -2177,6 +2172,10 @@ 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);
>   
> +	drm_WARN_ON(display->drm, !is_power_of_2(bpp_step_x16));
> +	min_bpp_x16 = round_up(limits->link.min_bpp_x16, bpp_step_x16);
> +	max_bpp_x16 = round_down(max_bpp_x16, bpp_step_x16);
> +
>   	for (bpp_x16 = max_bpp_x16; bpp_x16 >= min_bpp_x16; bpp_x16 -= bpp_step_x16) {
>   		if (!intel_dp_dsc_valid_compressed_bpp(intel_dp, bpp_x16))
>   			continue;

  parent reply	other threads:[~2025-05-06 12:34 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-28 13:31 [PATCH v2 00/12] drm/i915/dp_mst: Add support for fractional link bpps Imre Deak
2025-04-28 13:31 ` [PATCH v2 01/12] drm/i915/dp_mst: Use the correct connector while computing the link BPP limit on MST Imre Deak
2025-05-06  8:45   ` Nautiyal, Ankit K
2025-05-06  9:39   ` Luca Coelho
2025-04-28 13:31 ` [PATCH v2 02/12] drm/i915/dp_mst: Simplify handling the single-bpp case during state computation Imre Deak
2025-05-06  9:51   ` Nautiyal, Ankit K
2025-05-06 10:00     ` Imre Deak
2025-05-06 12:32       ` Nautiyal, Ankit K
2025-05-06  9:53   ` Luca Coelho
2025-04-28 13:31 ` [PATCH v2 03/12] drm/i915/dp_mst: Validate compressed bpp vs. platform restrictions Imre Deak
2025-05-06  9:54   ` Nautiyal, Ankit K
2025-05-06 10:03   ` Luca Coelho
2025-04-28 13:31 ` [PATCH v2 04/12] drm/i915/dp_mst: Update the total link slot count early Imre Deak
2025-05-06  9:55   ` Nautiyal, Ankit K
2025-05-06 10:07   ` Luca Coelho
2025-04-28 13:31 ` [PATCH v2 05/12] drm/i915/dp_mst: Check BW limit on the local MST link early Imre Deak
2025-05-06 10:06   ` Nautiyal, Ankit K
2025-04-28 13:31 ` [PATCH v2 06/12] drm/i915/dp_mst: Simplify computing the min/max compressed bpp limits Imre Deak
2025-05-06 10:11   ` Luca Coelho
2025-05-06 10:16   ` Nautiyal, Ankit K
2025-04-28 13:31 ` [PATCH v2 07/12] drm/i915/dp: Limit max link bpp properly to a fractional value on SST Imre Deak
2025-05-06 10:27   ` Luca Coelho
2025-05-06 12:34   ` Nautiyal, Ankit K [this message]
2025-04-28 13:31 ` [PATCH v2 08/12] drm/i915/dp_mst: Add support for fractional compressed link bpps on MST Imre Deak
2025-05-06 13:02   ` Nautiyal, Ankit K
2025-04-28 13:31 ` [PATCH v2 09/12] drm/i915/display: Factor out intel_display_{min, max}_pipe_bpp() Imre Deak
2025-05-06 13:07   ` Nautiyal, Ankit K
2025-05-06 15:16     ` Imre Deak
2025-05-07  3:59       ` Nautiyal, Ankit K
2025-05-07 10:58         ` Imre Deak
2025-05-07 12:44           ` Nautiyal, Ankit K
2025-04-28 13:31 ` [PATCH v2 10/12] drm/i915/dp: Export intel_dp_dsc_min_src_compressed_bpp() Imre Deak
2025-05-06 13:16   ` Nautiyal, Ankit K
2025-04-28 13:31 ` [PATCH v2 11/12] drm/i915: Add support for forcing the link bpp on a connector Imre Deak
2025-05-07  5:37   ` Nautiyal, Ankit K
2025-05-07 12:03     ` Imre Deak
2025-05-07 12:41       ` Nautiyal, Ankit K
2025-04-28 13:31 ` [PATCH v2 12/12] drm/i915/dp_mst: Enable fractional link bpps on MST if the bpp is forced Imre Deak
2025-05-06 13:15   ` Nautiyal, Ankit K
2025-04-28 13:59 ` ✓ CI.Patch_applied: success for drm/i915/dp_mst: Add support for fractional link bpps (rev2) Patchwork
2025-04-28 13:59 ` ✗ CI.checkpatch: warning " Patchwork
2025-04-28 14:00 ` ✓ CI.KUnit: success " Patchwork
2025-04-28 14:09 ` ✓ CI.Build: " Patchwork
2025-04-28 14:11 ` ✓ CI.Hooks: " Patchwork
2025-04-28 14:12 ` ✗ CI.checksparse: warning " Patchwork
2025-04-28 17:03 ` ✗ Xe.CI.Full: failure " Patchwork
2025-04-28 17:21 ` ✗ Fi.CI.CHECKPATCH: warning " Patchwork
2025-04-28 18:00 ` ✗ i915.CI.BAT: failure " Patchwork
2025-05-07 14:09   ` Imre Deak
2025-05-08 11:46     ` Ravali, JupallyX
2025-04-28 18:01 ` Patchwork
2025-04-28 18:01 ` Patchwork
2025-04-28 18:02 ` Patchwork
2025-04-28 18:02 ` Patchwork
2025-04-28 18:03 ` Patchwork
2025-04-28 18:03 ` Patchwork
2025-04-28 18:03 ` Patchwork
2025-04-28 18:03 ` Patchwork
2025-04-28 18:04 ` Patchwork
2025-04-28 18:05 ` Patchwork
2025-04-28 18:05 ` Patchwork
2025-04-28 18:06 ` Patchwork
2025-04-28 18:06 ` Patchwork
2025-04-28 18:06 ` Patchwork
2025-05-06  8:37 ` ✓ Xe.CI.BAT: success " Patchwork
2025-05-08 14:37 ` ✗ Fi.CI.BUILD: failure for drm/i915/dp_mst: Add support for fractional link bpps (rev3) 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=707ea5e3-2376-4a85-97d4-cd16e436889d@intel.com \
    --to=ankit.k.nautiyal@intel.com \
    --cc=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.