Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
846e831d
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看板
提交
846e831d
编写于
8月 20, 2015
作者:
B
Ben Skeggs
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/nouveau/pm: switch to device pri macros
Signed-off-by:
N
Ben Skeggs
<
bskeggs@redhat.com
>
上级
f2d85ad1
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
40 addition
and
30 deletion
+40
-30
drivers/gpu/drm/nouveau/nvkm/engine/pm/base.c
drivers/gpu/drm/nouveau/nvkm/engine/pm/base.c
+4
-2
drivers/gpu/drm/nouveau/nvkm/engine/pm/gf100.c
drivers/gpu/drm/nouveau/nvkm/engine/pm/gf100.c
+24
-19
drivers/gpu/drm/nouveau/nvkm/engine/pm/nv40.c
drivers/gpu/drm/nouveau/nvkm/engine/pm/nv40.c
+12
-9
未找到文件。
drivers/gpu/drm/nouveau/nvkm/engine/pm/base.c
浏览文件 @
846e831d
...
...
@@ -126,6 +126,7 @@ nvkm_perfsrc_find(struct nvkm_pm *pm, struct nvkm_perfsig *sig, int si)
static
int
nvkm_perfsrc_enable
(
struct
nvkm_pm
*
pm
,
struct
nvkm_perfctr
*
ctr
)
{
struct
nvkm_device
*
device
=
pm
->
engine
.
subdev
.
device
;
struct
nvkm_perfdom
*
dom
=
NULL
;
struct
nvkm_perfsig
*
sig
;
struct
nvkm_perfsrc
*
src
;
...
...
@@ -151,7 +152,7 @@ nvkm_perfsrc_enable(struct nvkm_pm *pm, struct nvkm_perfctr *ctr)
value
|=
((
ctr
->
source
[
i
][
j
]
>>
32
)
<<
src
->
shift
);
/* enable the source */
nv
_mask
(
pm
,
src
->
addr
,
mask
,
value
);
nv
km_mask
(
device
,
src
->
addr
,
mask
,
value
);
nv_debug
(
pm
,
"enabled source 0x%08x 0x%08x 0x%08x
\n
"
,
src
->
addr
,
mask
,
value
);
}
...
...
@@ -162,6 +163,7 @@ nvkm_perfsrc_enable(struct nvkm_pm *pm, struct nvkm_perfctr *ctr)
static
int
nvkm_perfsrc_disable
(
struct
nvkm_pm
*
pm
,
struct
nvkm_perfctr
*
ctr
)
{
struct
nvkm_device
*
device
=
pm
->
engine
.
subdev
.
device
;
struct
nvkm_perfdom
*
dom
=
NULL
;
struct
nvkm_perfsig
*
sig
;
struct
nvkm_perfsrc
*
src
;
...
...
@@ -186,7 +188,7 @@ nvkm_perfsrc_disable(struct nvkm_pm *pm, struct nvkm_perfctr *ctr)
mask
|=
(
src
->
mask
<<
src
->
shift
);
/* disable the source */
nv
_mask
(
pm
,
src
->
addr
,
mask
,
0
);
nv
km_mask
(
device
,
src
->
addr
,
mask
,
0
);
nv_debug
(
pm
,
"disabled source 0x%08x 0x%08x
\n
"
,
src
->
addr
,
mask
);
}
...
...
drivers/gpu/drm/nouveau/nvkm/engine/pm/gf100.c
浏览文件 @
846e831d
...
...
@@ -128,6 +128,7 @@ static void
gf100_perfctr_init
(
struct
nvkm_pm
*
pm
,
struct
nvkm_perfdom
*
dom
,
struct
nvkm_perfctr
*
ctr
)
{
struct
nvkm_device
*
device
=
pm
->
engine
.
subdev
.
device
;
struct
gf100_pm_cntr
*
cntr
=
(
void
*
)
ctr
;
u32
log
=
ctr
->
logic_op
;
u32
src
=
0x00000000
;
...
...
@@ -136,32 +137,34 @@ gf100_perfctr_init(struct nvkm_pm *pm, struct nvkm_perfdom *dom,
for
(
i
=
0
;
i
<
4
;
i
++
)
src
|=
ctr
->
signal
[
i
]
<<
(
i
*
8
);
nv
_wr32
(
pm
,
dom
->
addr
+
0x09c
,
0x00040002
|
(
dom
->
mode
<<
3
));
nv
_wr32
(
pm
,
dom
->
addr
+
0x100
,
0x00000000
);
nv
_wr32
(
pm
,
dom
->
addr
+
0x040
+
(
cntr
->
base
.
slot
*
0x08
),
src
);
nv
_wr32
(
pm
,
dom
->
addr
+
0x044
+
(
cntr
->
base
.
slot
*
0x08
),
log
);
nv
km_wr32
(
device
,
dom
->
addr
+
0x09c
,
0x00040002
|
(
dom
->
mode
<<
3
));
nv
km_wr32
(
device
,
dom
->
addr
+
0x100
,
0x00000000
);
nv
km_wr32
(
device
,
dom
->
addr
+
0x040
+
(
cntr
->
base
.
slot
*
0x08
),
src
);
nv
km_wr32
(
device
,
dom
->
addr
+
0x044
+
(
cntr
->
base
.
slot
*
0x08
),
log
);
}
static
void
gf100_perfctr_read
(
struct
nvkm_pm
*
pm
,
struct
nvkm_perfdom
*
dom
,
struct
nvkm_perfctr
*
ctr
)
{
struct
nvkm_device
*
device
=
pm
->
engine
.
subdev
.
device
;
struct
gf100_pm_cntr
*
cntr
=
(
void
*
)
ctr
;
switch
(
cntr
->
base
.
slot
)
{
case
0
:
cntr
->
base
.
ctr
=
nv
_rd32
(
pm
,
dom
->
addr
+
0x08c
);
break
;
case
1
:
cntr
->
base
.
ctr
=
nv
_rd32
(
pm
,
dom
->
addr
+
0x088
);
break
;
case
2
:
cntr
->
base
.
ctr
=
nv
_rd32
(
pm
,
dom
->
addr
+
0x080
);
break
;
case
3
:
cntr
->
base
.
ctr
=
nv
_rd32
(
pm
,
dom
->
addr
+
0x090
);
break
;
case
0
:
cntr
->
base
.
ctr
=
nv
km_rd32
(
device
,
dom
->
addr
+
0x08c
);
break
;
case
1
:
cntr
->
base
.
ctr
=
nv
km_rd32
(
device
,
dom
->
addr
+
0x088
);
break
;
case
2
:
cntr
->
base
.
ctr
=
nv
km_rd32
(
device
,
dom
->
addr
+
0x080
);
break
;
case
3
:
cntr
->
base
.
ctr
=
nv
km_rd32
(
device
,
dom
->
addr
+
0x090
);
break
;
}
dom
->
clk
=
nv
_rd32
(
pm
,
dom
->
addr
+
0x070
);
dom
->
clk
=
nv
km_rd32
(
device
,
dom
->
addr
+
0x070
);
}
static
void
gf100_perfctr_next
(
struct
nvkm_pm
*
pm
,
struct
nvkm_perfdom
*
dom
)
{
nv_wr32
(
pm
,
dom
->
addr
+
0x06c
,
dom
->
signal_nr
-
0x40
+
0x27
);
nv_wr32
(
pm
,
dom
->
addr
+
0x0ec
,
0x00000011
);
struct
nvkm_device
*
device
=
pm
->
engine
.
subdev
.
device
;
nvkm_wr32
(
device
,
dom
->
addr
+
0x06c
,
dom
->
signal_nr
-
0x40
+
0x27
);
nvkm_wr32
(
device
,
dom
->
addr
+
0x0ec
,
0x00000011
);
}
const
struct
nvkm_funcdom
...
...
@@ -175,8 +178,9 @@ int
gf100_pm_fini
(
struct
nvkm_object
*
object
,
bool
suspend
)
{
struct
nvkm_pm
*
pm
=
(
void
*
)
object
;
nv_mask
(
pm
,
0x000200
,
0x10000000
,
0x00000000
);
nv_mask
(
pm
,
0x000200
,
0x10000000
,
0x10000000
);
struct
nvkm_device
*
device
=
pm
->
engine
.
subdev
.
device
;
nvkm_mask
(
device
,
0x000200
,
0x10000000
,
0x00000000
);
nvkm_mask
(
device
,
0x000200
,
0x10000000
,
0x10000000
);
return
nvkm_pm_fini
(
pm
,
suspend
);
}
...
...
@@ -186,6 +190,7 @@ gf100_pm_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
struct
nvkm_object
**
pobject
)
{
struct
gf100_pm_oclass
*
mclass
=
(
void
*
)
oclass
;
struct
nvkm_device
*
device
=
(
void
*
)
parent
;
struct
nvkm_pm
*
pm
;
u32
mask
;
int
ret
;
...
...
@@ -202,9 +207,9 @@ gf100_pm_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
return
ret
;
/* GPC */
mask
=
(
1
<<
nv
_rd32
(
pm
,
0x022430
))
-
1
;
mask
&=
~
nv
_rd32
(
pm
,
0x022504
);
mask
&=
~
nv
_rd32
(
pm
,
0x022584
);
mask
=
(
1
<<
nv
km_rd32
(
device
,
0x022430
))
-
1
;
mask
&=
~
nv
km_rd32
(
device
,
0x022504
);
mask
&=
~
nv
km_rd32
(
device
,
0x022584
);
ret
=
nvkm_perfdom_new
(
pm
,
"gpc"
,
mask
,
0x180000
,
0x1000
,
0x200
,
mclass
->
doms_gpc
);
...
...
@@ -212,9 +217,9 @@ gf100_pm_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
return
ret
;
/* PART */
mask
=
(
1
<<
nv
_rd32
(
pm
,
0x022438
))
-
1
;
mask
&=
~
nv
_rd32
(
pm
,
0x022548
);
mask
&=
~
nv
_rd32
(
pm
,
0x0225c8
);
mask
=
(
1
<<
nv
km_rd32
(
device
,
0x022438
))
-
1
;
mask
&=
~
nv
km_rd32
(
device
,
0x022548
);
mask
&=
~
nv
km_rd32
(
device
,
0x0225c8
);
ret
=
nvkm_perfdom_new
(
pm
,
"part"
,
mask
,
0x1a0000
,
0x1000
,
0x200
,
mclass
->
doms_part
);
...
...
drivers/gpu/drm/nouveau/nvkm/engine/pm/nv40.c
浏览文件 @
846e831d
...
...
@@ -27,6 +27,7 @@ static void
nv40_perfctr_init
(
struct
nvkm_pm
*
pm
,
struct
nvkm_perfdom
*
dom
,
struct
nvkm_perfctr
*
ctr
)
{
struct
nvkm_device
*
device
=
pm
->
engine
.
subdev
.
device
;
struct
nv40_pm_cntr
*
cntr
=
(
void
*
)
ctr
;
u32
log
=
ctr
->
logic_op
;
u32
src
=
0x00000000
;
...
...
@@ -35,31 +36,33 @@ nv40_perfctr_init(struct nvkm_pm *pm, struct nvkm_perfdom *dom,
for
(
i
=
0
;
i
<
4
;
i
++
)
src
|=
ctr
->
signal
[
i
]
<<
(
i
*
8
);
nv
_wr32
(
pm
,
0x00a7c0
+
dom
->
addr
,
0x00000001
|
(
dom
->
mode
<<
4
));
nv
_wr32
(
pm
,
0x00a400
+
dom
->
addr
+
(
cntr
->
base
.
slot
*
0x40
),
src
);
nv
_wr32
(
pm
,
0x00a420
+
dom
->
addr
+
(
cntr
->
base
.
slot
*
0x40
),
log
);
nv
km_wr32
(
device
,
0x00a7c0
+
dom
->
addr
,
0x00000001
|
(
dom
->
mode
<<
4
));
nv
km_wr32
(
device
,
0x00a400
+
dom
->
addr
+
(
cntr
->
base
.
slot
*
0x40
),
src
);
nv
km_wr32
(
device
,
0x00a420
+
dom
->
addr
+
(
cntr
->
base
.
slot
*
0x40
),
log
);
}
static
void
nv40_perfctr_read
(
struct
nvkm_pm
*
pm
,
struct
nvkm_perfdom
*
dom
,
struct
nvkm_perfctr
*
ctr
)
{
struct
nvkm_device
*
device
=
pm
->
engine
.
subdev
.
device
;
struct
nv40_pm_cntr
*
cntr
=
(
void
*
)
ctr
;
switch
(
cntr
->
base
.
slot
)
{
case
0
:
cntr
->
base
.
ctr
=
nv
_rd32
(
pm
,
0x00a700
+
dom
->
addr
);
break
;
case
1
:
cntr
->
base
.
ctr
=
nv
_rd32
(
pm
,
0x00a6c0
+
dom
->
addr
);
break
;
case
2
:
cntr
->
base
.
ctr
=
nv
_rd32
(
pm
,
0x00a680
+
dom
->
addr
);
break
;
case
3
:
cntr
->
base
.
ctr
=
nv
_rd32
(
pm
,
0x00a740
+
dom
->
addr
);
break
;
case
0
:
cntr
->
base
.
ctr
=
nv
km_rd32
(
device
,
0x00a700
+
dom
->
addr
);
break
;
case
1
:
cntr
->
base
.
ctr
=
nv
km_rd32
(
device
,
0x00a6c0
+
dom
->
addr
);
break
;
case
2
:
cntr
->
base
.
ctr
=
nv
km_rd32
(
device
,
0x00a680
+
dom
->
addr
);
break
;
case
3
:
cntr
->
base
.
ctr
=
nv
km_rd32
(
device
,
0x00a740
+
dom
->
addr
);
break
;
}
dom
->
clk
=
nv
_rd32
(
pm
,
0x00a600
+
dom
->
addr
);
dom
->
clk
=
nv
km_rd32
(
device
,
0x00a600
+
dom
->
addr
);
}
static
void
nv40_perfctr_next
(
struct
nvkm_pm
*
pm
,
struct
nvkm_perfdom
*
dom
)
{
struct
nvkm_device
*
device
=
pm
->
engine
.
subdev
.
device
;
if
(
pm
->
sequence
!=
pm
->
sequence
)
{
nv
_wr32
(
pm
,
0x400084
,
0x00000020
);
nv
km_wr32
(
device
,
0x400084
,
0x00000020
);
pm
->
sequence
=
pm
->
sequence
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录