Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
a1da205f
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 1 年 前同步成功
通知
158
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a1da205f
编写于
2月 01, 2012
作者:
B
Ben Skeggs
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/nvc0/pm: start filling in memory reclocking stubs
上级
19a1e477
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
116 addition
and
0 deletion
+116
-0
drivers/gpu/drm/nouveau/nvc0_pm.c
drivers/gpu/drm/nouveau/nvc0_pm.c
+116
-0
未找到文件。
drivers/gpu/drm/nouveau/nvc0_pm.c
浏览文件 @
a1da205f
...
@@ -164,6 +164,7 @@ struct nvc0_pm_clock {
...
@@ -164,6 +164,7 @@ struct nvc0_pm_clock {
};
};
struct
nvc0_pm_state
{
struct
nvc0_pm_state
{
struct
nouveau_pm_level
*
perflvl
;
struct
nvc0_pm_clock
eng
[
16
];
struct
nvc0_pm_clock
eng
[
16
];
};
};
...
@@ -335,6 +336,7 @@ nvc0_pm_clocks_pre(struct drm_device *dev, struct nouveau_pm_level *perflvl)
...
@@ -335,6 +336,7 @@ nvc0_pm_clocks_pre(struct drm_device *dev, struct nouveau_pm_level *perflvl)
return
ERR_PTR
(
ret
);
return
ERR_PTR
(
ret
);
}
}
info
->
perflvl
=
perflvl
;
return
info
;
return
info
;
}
}
...
@@ -375,12 +377,126 @@ prog_clk(struct drm_device *dev, int clk, struct nvc0_pm_clock *info)
...
@@ -375,12 +377,126 @@ prog_clk(struct drm_device *dev, int clk, struct nvc0_pm_clock *info)
nv_mask
(
dev
,
0x137250
+
(
clk
*
0x04
),
0x00003f3f
,
info
->
mdiv
);
nv_mask
(
dev
,
0x137250
+
(
clk
*
0x04
),
0x00003f3f
,
info
->
mdiv
);
}
}
static
void
mclk_precharge
(
struct
nouveau_mem_exec_func
*
exec
)
{
}
static
void
mclk_refresh
(
struct
nouveau_mem_exec_func
*
exec
)
{
}
static
void
mclk_refresh_auto
(
struct
nouveau_mem_exec_func
*
exec
,
bool
enable
)
{
nv_wr32
(
exec
->
dev
,
0x10f210
,
enable
?
0x80000000
:
0x00000000
);
}
static
void
mclk_refresh_self
(
struct
nouveau_mem_exec_func
*
exec
,
bool
enable
)
{
}
static
void
mclk_wait
(
struct
nouveau_mem_exec_func
*
exec
,
u32
nsec
)
{
udelay
((
nsec
+
500
)
/
1000
);
}
static
u32
mclk_mrg
(
struct
nouveau_mem_exec_func
*
exec
,
int
mr
)
{
struct
drm_device
*
dev
=
exec
->
dev
;
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
if
(
dev_priv
->
vram_type
!=
NV_MEM_TYPE_GDDR5
)
{
if
(
mr
<=
1
)
return
nv_rd32
(
dev
,
0x10f300
+
((
mr
-
0
)
*
4
));
return
nv_rd32
(
dev
,
0x10f320
+
((
mr
-
2
)
*
4
));
}
else
{
if
(
mr
==
0
)
return
nv_rd32
(
dev
,
0x10f300
+
(
mr
*
4
));
else
if
(
mr
<=
7
)
return
nv_rd32
(
dev
,
0x10f32c
+
(
mr
*
4
));
return
nv_rd32
(
dev
,
0x10f34c
);
}
}
static
void
mclk_mrs
(
struct
nouveau_mem_exec_func
*
exec
,
int
mr
,
u32
data
)
{
struct
drm_device
*
dev
=
exec
->
dev
;
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
if
(
dev_priv
->
vram_type
!=
NV_MEM_TYPE_GDDR5
)
{
if
(
mr
<=
1
)
{
nv_wr32
(
dev
,
0x10f300
+
((
mr
-
0
)
*
4
),
data
);
if
(
dev_priv
->
vram_rank_B
)
nv_wr32
(
dev
,
0x10f308
+
((
mr
-
0
)
*
4
),
data
);
}
else
if
(
mr
<=
3
)
{
nv_wr32
(
dev
,
0x10f320
+
((
mr
-
2
)
*
4
),
data
);
if
(
dev_priv
->
vram_rank_B
)
nv_wr32
(
dev
,
0x10f328
+
((
mr
-
2
)
*
4
),
data
);
}
}
else
{
if
(
mr
==
0
)
nv_wr32
(
dev
,
0x10f300
+
(
mr
*
4
),
data
);
else
if
(
mr
<=
7
)
nv_wr32
(
dev
,
0x10f32c
+
(
mr
*
4
),
data
);
else
if
(
mr
==
15
)
nv_wr32
(
dev
,
0x10f34c
,
data
);
}
}
static
void
mclk_clock_set
(
struct
nouveau_mem_exec_func
*
exec
)
{
}
static
void
mclk_timing_set
(
struct
nouveau_mem_exec_func
*
exec
)
{
struct
nvc0_pm_state
*
info
=
exec
->
priv
;
struct
nouveau_pm_level
*
perflvl
=
info
->
perflvl
;
int
i
;
for
(
i
=
0
;
i
<
5
;
i
++
)
nv_wr32
(
exec
->
dev
,
0x10f290
+
(
i
*
4
),
perflvl
->
timing
.
reg
[
i
]);
}
static
void
prog_mem
(
struct
drm_device
*
dev
,
struct
nvc0_pm_state
*
info
)
{
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
struct
nouveau_mem_exec_func
exec
=
{
.
dev
=
dev
,
.
precharge
=
mclk_precharge
,
.
refresh
=
mclk_refresh
,
.
refresh_auto
=
mclk_refresh_auto
,
.
refresh_self
=
mclk_refresh_self
,
.
wait
=
mclk_wait
,
.
mrg
=
mclk_mrg
,
.
mrs
=
mclk_mrs
,
.
clock_set
=
mclk_clock_set
,
.
timing_set
=
mclk_timing_set
,
.
priv
=
info
};
if
(
dev_priv
->
chipset
<
0xd0
)
nv_wr32
(
dev
,
0x611200
,
0x00003300
);
nouveau_mem_exec
(
&
exec
,
info
->
perflvl
);
if
(
dev_priv
->
chipset
<
0xd0
)
nv_wr32
(
dev
,
0x611200
,
0x00003300
);
}
int
int
nvc0_pm_clocks_set
(
struct
drm_device
*
dev
,
void
*
data
)
nvc0_pm_clocks_set
(
struct
drm_device
*
dev
,
void
*
data
)
{
{
struct
nvc0_pm_state
*
info
=
data
;
struct
nvc0_pm_state
*
info
=
data
;
int
i
;
int
i
;
if
(
0
)
prog_mem
(
dev
,
info
);
for
(
i
=
0
;
i
<
16
;
i
++
)
{
for
(
i
=
0
;
i
<
16
;
i
++
)
{
if
(
!
info
->
eng
[
i
].
freq
)
if
(
!
info
->
eng
[
i
].
freq
)
continue
;
continue
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录