Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Govindapillai, Vinod" <vinod.govindapillai@intel.com>
To: "ville.syrjala@linux.intel.com" <ville.syrjala@linux.intel.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>
Cc: "intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH 2/3] drm/i915: Deobfuscate wm linetime calculation
Date: Wed, 1 Oct 2025 12:06:48 +0000	[thread overview]
Message-ID: <2e068f58ee4f81caca16257a3016d516b75c186e.camel@intel.com> (raw)
In-Reply-To: <20250919180838.10498-3-ville.syrjala@linux.intel.com>

On Fri, 2025-09-19 at 21:08 +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> intel_get_linetime_us() is a mess. Rewrite it in a straightforward
> manner. Also the checks for the !active and pixel_rate==0 are
> completely pointless here since we know that the plane is visible.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/display/skl_watermark.c | 21 ++++----------------
>  1 file changed, 4 insertions(+), 17 deletions(-)
> 

Reviewed-by: Vinod Govindapillai <vinod.govindapillai@intel.com>

> diff --git a/drivers/gpu/drm/i915/display/skl_watermark.c
> b/drivers/gpu/drm/i915/display/skl_watermark.c
> index bdd005c6cc2d..3eaaf26100f1 100644
> --- a/drivers/gpu/drm/i915/display/skl_watermark.c
> +++ b/drivers/gpu/drm/i915/display/skl_watermark.c
> @@ -1636,24 +1636,12 @@ skl_wm_method2(u32 pixel_rate, u32 pipe_htotal, u32 latency,
>  	return ret;
>  }
>  
> -static uint_fixed_16_16_t
> +static int
>  intel_get_linetime_us(const struct intel_crtc_state *crtc_state,
>  		      int pixel_rate)
>  {
> -	struct intel_display *display = to_intel_display(crtc_state);
> -	u32 crtc_htotal;
> -	uint_fixed_16_16_t linetime_us;
> -
> -	if (!crtc_state->hw.active)
> -		return u32_to_fixed16(0);
> -
> -	if (drm_WARN_ON(display->drm, pixel_rate == 0))
> -		return u32_to_fixed16(0);
> -
> -	crtc_htotal = crtc_state->hw.pipe_mode.crtc_htotal;
> -	linetime_us = div_fixed16(crtc_htotal * 1000, pixel_rate);
> -
> -	return linetime_us;
> +	return DIV_ROUND_UP(crtc_state->hw.pipe_mode.crtc_htotal * 1000,
> +			    pixel_rate);
>  }
>  
>  static int
> @@ -1741,8 +1729,7 @@ skl_compute_wm_params(const struct intel_crtc_state *crtc_state,
>  	wp->y_tile_minimum = mul_u32_fixed16(wp->y_min_scanlines,
>  					     wp->plane_blocks_per_line);
>  
> -	wp->linetime_us = fixed16_to_u32_round_up(intel_get_linetime_us(crtc_state,
> -									plane_pixel_rate));
> +	wp->linetime_us = intel_get_linetime_us(crtc_state, plane_pixel_rate);
>  
>  	return 0;
>  }


  reply	other threads:[~2025-10-01 12:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-19 18:08 [PATCH 0/3] drm/i915: Fix skl+ watermark linetime stuff Ville Syrjala
2025-09-19 18:08 ` [PATCH 1/3] drm/i915: Use the the correct pixel rate to compute wm line time Ville Syrjala
2025-10-01 10:27   ` Govindapillai, Vinod
2025-10-01 11:34     ` Ville Syrjälä
2025-10-01 12:06       ` Govindapillai, Vinod
2025-09-19 18:08 ` [PATCH 2/3] drm/i915: Deobfuscate wm linetime calculation Ville Syrjala
2025-10-01 12:06   ` Govindapillai, Vinod [this message]
2025-09-19 18:08 ` [PATCH 3/3] drm/i915: s/intel_get_linetime_us()/skl_wm_linetime_us()/ Ville Syrjala
2025-10-01 12:07   ` Govindapillai, Vinod
2025-09-19 19:06 ` ✗ i915.CI.BAT: failure for drm/i915: Fix skl+ watermark linetime stuff Patchwork
2025-09-20 17:45 ` ✓ i915.CI.BAT: success for drm/i915: Fix skl+ watermark linetime stuff (rev2) Patchwork
2025-09-20 21:18 ` ✗ i915.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=2e068f58ee4f81caca16257a3016d516b75c186e.camel@intel.com \
    --to=vinod.govindapillai@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=ville.syrjala@linux.intel.com \
    /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