Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
3b5565dd
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
3b5565dd
编写于
6月 09, 2011
作者:
B
Ben Skeggs
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/nouveau/pm: add support for parsing perflvl voltage on fermi chips
Signed-off-by:
N
Ben Skeggs
<
bskeggs@redhat.com
>
上级
a31214ef
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
69 addition
and
16 deletion
+69
-16
drivers/gpu/drm/nouveau/nouveau_drv.h
drivers/gpu/drm/nouveau/nouveau_drv.h
+2
-1
drivers/gpu/drm/nouveau/nouveau_perf.c
drivers/gpu/drm/nouveau/nouveau_perf.c
+51
-7
drivers/gpu/drm/nouveau/nouveau_pm.c
drivers/gpu/drm/nouveau/nouveau_pm.c
+16
-8
未找到文件。
drivers/gpu/drm/nouveau/nouveau_drv.h
浏览文件 @
3b5565dd
...
...
@@ -451,7 +451,8 @@ struct nouveau_pm_level {
u32
unk05
;
u32
unk0a
;
u32
voltage
;
/* microvolts */
u32
volt_min
;
/* microvolts */
u32
volt_max
;
u8
fanspeed
;
u16
memscript
;
...
...
drivers/gpu/drm/nouveau/nouveau_perf.c
浏览文件 @
3b5565dd
...
...
@@ -134,6 +134,49 @@ nouveau_perf_timing(struct drm_device *dev, struct bit_entry *P,
return
&
pm
->
memtimings
.
timing
[
entry
[
1
]];
}
static
void
nouveau_perf_voltage
(
struct
drm_device
*
dev
,
struct
bit_entry
*
P
,
struct
nouveau_pm_level
*
perflvl
)
{
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
struct
nvbios
*
bios
=
&
dev_priv
->
vbios
;
u8
*
vmap
;
int
id
;
id
=
perflvl
->
volt_min
;
perflvl
->
volt_min
=
0
;
/* pre-fermi vbios stores the voltage level directly in the
* perflvl entry as a multiple of 10mV
*/
if
(
dev_priv
->
card_type
<
NV_C0
)
{
perflvl
->
volt_min
=
id
*
10000
;
perflvl
->
volt_max
=
perflvl
->
volt_min
;
return
;
}
/* from fermi onwards, the perflvl stores an index into yet another
* vbios table containing a min/max voltage value for the perflvl
*/
if
(
P
->
version
!=
2
||
P
->
length
<
34
)
{
NV_DEBUG
(
dev
,
"where's our volt map table ptr? %d %d
\n
"
,
P
->
version
,
P
->
length
);
return
;
}
vmap
=
ROMPTR
(
bios
,
P
->
data
[
32
]);
if
(
!
vmap
)
{
NV_DEBUG
(
dev
,
"volt map table pointer invalid
\n
"
);
return
;
}
if
(
id
<
vmap
[
3
])
{
vmap
+=
vmap
[
1
]
+
(
vmap
[
2
]
*
id
);
perflvl
->
volt_min
=
ROM32
(
vmap
[
0
]);
perflvl
->
volt_max
=
ROM32
(
vmap
[
4
]);
}
}
void
nouveau_perf_init
(
struct
drm_device
*
dev
)
{
...
...
@@ -204,7 +247,7 @@ nouveau_perf_init(struct drm_device *dev)
case
0x15
:
perflvl
->
fanspeed
=
entry
[
55
];
if
(
recordlen
>
56
)
perflvl
->
volt
age
=
entry
[
56
]
*
10000
;
perflvl
->
volt
_min
=
entry
[
56
]
;
perflvl
->
core
=
ROM32
(
entry
[
1
])
*
10
;
perflvl
->
memory
=
ROM32
(
entry
[
5
])
*
20
;
break
;
...
...
@@ -212,7 +255,7 @@ nouveau_perf_init(struct drm_device *dev)
case
0x23
:
case
0x24
:
perflvl
->
fanspeed
=
entry
[
4
];
perflvl
->
volt
age
=
entry
[
5
]
*
10000
;
perflvl
->
volt
_min
=
entry
[
5
]
;
perflvl
->
core
=
ROM16
(
entry
[
6
])
*
1000
;
if
(
dev_priv
->
chipset
==
0x49
||
...
...
@@ -224,7 +267,7 @@ nouveau_perf_init(struct drm_device *dev)
break
;
case
0x25
:
perflvl
->
fanspeed
=
entry
[
4
];
perflvl
->
volt
age
=
entry
[
5
]
*
10000
;
perflvl
->
volt
_min
=
entry
[
5
]
;
perflvl
->
core
=
ROM16
(
entry
[
6
])
*
1000
;
perflvl
->
shader
=
ROM16
(
entry
[
10
])
*
1000
;
perflvl
->
memory
=
ROM16
(
entry
[
12
])
*
1000
;
...
...
@@ -233,7 +276,7 @@ nouveau_perf_init(struct drm_device *dev)
perflvl
->
memscript
=
ROM16
(
entry
[
2
]);
case
0x35
:
perflvl
->
fanspeed
=
entry
[
6
];
perflvl
->
volt
age
=
entry
[
7
]
*
10000
;
perflvl
->
volt
_min
=
entry
[
7
]
;
perflvl
->
core
=
ROM16
(
entry
[
8
])
*
1000
;
perflvl
->
shader
=
ROM16
(
entry
[
10
])
*
1000
;
perflvl
->
memory
=
ROM16
(
entry
[
12
])
*
1000
;
...
...
@@ -243,7 +286,7 @@ nouveau_perf_init(struct drm_device *dev)
case
0x40
:
#define subent(n) entry[perf[2] + ((n) * perf[3])]
perflvl
->
fanspeed
=
0
;
/*XXX*/
perflvl
->
volt
age
=
entry
[
2
]
*
10000
;
perflvl
->
volt
_min
=
entry
[
2
]
;
if
(
dev_priv
->
card_type
==
NV_50
)
{
perflvl
->
core
=
ROM16
(
subent
(
0
))
&
0xfff
;
perflvl
->
shader
=
ROM16
(
subent
(
1
))
&
0xfff
;
...
...
@@ -263,8 +306,9 @@ nouveau_perf_init(struct drm_device *dev)
}
/* make sure vid is valid */
if
(
pm
->
voltage
.
supported
&&
perflvl
->
voltage
)
{
vid
=
nouveau_volt_vid_lookup
(
dev
,
perflvl
->
voltage
);
nouveau_perf_voltage
(
dev
,
&
P
,
perflvl
);
if
(
pm
->
voltage
.
supported
&&
perflvl
->
volt_min
)
{
vid
=
nouveau_volt_vid_lookup
(
dev
,
perflvl
->
volt_min
);
if
(
vid
<
0
)
{
NV_DEBUG
(
dev
,
"drop perflvl %d, bad vid
\n
"
,
i
);
entry
+=
recordlen
;
...
...
drivers/gpu/drm/nouveau/nouveau_pm.c
浏览文件 @
3b5565dd
...
...
@@ -64,11 +64,11 @@ nouveau_pm_perflvl_set(struct drm_device *dev, struct nouveau_pm_level *perflvl)
if
(
perflvl
==
pm
->
cur
)
return
0
;
if
(
pm
->
voltage
.
supported
&&
pm
->
voltage_set
&&
perflvl
->
volt
age
)
{
ret
=
pm
->
voltage_set
(
dev
,
perflvl
->
volt
age
);
if
(
pm
->
voltage
.
supported
&&
pm
->
voltage_set
&&
perflvl
->
volt
_min
)
{
ret
=
pm
->
voltage_set
(
dev
,
perflvl
->
volt
_min
);
if
(
ret
)
{
NV_ERROR
(
dev
,
"voltage_set %d failed: %d
\n
"
,
perflvl
->
volt
age
,
ret
);
perflvl
->
volt
_min
,
ret
);
}
}
...
...
@@ -146,8 +146,10 @@ nouveau_pm_perflvl_get(struct drm_device *dev, struct nouveau_pm_level *perflvl)
if
(
pm
->
voltage
.
supported
&&
pm
->
voltage_get
)
{
ret
=
pm
->
voltage_get
(
dev
);
if
(
ret
>
0
)
perflvl
->
voltage
=
ret
;
if
(
ret
>
0
)
{
perflvl
->
volt_min
=
ret
;
perflvl
->
volt_max
=
ret
;
}
}
return
0
;
...
...
@@ -156,7 +158,7 @@ nouveau_pm_perflvl_get(struct drm_device *dev, struct nouveau_pm_level *perflvl)
static
void
nouveau_pm_perflvl_info
(
struct
nouveau_pm_level
*
perflvl
,
char
*
ptr
,
int
len
)
{
char
c
[
16
],
s
[
16
],
v
[
16
],
f
[
16
],
t
[
16
];
char
c
[
16
],
s
[
16
],
v
[
32
],
f
[
16
],
t
[
16
];
c
[
0
]
=
'\0'
;
if
(
perflvl
->
core
)
...
...
@@ -167,8 +169,14 @@ nouveau_pm_perflvl_info(struct nouveau_pm_level *perflvl, char *ptr, int len)
snprintf
(
s
,
sizeof
(
s
),
" shader %dMHz"
,
perflvl
->
shader
/
1000
);
v
[
0
]
=
'\0'
;
if
(
perflvl
->
voltage
)
snprintf
(
v
,
sizeof
(
v
),
" voltage %dmV"
,
perflvl
->
voltage
/
1000
);
if
(
perflvl
->
volt_min
&&
perflvl
->
volt_min
!=
perflvl
->
volt_max
)
{
snprintf
(
v
,
sizeof
(
v
),
" voltage %dmV-%dmV"
,
perflvl
->
volt_min
/
1000
,
perflvl
->
volt_max
/
1000
);
}
else
if
(
perflvl
->
volt_min
)
{
snprintf
(
v
,
sizeof
(
v
),
" voltage %dmV"
,
perflvl
->
volt_min
/
1000
);
}
f
[
0
]
=
'\0'
;
if
(
perflvl
->
fanspeed
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录