All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>,
	intel-xe@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915/display: Update vtotal math to address 32b build
Date: Thu, 13 Jun 2024 09:25:06 +0300	[thread overview]
Message-ID: <874j9xjr5p.fsf@intel.com> (raw)
In-Reply-To: <20240612062925.271213-1-mitulkumar.ajitkumar.golani@intel.com>

On Wed, 12 Jun 2024, Mitul Golani <mitulkumar.ajitkumar.golani@intel.com> wrote:
> Fix vtotal division calculation which works for 32b systems.

This should be sent to intel-gfx (too).

BR,
Jani.

>
> Fixes: 1676ecd303ac ("drm/i915: Compute CMRR and calculate vtotal")
> Cc: Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>
> Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> Cc: Suraj Kandpal <suraj.kandpal@intel.com>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Signed-off-by: Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_vrr.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_vrr.c b/drivers/gpu/drm/i915/display/intel_vrr.c
> index 05f67dc9d98d..1e37383e14e7 100644
> --- a/drivers/gpu/drm/i915/display/intel_vrr.c
> +++ b/drivers/gpu/drm/i915/display/intel_vrr.c
> @@ -149,7 +149,8 @@ cmrr_get_vtotal(struct intel_crtc_state *crtc_state, bool video_mode_required)
>  
>  	crtc_state->cmrr.cmrr_n =
>  		desired_refresh_rate * adjusted_mode->crtc_htotal * multiplier_n;
> -	vtotal = (adjusted_mode->crtc_clock * 1000 * multiplier_n) / crtc_state->cmrr.cmrr_n;
> +	vtotal = DIV_ROUND_UP_ULL(adjusted_mode->crtc_clock * 1000 * multiplier_n,
> +				  crtc_state->cmrr.cmrr_n);
>  	adjusted_pixel_rate = adjusted_mode->crtc_clock * 1000 * multiplier_m;
>  	crtc_state->cmrr.cmrr_m = do_div(adjusted_pixel_rate, crtc_state->cmrr.cmrr_n);

-- 
Jani Nikula, Intel

  parent reply	other threads:[~2024-06-13  6:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-12  6:29 [PATCH] drm/i915/display: Update vtotal math to address 32b build Mitul Golani
2024-06-12  6:36 ` ✓ CI.Patch_applied: success for drm/i915/display: Update vtotal math to address 32b build (rev2) Patchwork
2024-06-12  6:36 ` ✓ CI.checkpatch: " Patchwork
2024-06-12  6:37 ` ✓ CI.KUnit: " Patchwork
2024-06-12  6:48 ` ✓ CI.Build: " Patchwork
2024-06-12  6:51 ` ✓ CI.Hooks: " Patchwork
2024-06-12  6:52 ` ✗ CI.checksparse: warning " Patchwork
2024-06-12  7:20 ` ✓ CI.BAT: success " Patchwork
2024-06-12  8:50 ` ✗ CI.FULL: failure " Patchwork
2024-06-13  6:25 ` Jani Nikula [this message]
2024-06-13  6:53   ` [PATCH] drm/i915/display: Update vtotal math to address 32b build Golani, Mitulkumar Ajitkumar
  -- strict thread matches above, loose matches on Subject: below --
2024-06-12  5:52 Mitul Golani

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=874j9xjr5p.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=mitulkumar.ajitkumar.golani@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 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.