Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
b9fa1883
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
b9fa1883
编写于
9月 05, 2013
作者:
A
Alex Deucher
提交者:
Christian König
2月 18, 2014
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/radeon: add support for vce 2.0 clock gating
Signed-off-by:
N
Alex Deucher
<
alexander.deucher@amd.com
>
上级
44493ba9
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
121 addition
and
0 deletion
+121
-0
drivers/gpu/drm/radeon/cikd.h
drivers/gpu/drm/radeon/cikd.h
+10
-0
drivers/gpu/drm/radeon/vce_v2_0.c
drivers/gpu/drm/radeon/vce_v2_0.c
+111
-0
未找到文件。
drivers/gpu/drm/radeon/cikd.h
浏览文件 @
b9fa1883
...
...
@@ -2029,8 +2029,18 @@
#define VCE_RB_RPTR 0x2018c
#define VCE_RB_WPTR 0x20190
#define VCE_CLOCK_GATING_A 0x202f8
# define CGC_CLK_GATE_DLY_TIMER_MASK (0xf << 0)
# define CGC_CLK_GATE_DLY_TIMER(x) ((x) << 0)
# define CGC_CLK_GATER_OFF_DLY_TIMER_MASK (0xff << 4)
# define CGC_CLK_GATER_OFF_DLY_TIMER(x) ((x) << 4)
# define CGC_UENC_WAIT_AWAKE (1 << 18)
#define VCE_CLOCK_GATING_B 0x202fc
#define VCE_CGTT_CLK_OVERRIDE 0x207a0
#define VCE_UENC_CLOCK_GATING 0x207bc
# define CLOCK_ON_DELAY_MASK (0xf << 0)
# define CLOCK_ON_DELAY(x) ((x) << 0)
# define CLOCK_OFF_DELAY_MASK (0xff << 4)
# define CLOCK_OFF_DELAY(x) ((x) << 4)
#define VCE_UENC_REG_CLOCK_GATING 0x207c0
#define VCE_SYS_INT_EN 0x21300
# define VCE_SYS_INT_TRAP_INTERRUPT_EN (1 << 3)
...
...
drivers/gpu/drm/radeon/vce_v2_0.c
浏览文件 @
b9fa1883
...
...
@@ -31,6 +31,115 @@
#include "radeon_asic.h"
#include "cikd.h"
static
void
vce_v2_0_set_sw_cg
(
struct
radeon_device
*
rdev
,
bool
gated
)
{
u32
tmp
;
if
(
gated
)
{
tmp
=
RREG32
(
VCE_CLOCK_GATING_B
);
tmp
|=
0xe70000
;
WREG32
(
VCE_CLOCK_GATING_B
,
tmp
);
tmp
=
RREG32
(
VCE_UENC_CLOCK_GATING
);
tmp
|=
0xff000000
;
WREG32
(
VCE_UENC_CLOCK_GATING
,
tmp
);
tmp
=
RREG32
(
VCE_UENC_REG_CLOCK_GATING
);
tmp
&=
~
0x3fc
;
WREG32
(
VCE_UENC_REG_CLOCK_GATING
,
tmp
);
WREG32
(
VCE_CGTT_CLK_OVERRIDE
,
0
);
}
else
{
tmp
=
RREG32
(
VCE_CLOCK_GATING_B
);
tmp
|=
0xe7
;
tmp
&=
~
0xe70000
;
WREG32
(
VCE_CLOCK_GATING_B
,
tmp
);
tmp
=
RREG32
(
VCE_UENC_CLOCK_GATING
);
tmp
|=
0x1fe000
;
tmp
&=
~
0xff000000
;
WREG32
(
VCE_UENC_CLOCK_GATING
,
tmp
);
tmp
=
RREG32
(
VCE_UENC_REG_CLOCK_GATING
);
tmp
|=
0x3fc
;
WREG32
(
VCE_UENC_REG_CLOCK_GATING
,
tmp
);
}
}
static
void
vce_v2_0_set_dyn_cg
(
struct
radeon_device
*
rdev
,
bool
gated
)
{
u32
orig
,
tmp
;
tmp
=
RREG32
(
VCE_CLOCK_GATING_B
);
tmp
&=
~
0x00060006
;
if
(
gated
)
{
tmp
|=
0xe10000
;
}
else
{
tmp
|=
0xe1
;
tmp
&=
~
0xe10000
;
}
WREG32
(
VCE_CLOCK_GATING_B
,
tmp
);
orig
=
tmp
=
RREG32
(
VCE_UENC_CLOCK_GATING
);
tmp
&=
~
0x1fe000
;
tmp
&=
~
0xff000000
;
if
(
tmp
!=
orig
)
WREG32
(
VCE_UENC_CLOCK_GATING
,
tmp
);
orig
=
tmp
=
RREG32
(
VCE_UENC_REG_CLOCK_GATING
);
tmp
&=
~
0x3fc
;
if
(
tmp
!=
orig
)
WREG32
(
VCE_UENC_REG_CLOCK_GATING
,
tmp
);
if
(
gated
)
WREG32
(
VCE_CGTT_CLK_OVERRIDE
,
0
);
}
static
void
vce_v2_0_disable_cg
(
struct
radeon_device
*
rdev
)
{
WREG32
(
VCE_CGTT_CLK_OVERRIDE
,
7
);
}
void
vce_v2_0_enable_mgcg
(
struct
radeon_device
*
rdev
,
bool
enable
)
{
bool
sw_cg
=
false
;
if
(
enable
&&
(
rdev
->
cg_flags
&
RADEON_CG_SUPPORT_VCE_MGCG
))
{
if
(
sw_cg
)
vce_v2_0_set_sw_cg
(
rdev
,
true
);
else
vce_v2_0_set_dyn_cg
(
rdev
,
true
);
}
else
{
vce_v2_0_disable_cg
(
rdev
);
if
(
sw_cg
)
vce_v2_0_set_sw_cg
(
rdev
,
false
);
else
vce_v2_0_set_dyn_cg
(
rdev
,
false
);
}
}
static
void
vce_v2_0_init_cg
(
struct
radeon_device
*
rdev
)
{
u32
tmp
;
tmp
=
RREG32
(
VCE_CLOCK_GATING_A
);
tmp
&=
~
(
CGC_CLK_GATE_DLY_TIMER_MASK
|
CGC_CLK_GATER_OFF_DLY_TIMER_MASK
);
tmp
|=
(
CGC_CLK_GATE_DLY_TIMER
(
0
)
|
CGC_CLK_GATER_OFF_DLY_TIMER
(
4
));
tmp
|=
CGC_UENC_WAIT_AWAKE
;
WREG32
(
VCE_CLOCK_GATING_A
,
tmp
);
tmp
=
RREG32
(
VCE_UENC_CLOCK_GATING
);
tmp
&=
~
(
CLOCK_ON_DELAY_MASK
|
CLOCK_OFF_DELAY_MASK
);
tmp
|=
(
CLOCK_ON_DELAY
(
0
)
|
CLOCK_OFF_DELAY
(
4
));
WREG32
(
VCE_UENC_CLOCK_GATING
,
tmp
);
tmp
=
RREG32
(
VCE_CLOCK_GATING_B
);
tmp
|=
0x10
;
tmp
&=
~
0x100000
;
WREG32
(
VCE_CLOCK_GATING_B
,
tmp
);
}
int
vce_v2_0_resume
(
struct
radeon_device
*
rdev
)
{
uint64_t
addr
=
rdev
->
vce
.
gpu_addr
;
...
...
@@ -66,5 +175,7 @@ int vce_v2_0_resume(struct radeon_device *rdev)
WREG32_P
(
VCE_SYS_INT_EN
,
VCE_SYS_INT_TRAP_INTERRUPT_EN
,
~
VCE_SYS_INT_TRAP_INTERRUPT_EN
);
vce_v2_0_init_cg
(
rdev
);
return
0
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录