Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Linux-御风守护者
linux
提交
8cd36682
L
linux
项目概览
Linux-御风守护者
/
linux
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
8cd36682
编写于
8月 23, 2013
作者:
A
Alex Deucher
提交者:
Christian König
2月 18, 2014
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/radeon: add vce dpm support for CI
Signed-off-by:
N
Alex Deucher
<
alexander.deucher@amd.com
>
上级
5ad6bf91
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
40 addition
and
10 deletion
+40
-10
drivers/gpu/drm/radeon/ci_dpm.c
drivers/gpu/drm/radeon/ci_dpm.c
+40
-10
未找到文件。
drivers/gpu/drm/radeon/ci_dpm.c
浏览文件 @
8cd36682
...
@@ -746,6 +746,14 @@ static void ci_apply_state_adjust_rules(struct radeon_device *rdev,
...
@@ -746,6 +746,14 @@ static void ci_apply_state_adjust_rules(struct radeon_device *rdev,
u32
max_sclk_vddc
,
max_mclk_vddci
,
max_mclk_vddc
;
u32
max_sclk_vddc
,
max_mclk_vddci
,
max_mclk_vddc
;
int
i
;
int
i
;
if
(
rps
->
vce_active
)
{
rps
->
evclk
=
rdev
->
pm
.
dpm
.
vce_states
[
rdev
->
pm
.
dpm
.
vce_level
].
evclk
;
rps
->
ecclk
=
rdev
->
pm
.
dpm
.
vce_states
[
rdev
->
pm
.
dpm
.
vce_level
].
ecclk
;
}
else
{
rps
->
evclk
=
0
;
rps
->
ecclk
=
0
;
}
if
((
rdev
->
pm
.
dpm
.
new_active_crtc_count
>
1
)
||
if
((
rdev
->
pm
.
dpm
.
new_active_crtc_count
>
1
)
||
ci_dpm_vblank_too_short
(
rdev
))
ci_dpm_vblank_too_short
(
rdev
))
disable_mclk_switching
=
true
;
disable_mclk_switching
=
true
;
...
@@ -804,6 +812,13 @@ static void ci_apply_state_adjust_rules(struct radeon_device *rdev,
...
@@ -804,6 +812,13 @@ static void ci_apply_state_adjust_rules(struct radeon_device *rdev,
sclk
=
ps
->
performance_levels
[
0
].
sclk
;
sclk
=
ps
->
performance_levels
[
0
].
sclk
;
}
}
if
(
rps
->
vce_active
)
{
if
(
sclk
<
rdev
->
pm
.
dpm
.
vce_states
[
rdev
->
pm
.
dpm
.
vce_level
].
sclk
)
sclk
=
rdev
->
pm
.
dpm
.
vce_states
[
rdev
->
pm
.
dpm
.
vce_level
].
sclk
;
if
(
mclk
<
rdev
->
pm
.
dpm
.
vce_states
[
rdev
->
pm
.
dpm
.
vce_level
].
mclk
)
mclk
=
rdev
->
pm
.
dpm
.
vce_states
[
rdev
->
pm
.
dpm
.
vce_level
].
mclk
;
}
ps
->
performance_levels
[
0
].
sclk
=
sclk
;
ps
->
performance_levels
[
0
].
sclk
=
sclk
;
ps
->
performance_levels
[
0
].
mclk
=
mclk
;
ps
->
performance_levels
[
0
].
mclk
=
mclk
;
...
@@ -3468,7 +3483,6 @@ static int ci_enable_uvd_dpm(struct radeon_device *rdev, bool enable)
...
@@ -3468,7 +3483,6 @@ static int ci_enable_uvd_dpm(struct radeon_device *rdev, bool enable)
0
:
-
EINVAL
;
0
:
-
EINVAL
;
}
}
#if 0
static
int
ci_enable_vce_dpm
(
struct
radeon_device
*
rdev
,
bool
enable
)
static
int
ci_enable_vce_dpm
(
struct
radeon_device
*
rdev
,
bool
enable
)
{
{
struct
ci_power_info
*
pi
=
ci_get_pi
(
rdev
);
struct
ci_power_info
*
pi
=
ci_get_pi
(
rdev
);
...
@@ -3501,6 +3515,7 @@ static int ci_enable_vce_dpm(struct radeon_device *rdev, bool enable)
...
@@ -3501,6 +3515,7 @@ static int ci_enable_vce_dpm(struct radeon_device *rdev, bool enable)
0
:
-
EINVAL
;
0
:
-
EINVAL
;
}
}
#if 0
static int ci_enable_samu_dpm(struct radeon_device *rdev, bool enable)
static int ci_enable_samu_dpm(struct radeon_device *rdev, bool enable)
{
{
struct ci_power_info *pi = ci_get_pi(rdev);
struct ci_power_info *pi = ci_get_pi(rdev);
...
@@ -3587,7 +3602,6 @@ static int ci_update_uvd_dpm(struct radeon_device *rdev, bool gate)
...
@@ -3587,7 +3602,6 @@ static int ci_update_uvd_dpm(struct radeon_device *rdev, bool gate)
return
ci_enable_uvd_dpm
(
rdev
,
!
gate
);
return
ci_enable_uvd_dpm
(
rdev
,
!
gate
);
}
}
#if 0
static
u8
ci_get_vce_boot_level
(
struct
radeon_device
*
rdev
)
static
u8
ci_get_vce_boot_level
(
struct
radeon_device
*
rdev
)
{
{
u8
i
;
u8
i
;
...
@@ -3608,13 +3622,11 @@ static int ci_update_vce_dpm(struct radeon_device *rdev,
...
@@ -3608,13 +3622,11 @@ static int ci_update_vce_dpm(struct radeon_device *rdev,
struct
radeon_ps
*
radeon_current_state
)
struct
radeon_ps
*
radeon_current_state
)
{
{
struct
ci_power_info
*
pi
=
ci_get_pi
(
rdev
);
struct
ci_power_info
*
pi
=
ci_get_pi
(
rdev
);
bool new_vce_clock_non_zero = (radeon_new_state->evclk != 0);
bool old_vce_clock_non_zero = (radeon_current_state->evclk != 0);
int
ret
=
0
;
int
ret
=
0
;
u32
tmp
;
u32
tmp
;
if (
new_vce_clock_non_zero != old_vce_clock_non_zero
) {
if
(
radeon_current_state
->
evclk
!=
radeon_new_state
->
evclk
)
{
if (
new_vce_clock_non_zero
) {
if
(
radeon_new_state
->
evclk
)
{
pi
->
smc_state_table
.
VceBootLevel
=
ci_get_vce_boot_level
(
rdev
);
pi
->
smc_state_table
.
VceBootLevel
=
ci_get_vce_boot_level
(
rdev
);
tmp
=
RREG32_SMC
(
DPM_TABLE_475
);
tmp
=
RREG32_SMC
(
DPM_TABLE_475
);
...
@@ -3630,6 +3642,7 @@ static int ci_update_vce_dpm(struct radeon_device *rdev,
...
@@ -3630,6 +3642,7 @@ static int ci_update_vce_dpm(struct radeon_device *rdev,
return
ret
;
return
ret
;
}
}
#if 0
static int ci_update_samu_dpm(struct radeon_device *rdev, bool gate)
static int ci_update_samu_dpm(struct radeon_device *rdev, bool gate)
{
{
return ci_enable_samu_dpm(rdev, gate);
return ci_enable_samu_dpm(rdev, gate);
...
@@ -4752,13 +4765,13 @@ int ci_dpm_set_power_state(struct radeon_device *rdev)
...
@@ -4752,13 +4765,13 @@ int ci_dpm_set_power_state(struct radeon_device *rdev)
DRM_ERROR
(
"ci_generate_dpm_level_enable_mask failed
\n
"
);
DRM_ERROR
(
"ci_generate_dpm_level_enable_mask failed
\n
"
);
return
ret
;
return
ret
;
}
}
#if 0
ret
=
ci_update_vce_dpm
(
rdev
,
new_ps
,
old_ps
);
ret
=
ci_update_vce_dpm
(
rdev
,
new_ps
,
old_ps
);
if
(
ret
)
{
if
(
ret
)
{
DRM_ERROR
(
"ci_update_vce_dpm failed
\n
"
);
DRM_ERROR
(
"ci_update_vce_dpm failed
\n
"
);
return
ret
;
return
ret
;
}
}
#endif
ret
=
ci_update_sclk_t
(
rdev
);
ret
=
ci_update_sclk_t
(
rdev
);
if
(
ret
)
{
if
(
ret
)
{
DRM_ERROR
(
"ci_update_sclk_t failed
\n
"
);
DRM_ERROR
(
"ci_update_sclk_t failed
\n
"
);
...
@@ -4995,6 +5008,21 @@ static int ci_parse_power_table(struct radeon_device *rdev)
...
@@ -4995,6 +5008,21 @@ static int ci_parse_power_table(struct radeon_device *rdev)
power_state_offset
+=
2
+
power_state
->
v2
.
ucNumDPMLevels
;
power_state_offset
+=
2
+
power_state
->
v2
.
ucNumDPMLevels
;
}
}
rdev
->
pm
.
dpm
.
num_ps
=
state_array
->
ucNumEntries
;
rdev
->
pm
.
dpm
.
num_ps
=
state_array
->
ucNumEntries
;
/* fill in the vce power states */
for
(
i
=
0
;
i
<
RADEON_MAX_VCE_LEVELS
;
i
++
)
{
u32
sclk
,
mclk
;
clock_array_index
=
rdev
->
pm
.
dpm
.
vce_states
[
i
].
clk_idx
;
clock_info
=
(
union
pplib_clock_info
*
)
&
clock_info_array
->
clockInfo
[
clock_array_index
*
clock_info_array
->
ucEntrySize
];
sclk
=
le16_to_cpu
(
clock_info
->
ci
.
usEngineClockLow
);
sclk
|=
clock_info
->
ci
.
ucEngineClockHigh
<<
16
;
mclk
=
le16_to_cpu
(
clock_info
->
ci
.
usMemoryClockLow
);
mclk
|=
clock_info
->
ci
.
ucMemoryClockHigh
<<
16
;
rdev
->
pm
.
dpm
.
vce_states
[
i
].
sclk
=
sclk
;
rdev
->
pm
.
dpm
.
vce_states
[
i
].
mclk
=
mclk
;
}
return
0
;
return
0
;
}
}
...
@@ -5080,12 +5108,14 @@ int ci_dpm_init(struct radeon_device *rdev)
...
@@ -5080,12 +5108,14 @@ int ci_dpm_init(struct radeon_device *rdev)
ci_dpm_fini
(
rdev
);
ci_dpm_fini
(
rdev
);
return
ret
;
return
ret
;
}
}
ret
=
ci_parse_power_table
(
rdev
);
ret
=
r600_parse_extended_power_table
(
rdev
);
if
(
ret
)
{
if
(
ret
)
{
ci_dpm_fini
(
rdev
);
ci_dpm_fini
(
rdev
);
return
ret
;
return
ret
;
}
}
ret
=
r600_parse_extended_power_table
(
rdev
);
ret
=
ci_parse_power_table
(
rdev
);
if
(
ret
)
{
if
(
ret
)
{
ci_dpm_fini
(
rdev
);
ci_dpm_fini
(
rdev
);
return
ret
;
return
ret
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录