Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 218209
b: refs/heads/master
c: dc7339d
h: refs/heads/master
i:
  218207: af2ea05
v: v3
  • Loading branch information
Ben Skeggs committed Sep 24, 2010
1 parent 60d6efb commit 8bba889
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 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: e49f70f775335ab1ee0ecd54904d2b25982a2600
refs/heads/master: dc7339df11bc7a90268929e57e13a14951343cc3
9 changes: 6 additions & 3 deletions trunk/drivers/gpu/drm/nouveau/nouveau_volt.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ nouveau_volt_init(struct drm_device *dev)
struct nvbios *bios = &dev_priv->vbios;
struct bit_entry P;
u8 *volt = NULL, *entry;
int i, recordlen, entries, vidmask, vidshift;
int i, headerlen, recordlen, entries, vidmask, vidshift;

if (bios->type == NVBIOS_BIT) {
if (bit_table(dev, 'P', &P))
Expand Down Expand Up @@ -142,18 +142,21 @@ nouveau_volt_init(struct drm_device *dev)
case 0x10:
case 0x11:
case 0x12:
recordlen = 5;
headerlen = 5;
recordlen = volt[1];
entries = volt[2];
vidshift = 0;
vidmask = volt[4];
break;
case 0x20:
headerlen = volt[1];
recordlen = volt[3];
entries = volt[2];
vidshift = 0; /* could be vidshift like 0x30? */
vidmask = volt[5];
break;
case 0x30:
headerlen = volt[1];
recordlen = volt[2];
entries = volt[3];
vidshift = hweight8(volt[5]);
Expand Down Expand Up @@ -190,7 +193,7 @@ nouveau_volt_init(struct drm_device *dev)
if (!voltage->level)
return;

entry = volt + volt[1];
entry = volt + headerlen;
for (i = 0; i < entries; i++, entry += recordlen) {
voltage->level[i].voltage = entry[0];
voltage->level[i].vid = entry[1] >> vidshift;
Expand Down

0 comments on commit 8bba889

Please sign in to comment.