Lines 636-643
done:
Link Here
|
636 |
if (refresh_specified && db[i].refresh == refresh) { |
636 |
if (refresh_specified && db[i].refresh == refresh) { |
637 |
return 1; |
637 |
return 1; |
638 |
} else { |
638 |
} else { |
639 |
if (abs(db[i].refresh - refresh) < diff) { |
639 |
tdiff = (u32) abs(db[i].refresh - refresh); |
640 |
diff = abs(db[i].refresh - refresh); |
640 |
if (tdiff < diff) { |
|
|
641 |
diff = tdiff; |
641 |
best = i; |
642 |
best = i; |
642 |
} |
643 |
} |
643 |
} |
644 |
} |
Lines 654-661
done:
Link Here
|
654 |
for (i = 0; i < dbsize; i++) { |
655 |
for (i = 0; i < dbsize; i++) { |
655 |
DPRINTK("Trying %ix%i\n", db[i].xres, db[i].yres); |
656 |
DPRINTK("Trying %ix%i\n", db[i].xres, db[i].yres); |
656 |
if (!fb_try_mode(var, info, &db[i], bpp)) { |
657 |
if (!fb_try_mode(var, info, &db[i], bpp)) { |
657 |
tdiff = abs(db[i].xres - xres) + |
658 |
tdiff = (u32) (abs(db[i].xres - xres) + |
658 |
abs(db[i].yres - yres); |
659 |
abs(db[i].yres - yres)); |
659 |
|
660 |
|
660 |
/* |
661 |
/* |
661 |
* Penalize modes with resolutions smaller |
662 |
* Penalize modes with resolutions smaller |