Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 105520
b: refs/heads/master
c: 6280fd4
h: refs/heads/master
v: v3
  • Loading branch information
Krzysztof Helt authored and Linus Torvalds committed Jul 24, 2008
1 parent 8b3cc4c commit 5c801b2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f330c4b1961d730ef15ac184e4b7f1c25847d0ae
refs/heads/master: 6280fd4f9c2683a4d2f096320dd74ded4e5106ad
9 changes: 5 additions & 4 deletions trunk/drivers/video/tridentfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -672,15 +672,16 @@ static void set_vclk(struct tridentfb_par *par, unsigned long freq)
unsigned long fi, d, di;
unsigned char best_m = 0, best_n = 0, best_k = 0;
unsigned char hi, lo;
unsigned char shift = !is_oldclock(par->chip_id) ? 2 : 1;

d = 20000;
for (k = 1; k >= 0; k--)
for (m = 0; m < 32; m++) {
n = 2 * (m + 2) - 8;
for (k = shift; k >= 0; k--)
for (m = 1; m < 32; m++) {
n = ((m + 2) << shift) - 8;
for (n = (n < 0 ? 0 : n); n < 122; n++) {
fi = ((14318l * (n + 8)) / (m + 2)) >> k;
di = abs(fi - freq);
if (di <= d) {
if (di < d || (di == d && k == best_k)) {
d = di;
best_n = n;
best_m = m;
Expand Down

0 comments on commit 5c801b2

Please sign in to comment.