public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 6/7] drm/i915: Switch intel_usecs_to_scanlines() to 64bit maths
Date: Wed, 29 May 2024 12:22:52 +0300	[thread overview]
Message-ID: <87jzjdj7kj.fsf@intel.com> (raw)
In-Reply-To: <20240528185647.7765-7-ville.syrjala@linux.intel.com>

On Tue, 28 May 2024, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Dotclocks can reach ~1GHz these days, so intel_usecs_to_scanlines(),
> with its 32bit maths, is currently limited to a few milliseconds.
> I want bigger numbers in DSB selftests, so switch over to 64bit
> maths.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

> ---
>  drivers/gpu/drm/i915/display/intel_crtc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_crtc.c b/drivers/gpu/drm/i915/display/intel_crtc.c
> index ca6dc1dc56c8..17edd6099287 100644
> --- a/drivers/gpu/drm/i915/display/intel_crtc.c
> +++ b/drivers/gpu/drm/i915/display/intel_crtc.c
> @@ -454,8 +454,8 @@ int intel_usecs_to_scanlines(const struct drm_display_mode *adjusted_mode,
>  	if (!adjusted_mode->crtc_htotal)
>  		return 1;
>  
> -	return DIV_ROUND_UP(usecs * adjusted_mode->crtc_clock,
> -			    1000 * adjusted_mode->crtc_htotal);
> +	return DIV_ROUND_UP_ULL(mul_u32_u32(usecs, adjusted_mode->crtc_clock),
> +				1000 * adjusted_mode->crtc_htotal);
>  }
>  
>  /**

-- 
Jani Nikula, Intel

  reply	other threads:[~2024-05-29  9:23 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-28 18:56 [PATCH 0/7] drm/i915: Cleanups around scanline arithmetic Ville Syrjala
2024-05-28 18:56 ` [PATCH 1/7] drm/i915: Reuse intel_mode_vblank_start() Ville Syrjala
2024-05-29  9:03   ` Jani Nikula
2024-05-28 18:56 ` [PATCH 2/7] drm/i915: Extract intel_mode_vblank_end() Ville Syrjala
2024-05-29  9:05   ` Jani Nikula
2024-05-28 18:56 ` [PATCH 3/7] drm/i915: Extract intel_mode_vtotal() Ville Syrjala
2024-05-29  9:06   ` Jani Nikula
2024-05-28 18:56 ` [PATCH 4/7] drm/i915: Simplify scanline_offset handling for gen2 Ville Syrjala
2024-05-29  9:20   ` Jani Nikula
2024-05-28 18:56 ` [PATCH 5/7] drm/i915: Move intel_crtc_scanline_offset() Ville Syrjala
2024-05-29  9:22   ` Jani Nikula
2024-05-28 18:56 ` [PATCH 6/7] drm/i915: Switch intel_usecs_to_scanlines() to 64bit maths Ville Syrjala
2024-05-29  9:22   ` Jani Nikula [this message]
2024-05-28 18:56 ` [PATCH 7/7] drm/i915/dsb: Convert dewake_scanline to a hw scanline number earlier Ville Syrjala
2024-05-29  9:32   ` Jani Nikula
2024-05-28 20:01 ` ✓ Fi.CI.BAT: success for drm/i915: Cleanups around scanline arithmetic Patchwork
2024-05-29 14:15 ` ✓ Fi.CI.IGT: " 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=87jzjdj7kj.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=intel-gfx@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