On Sat, 17 Jul 2010 13:38:44 +0100, Chris Wilson <ch...@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 _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx