Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/2] drm/i915: Refactor panel fitting on the LVDS.
Date: Sat, 17 Jul 2010 13:48:22 +0100	[thread overview]
Message-ID: <89k83a$8v8ql7@azsmga001.ch.intel.com> (raw)
In-Reply-To: <1279370324-12761-2-git-send-email-chris@chris-wilson.co.uk>

On Sat, 17 Jul 2010 13:38:44 +0100, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> +static inline u32 panel_fitter_scaling(u32 source, u32 target)
> +{
> +	/*
> +	 * Floating point operation is not supported. So the FACTOR
> +	 * is defined, which can avoid the floating point computation
> +	 * when calculating the panel ratio.
> +	 */
> +#define ACCURACY 12
> +#define FACTOR (1 << ACCURACY)
> +	u32 ratio = source * FACTOR / target;
> +	return (FACTOR * (ratio + FACTOR/2)) / FACTOR;
> +}

Rounding went wrong here. Should be
  return (FACTOR * ratio + FACTOR/2) / FACTOR;

-- 
Chris Wilson, Intel Open Source Technology Centre

  reply	other threads:[~2010-07-17 12:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-17 12:38 [PATCH 1/2] drm/i915: Remove the redundant check for a fixed_panel_mode Chris Wilson
2010-07-17 12:38 ` [PATCH 2/2] drm/i915: Refactor panel fitting on the LVDS Chris Wilson
2010-07-17 12:48   ` Chris Wilson [this message]
2010-07-18  1:15   ` Jesse Barnes
2010-07-18 11:07     ` Chris Wilson

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='89k83a$8v8ql7@azsmga001.ch.intel.com' \
    --to=chris@chris-wilson.co.uk \
    --cc=intel-gfx@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox