From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: ville.syrjala@linux.intel.com, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 02/14] drm/i915: Use DIV_ROUND_CLOSEST()
Date: Thu, 26 Sep 2013 13:09:26 +0300 [thread overview]
Message-ID: <87fvsrdhd5.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <1380047191-3359-3-git-send-email-ville.syrjala@linux.intel.com>
ville.syrjala@linux.intel.com writes:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> vlv_find_best_dpll() has an open coded DIV_ROUND_CLOSEST(). Replace it
> with the real thing.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> drivers/gpu/drm/i915/intel_display.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index fca56fc..4b1af94 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -696,8 +696,7 @@ vlv_find_best_dpll(const intel_limit_t *limit, struct drm_crtc *crtc,
> p = p1 * p2;
> /* based on hardware requirement, prefer bigger m1,m2 values */
> for (m1 = limit->m1.min; m1 <= limit->m1.max; m1++) {
> - m2 = (((2*(fastclk * p * n / m1 )) +
> - refclk) / (2*refclk));
> + m2 = DIV_ROUND_CLOSEST(fastclk * p * n, refclk * m1);
> m = m1 * m2;
> vco = updrate * m;
>
> --
> 1.8.1.5
Not a problem with this patch but perhaps consideration for further
cleanups: target and refclk should be u32 and further down the line
the crtc_config.clock and xxx_get_refclk() also.
Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2013-09-26 10:09 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-24 18:26 [PATCH 00/14] drm/i915: VLV DPLL calc fixes and cleanups ville.syrjala
2013-09-24 18:26 ` [PATCH 01/14] drm/i915: Eliminate one indent leel from vlv_find_best_dpll ville.syrjala
2013-09-26 10:04 ` Mika Kuoppala
2013-09-24 18:26 ` [PATCH 02/14] drm/i915: Use DIV_ROUND_CLOSEST() ville.syrjala
2013-09-26 10:09 ` Mika Kuoppala [this message]
2013-09-27 19:35 ` Daniel Vetter
2013-09-24 18:26 ` [PATCH 03/14] drm/i915: Make vlv_find_best_dpll() ppm calculation safe ville.syrjala
2013-09-24 18:26 ` [PATCH 04/14] drm/i915: Don't underflow bestppm ville.syrjala
2013-09-24 18:26 ` [PATCH v2 05/14] drm/i915: Rewrite vlv_find_best_dpll() ville.syrjala
2013-09-26 15:30 ` Mika Kuoppala
2013-09-27 13:01 ` Ville Syrjälä
2013-09-27 13:55 ` [PATCH 15/14] drm/i915: Use intel_PLL_is_valid() in vlv_find_best_dpll() ville.syrjala
2013-09-27 11:55 ` [PATCH v2 05/14] drm/i915: Rewrite vlv_find_best_dpll() Mika Kuoppala
2013-09-27 13:04 ` Ville Syrjälä
2013-09-27 13:54 ` [PATCH v3 " ville.syrjala
2013-09-24 18:26 ` [PATCH 06/14] drm/i915: De-magic the VLV p2 divider step size ville.syrjala
2013-09-24 18:26 ` [PATCH 07/14] drm/i915: Make sure we respect n.max on VLV ville.syrjala
2013-09-24 18:26 ` [PATCH 08/14] drm/i915: Clarify VLV PLL p1 limits ville.syrjala
2013-09-24 18:26 ` [PATCH 09/14] drm/i915: Allow p1 divider 2 on VLV ville.syrjala
2013-09-24 18:26 ` [PATCH 10/14] drm/i915: Respect p2 divider minimum limit " ville.syrjala
2013-09-24 18:26 ` [PATCH 11/14] drm/i915: Remove the unused p and m limits for VLV ville.syrjala
2013-09-24 18:26 ` [PATCH 12/14] drm/i915: Remove unused dot_limit from VLV PLL limits ville.syrjala
2013-09-24 18:26 ` [PATCH 13/14] drm/i915: intel_limits_vlv_dac and intel_limits_vlv_hdmi are the same ville.syrjala
2013-09-24 18:26 ` [PATCH 14/14] drm/i915: Don't lie about findind suitable PLL settings on VLV ville.syrjala
2013-09-24 19:15 ` [PATCH 00/14] drm/i915: VLV DPLL calc fixes and cleanups Daniel Vetter
2013-09-25 7:38 ` [PATCH] drm/i915: Fix 1.62 DP DPLL settings for VLV ville.syrjala
2013-09-30 15:06 ` [PATCH 00/14] drm/i915: VLV DPLL calc fixes and cleanups Mika Kuoppala
2013-10-04 13:34 ` Daniel Vetter
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=87fvsrdhd5.fsf@gaia.fi.intel.com \
--to=mika.kuoppala@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