[Intel-gfx] [PATCH 2/2]drm/i915: Use?best PLL timing values for G4X chipsets
Wang, Zhenyu Z
zhenyu.z.wang at intel.com
Thu Mar 12 03:06:42 CET 2009
On 2009.03.12 10:20:33 +0800, Fu Michael wrote:
> Zhenyu Wang wrote:
> > On 2009.03.10 21:00:25 +0800, Ma Ling wrote:
> >
> >> +
> >> + memset (best_clock, 0, sizeof (*best_clock));
> >> + max_n = limit->n.max;
> >> + /* based on hardware requriment prefer smaller n to precision */
> >> + for (clock.n = limit->n.min; clock.n <= max_n; clock.n++) {
> >> + /* based on hardware requirment prefere larger m1,m2, p1 */
> >> + for (clock.m1 = limit->m1.max;
> >> + clock.m1 >= limit->m1.min; clock.m1--) {
> >> + for (clock.m2 = limit->m2.max;
> >> + clock.m2 >= limit->m2.min; clock.m2--) {
> >> + for (clock.p1 = limit->p1.max;
> >> + clock.p1 >= limit->p1.min; clock.p1--) {
> >> + int this_err;
> >> +
> >> + intel_clock (refclk, &clock);
> >> + if (!intel_PLL_is_valid(crtc, &clock))
> >> + continue;
> >> + this_err = abs(clock.dot - target) ;
> >> + if (this_err < err_most) {
> >> + *best_clock = clock;
> >> + err_most = this_err;
> >> + /*chose smaller n*/
> >> + max_n = clock.n;
> >> + found = true;
> >>
> >
> > If we should prefer larger m1,m2,p1, why not exit the cycle here and return?
> > Here we still try to look for the smallest error for target but might not be preferred
> > largest m1,m2,p1?
> >
> precision override m1,m2,p1 ( if a smaller m1,m2,p1 can get even better
> precision, we go with smaller combination )
> N override precision ( if a bigger N can get even better precision in
> the math, we still go with smaller N )
>
ok, could we have some comments for this reason? Thanks.
> > And is it possible if no clock can be found that meets the error precision of target?
> > Should we guard for that case?
> >
> > And how about your test result on g4x with KMS?
> >
> >
>
>
--
Open Source Technology Center, Intel ltd.
$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20090312/4c70e70a/attachment.sig>
More information about the Intel-gfx
mailing list