提交 c3450239 编写于 作者: B Ben Skeggs

drm/nouveau/pm: store voltage in microvolts

Instead of 10s of millivolts, to match fermi vbios.
Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
上级 b6fd41e2
...@@ -414,8 +414,8 @@ struct nouveau_gpio_engine { ...@@ -414,8 +414,8 @@ struct nouveau_gpio_engine {
}; };
struct nouveau_pm_voltage_level { struct nouveau_pm_voltage_level {
u8 voltage; u32 voltage; /* microvolts */
u8 vid; u8 vid;
}; };
struct nouveau_pm_voltage { struct nouveau_pm_voltage {
...@@ -451,8 +451,8 @@ struct nouveau_pm_level { ...@@ -451,8 +451,8 @@ struct nouveau_pm_level {
u32 unk05; u32 unk05;
u32 unk0a; u32 unk0a;
u8 voltage; u32 voltage; /* microvolts */
u8 fanspeed; u8 fanspeed;
u16 memscript; u16 memscript;
struct nouveau_pm_memtiming *timing; struct nouveau_pm_memtiming *timing;
......
...@@ -203,7 +203,8 @@ nouveau_perf_init(struct drm_device *dev) ...@@ -203,7 +203,8 @@ nouveau_perf_init(struct drm_device *dev)
case 0x13: case 0x13:
case 0x15: case 0x15:
perflvl->fanspeed = entry[55]; perflvl->fanspeed = entry[55];
perflvl->voltage = (recordlen > 56) ? entry[56] : 0; if (recordlen > 56)
perflvl->voltage = entry[56] * 10000;
perflvl->core = ROM32(entry[1]) * 10; perflvl->core = ROM32(entry[1]) * 10;
perflvl->memory = ROM32(entry[5]) * 20; perflvl->memory = ROM32(entry[5]) * 20;
break; break;
...@@ -211,7 +212,7 @@ nouveau_perf_init(struct drm_device *dev) ...@@ -211,7 +212,7 @@ nouveau_perf_init(struct drm_device *dev)
case 0x23: case 0x23:
case 0x24: case 0x24:
perflvl->fanspeed = entry[4]; perflvl->fanspeed = entry[4];
perflvl->voltage = entry[5]; perflvl->voltage = entry[5] * 10000;
perflvl->core = ROM16(entry[6]) * 1000; perflvl->core = ROM16(entry[6]) * 1000;
if (dev_priv->chipset == 0x49 || if (dev_priv->chipset == 0x49 ||
...@@ -223,7 +224,7 @@ nouveau_perf_init(struct drm_device *dev) ...@@ -223,7 +224,7 @@ nouveau_perf_init(struct drm_device *dev)
break; break;
case 0x25: case 0x25:
perflvl->fanspeed = entry[4]; perflvl->fanspeed = entry[4];
perflvl->voltage = entry[5]; perflvl->voltage = entry[5] * 10000;
perflvl->core = ROM16(entry[6]) * 1000; perflvl->core = ROM16(entry[6]) * 1000;
perflvl->shader = ROM16(entry[10]) * 1000; perflvl->shader = ROM16(entry[10]) * 1000;
perflvl->memory = ROM16(entry[12]) * 1000; perflvl->memory = ROM16(entry[12]) * 1000;
...@@ -232,7 +233,7 @@ nouveau_perf_init(struct drm_device *dev) ...@@ -232,7 +233,7 @@ nouveau_perf_init(struct drm_device *dev)
perflvl->memscript = ROM16(entry[2]); perflvl->memscript = ROM16(entry[2]);
case 0x35: case 0x35:
perflvl->fanspeed = entry[6]; perflvl->fanspeed = entry[6];
perflvl->voltage = entry[7]; perflvl->voltage = entry[7] * 10000;
perflvl->core = ROM16(entry[8]) * 1000; perflvl->core = ROM16(entry[8]) * 1000;
perflvl->shader = ROM16(entry[10]) * 1000; perflvl->shader = ROM16(entry[10]) * 1000;
perflvl->memory = ROM16(entry[12]) * 1000; perflvl->memory = ROM16(entry[12]) * 1000;
...@@ -242,7 +243,7 @@ nouveau_perf_init(struct drm_device *dev) ...@@ -242,7 +243,7 @@ nouveau_perf_init(struct drm_device *dev)
case 0x40: case 0x40:
#define subent(n) entry[perf[2] + ((n) * perf[3])] #define subent(n) entry[perf[2] + ((n) * perf[3])]
perflvl->fanspeed = 0; /*XXX*/ perflvl->fanspeed = 0; /*XXX*/
perflvl->voltage = entry[2]; perflvl->voltage = entry[2] * 10000;
if (dev_priv->card_type == NV_50) { if (dev_priv->card_type == NV_50) {
perflvl->core = ROM16(subent(0)) & 0xfff; perflvl->core = ROM16(subent(0)) & 0xfff;
perflvl->shader = ROM16(subent(1)) & 0xfff; perflvl->shader = ROM16(subent(1)) & 0xfff;
......
...@@ -168,7 +168,7 @@ nouveau_pm_perflvl_info(struct nouveau_pm_level *perflvl, char *ptr, int len) ...@@ -168,7 +168,7 @@ nouveau_pm_perflvl_info(struct nouveau_pm_level *perflvl, char *ptr, int len)
v[0] = '\0'; v[0] = '\0';
if (perflvl->voltage) if (perflvl->voltage)
snprintf(v, sizeof(v), " voltage %dmV", perflvl->voltage * 10); snprintf(v, sizeof(v), " voltage %dmV", perflvl->voltage / 1000);
f[0] = '\0'; f[0] = '\0';
if (perflvl->fanspeed) if (perflvl->fanspeed)
......
...@@ -203,7 +203,7 @@ nouveau_volt_init(struct drm_device *dev) ...@@ -203,7 +203,7 @@ nouveau_volt_init(struct drm_device *dev)
entry = volt + headerlen; entry = volt + headerlen;
for (i = 0; i < entries; i++, entry += recordlen) { for (i = 0; i < entries; i++, entry += recordlen) {
voltage->level[i].voltage = entry[0]; voltage->level[i].voltage = entry[0] * 10000;
voltage->level[i].vid = entry[1] >> vidshift; voltage->level[i].vid = entry[1] >> vidshift;
} }
voltage->nr_level = entries; voltage->nr_level = entries;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册