Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
2d4b94b9
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看板
提交
2d4b94b9
编写于
6月 14, 2015
作者:
B
Ben Skeggs
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/nouveau/pm: swap perfmon/perfdom code to avoid forward decl in next commit
Signed-off-by:
N
Ben Skeggs
<
bskeggs@redhat.com
>
上级
06b7972d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
175 addition
and
175 deletion
+175
-175
drivers/gpu/drm/nouveau/nvkm/engine/pm/base.c
drivers/gpu/drm/nouveau/nvkm/engine/pm/base.c
+175
-175
未找到文件。
drivers/gpu/drm/nouveau/nvkm/engine/pm/base.c
浏览文件 @
2d4b94b9
...
...
@@ -185,181 +185,6 @@ nvkm_perfsrc_disable(struct nvkm_pm *ppm, struct nvkm_perfctr *ctr)
return
0
;
}
/*******************************************************************************
* Perfmon object classes
******************************************************************************/
static
int
nvkm_perfmon_mthd_query_domain
(
struct
nvkm_object
*
object
,
void
*
data
,
u32
size
)
{
union
{
struct
nvif_perfmon_query_domain_v0
v0
;
}
*
args
=
data
;
struct
nvkm_pm
*
ppm
=
(
void
*
)
object
->
engine
;
struct
nvkm_perfdom
*
dom
;
u8
domain_nr
;
int
di
,
ret
;
nv_ioctl
(
object
,
"perfmon query domain size %d
\n
"
,
size
);
if
(
nvif_unpack
(
args
->
v0
,
0
,
0
,
false
))
{
nv_ioctl
(
object
,
"perfmon domain vers %d iter %02x
\n
"
,
args
->
v0
.
version
,
args
->
v0
.
iter
);
di
=
(
args
->
v0
.
iter
&
0xff
)
-
1
;
}
else
return
ret
;
domain_nr
=
nvkm_pm_count_perfdom
(
ppm
);
if
(
di
>=
(
int
)
domain_nr
)
return
-
EINVAL
;
if
(
di
>=
0
)
{
dom
=
nvkm_perfdom_find
(
ppm
,
di
);
if
(
dom
==
NULL
)
return
-
EINVAL
;
args
->
v0
.
id
=
di
;
args
->
v0
.
signal_nr
=
nvkm_perfdom_count_perfsig
(
dom
);
/* Currently only global counters (PCOUNTER) are implemented
* but this will be different for local counters (MP). */
args
->
v0
.
counter_nr
=
4
;
}
if
(
++
di
<
domain_nr
)
{
args
->
v0
.
iter
=
++
di
;
return
0
;
}
args
->
v0
.
iter
=
0xff
;
return
0
;
}
static
int
nvkm_perfmon_mthd_query_signal
(
struct
nvkm_object
*
object
,
void
*
data
,
u32
size
)
{
union
{
struct
nvif_perfmon_query_signal_v0
v0
;
}
*
args
=
data
;
struct
nvkm_device
*
device
=
nv_device
(
object
);
struct
nvkm_pm
*
ppm
=
(
void
*
)
object
->
engine
;
struct
nvkm_perfdom
*
dom
;
struct
nvkm_perfsig
*
sig
;
const
bool
all
=
nvkm_boolopt
(
device
->
cfgopt
,
"NvPmShowAll"
,
false
);
const
bool
raw
=
nvkm_boolopt
(
device
->
cfgopt
,
"NvPmUnnamed"
,
all
);
int
ret
,
si
;
nv_ioctl
(
object
,
"perfmon query signal size %d
\n
"
,
size
);
if
(
nvif_unpack
(
args
->
v0
,
0
,
0
,
false
))
{
nv_ioctl
(
object
,
"perfmon query signal vers %d dom %d iter %04x
\n
"
,
args
->
v0
.
version
,
args
->
v0
.
domain
,
args
->
v0
.
iter
);
si
=
(
args
->
v0
.
iter
&
0xffff
)
-
1
;
}
else
return
ret
;
dom
=
nvkm_perfdom_find
(
ppm
,
args
->
v0
.
domain
);
if
(
dom
==
NULL
||
si
>=
(
int
)
dom
->
signal_nr
)
return
-
EINVAL
;
if
(
si
>=
0
)
{
sig
=
&
dom
->
signal
[
si
];
if
(
raw
||
!
sig
->
name
)
{
snprintf
(
args
->
v0
.
name
,
sizeof
(
args
->
v0
.
name
),
"/%s/%02x"
,
dom
->
name
,
si
);
}
else
{
strncpy
(
args
->
v0
.
name
,
sig
->
name
,
sizeof
(
args
->
v0
.
name
));
}
args
->
v0
.
signal
=
si
;
args
->
v0
.
source_nr
=
nvkm_perfsig_count_perfsrc
(
sig
);
}
while
(
++
si
<
dom
->
signal_nr
)
{
if
(
all
||
dom
->
signal
[
si
].
name
)
{
args
->
v0
.
iter
=
++
si
;
return
0
;
}
}
args
->
v0
.
iter
=
0xffff
;
return
0
;
}
static
int
nvkm_perfmon_mthd_query_source
(
struct
nvkm_object
*
object
,
void
*
data
,
u32
size
)
{
union
{
struct
nvif_perfmon_query_source_v0
v0
;
}
*
args
=
data
;
struct
nvkm_pm
*
ppm
=
(
void
*
)
object
->
engine
;
struct
nvkm_perfdom
*
dom
=
NULL
;
struct
nvkm_perfsig
*
sig
;
struct
nvkm_perfsrc
*
src
;
u8
source_nr
=
0
;
int
si
,
ret
;
nv_ioctl
(
object
,
"perfmon query source size %d
\n
"
,
size
);
if
(
nvif_unpack
(
args
->
v0
,
0
,
0
,
false
))
{
nv_ioctl
(
object
,
"perfmon source vers %d dom %d sig %02x iter %02x
\n
"
,
args
->
v0
.
version
,
args
->
v0
.
domain
,
args
->
v0
.
signal
,
args
->
v0
.
iter
);
si
=
(
args
->
v0
.
iter
&
0xff
)
-
1
;
}
else
return
ret
;
sig
=
nvkm_perfsig_find
(
ppm
,
args
->
v0
.
domain
,
args
->
v0
.
signal
,
&
dom
);
if
(
!
sig
)
return
-
EINVAL
;
source_nr
=
nvkm_perfsig_count_perfsrc
(
sig
);
if
(
si
>=
(
int
)
source_nr
)
return
-
EINVAL
;
if
(
si
>=
0
)
{
src
=
nvkm_perfsrc_find
(
ppm
,
sig
,
sig
->
source
[
si
]);
if
(
!
src
)
return
-
EINVAL
;
args
->
v0
.
source
=
sig
->
source
[
si
];
args
->
v0
.
mask
=
src
->
mask
;
strncpy
(
args
->
v0
.
name
,
src
->
name
,
sizeof
(
args
->
v0
.
name
));
}
if
(
++
si
<
source_nr
)
{
args
->
v0
.
iter
=
++
si
;
return
0
;
}
args
->
v0
.
iter
=
0xff
;
return
0
;
}
static
int
nvkm_perfmon_mthd
(
struct
nvkm_object
*
object
,
u32
mthd
,
void
*
data
,
u32
size
)
{
switch
(
mthd
)
{
case
NVIF_PERFMON_V0_QUERY_DOMAIN
:
return
nvkm_perfmon_mthd_query_domain
(
object
,
data
,
size
);
case
NVIF_PERFMON_V0_QUERY_SIGNAL
:
return
nvkm_perfmon_mthd_query_signal
(
object
,
data
,
size
);
case
NVIF_PERFMON_V0_QUERY_SOURCE
:
return
nvkm_perfmon_mthd_query_source
(
object
,
data
,
size
);
default:
break
;
}
return
-
EINVAL
;
}
static
struct
nvkm_ofuncs
nvkm_perfmon_ofuncs
=
{
.
ctor
=
_nvkm_object_ctor
,
.
dtor
=
nvkm_object_destroy
,
.
init
=
nvkm_object_init
,
.
fini
=
nvkm_object_fini
,
.
mthd
=
nvkm_perfmon_mthd
,
};
/*******************************************************************************
* Perfdom object classes
******************************************************************************/
...
...
@@ -585,6 +410,181 @@ nvkm_perfdom_ofuncs = {
.
mthd
=
nvkm_perfdom_mthd
,
};
/*******************************************************************************
* Perfmon object classes
******************************************************************************/
static
int
nvkm_perfmon_mthd_query_domain
(
struct
nvkm_object
*
object
,
void
*
data
,
u32
size
)
{
union
{
struct
nvif_perfmon_query_domain_v0
v0
;
}
*
args
=
data
;
struct
nvkm_pm
*
ppm
=
(
void
*
)
object
->
engine
;
struct
nvkm_perfdom
*
dom
;
u8
domain_nr
;
int
di
,
ret
;
nv_ioctl
(
object
,
"perfmon query domain size %d
\n
"
,
size
);
if
(
nvif_unpack
(
args
->
v0
,
0
,
0
,
false
))
{
nv_ioctl
(
object
,
"perfmon domain vers %d iter %02x
\n
"
,
args
->
v0
.
version
,
args
->
v0
.
iter
);
di
=
(
args
->
v0
.
iter
&
0xff
)
-
1
;
}
else
return
ret
;
domain_nr
=
nvkm_pm_count_perfdom
(
ppm
);
if
(
di
>=
(
int
)
domain_nr
)
return
-
EINVAL
;
if
(
di
>=
0
)
{
dom
=
nvkm_perfdom_find
(
ppm
,
di
);
if
(
dom
==
NULL
)
return
-
EINVAL
;
args
->
v0
.
id
=
di
;
args
->
v0
.
signal_nr
=
nvkm_perfdom_count_perfsig
(
dom
);
/* Currently only global counters (PCOUNTER) are implemented
* but this will be different for local counters (MP). */
args
->
v0
.
counter_nr
=
4
;
}
if
(
++
di
<
domain_nr
)
{
args
->
v0
.
iter
=
++
di
;
return
0
;
}
args
->
v0
.
iter
=
0xff
;
return
0
;
}
static
int
nvkm_perfmon_mthd_query_signal
(
struct
nvkm_object
*
object
,
void
*
data
,
u32
size
)
{
union
{
struct
nvif_perfmon_query_signal_v0
v0
;
}
*
args
=
data
;
struct
nvkm_device
*
device
=
nv_device
(
object
);
struct
nvkm_pm
*
ppm
=
(
void
*
)
object
->
engine
;
struct
nvkm_perfdom
*
dom
;
struct
nvkm_perfsig
*
sig
;
const
bool
all
=
nvkm_boolopt
(
device
->
cfgopt
,
"NvPmShowAll"
,
false
);
const
bool
raw
=
nvkm_boolopt
(
device
->
cfgopt
,
"NvPmUnnamed"
,
all
);
int
ret
,
si
;
nv_ioctl
(
object
,
"perfmon query signal size %d
\n
"
,
size
);
if
(
nvif_unpack
(
args
->
v0
,
0
,
0
,
false
))
{
nv_ioctl
(
object
,
"perfmon query signal vers %d dom %d iter %04x
\n
"
,
args
->
v0
.
version
,
args
->
v0
.
domain
,
args
->
v0
.
iter
);
si
=
(
args
->
v0
.
iter
&
0xffff
)
-
1
;
}
else
return
ret
;
dom
=
nvkm_perfdom_find
(
ppm
,
args
->
v0
.
domain
);
if
(
dom
==
NULL
||
si
>=
(
int
)
dom
->
signal_nr
)
return
-
EINVAL
;
if
(
si
>=
0
)
{
sig
=
&
dom
->
signal
[
si
];
if
(
raw
||
!
sig
->
name
)
{
snprintf
(
args
->
v0
.
name
,
sizeof
(
args
->
v0
.
name
),
"/%s/%02x"
,
dom
->
name
,
si
);
}
else
{
strncpy
(
args
->
v0
.
name
,
sig
->
name
,
sizeof
(
args
->
v0
.
name
));
}
args
->
v0
.
signal
=
si
;
args
->
v0
.
source_nr
=
nvkm_perfsig_count_perfsrc
(
sig
);
}
while
(
++
si
<
dom
->
signal_nr
)
{
if
(
all
||
dom
->
signal
[
si
].
name
)
{
args
->
v0
.
iter
=
++
si
;
return
0
;
}
}
args
->
v0
.
iter
=
0xffff
;
return
0
;
}
static
int
nvkm_perfmon_mthd_query_source
(
struct
nvkm_object
*
object
,
void
*
data
,
u32
size
)
{
union
{
struct
nvif_perfmon_query_source_v0
v0
;
}
*
args
=
data
;
struct
nvkm_pm
*
ppm
=
(
void
*
)
object
->
engine
;
struct
nvkm_perfdom
*
dom
=
NULL
;
struct
nvkm_perfsig
*
sig
;
struct
nvkm_perfsrc
*
src
;
u8
source_nr
=
0
;
int
si
,
ret
;
nv_ioctl
(
object
,
"perfmon query source size %d
\n
"
,
size
);
if
(
nvif_unpack
(
args
->
v0
,
0
,
0
,
false
))
{
nv_ioctl
(
object
,
"perfmon source vers %d dom %d sig %02x iter %02x
\n
"
,
args
->
v0
.
version
,
args
->
v0
.
domain
,
args
->
v0
.
signal
,
args
->
v0
.
iter
);
si
=
(
args
->
v0
.
iter
&
0xff
)
-
1
;
}
else
return
ret
;
sig
=
nvkm_perfsig_find
(
ppm
,
args
->
v0
.
domain
,
args
->
v0
.
signal
,
&
dom
);
if
(
!
sig
)
return
-
EINVAL
;
source_nr
=
nvkm_perfsig_count_perfsrc
(
sig
);
if
(
si
>=
(
int
)
source_nr
)
return
-
EINVAL
;
if
(
si
>=
0
)
{
src
=
nvkm_perfsrc_find
(
ppm
,
sig
,
sig
->
source
[
si
]);
if
(
!
src
)
return
-
EINVAL
;
args
->
v0
.
source
=
sig
->
source
[
si
];
args
->
v0
.
mask
=
src
->
mask
;
strncpy
(
args
->
v0
.
name
,
src
->
name
,
sizeof
(
args
->
v0
.
name
));
}
if
(
++
si
<
source_nr
)
{
args
->
v0
.
iter
=
++
si
;
return
0
;
}
args
->
v0
.
iter
=
0xff
;
return
0
;
}
static
int
nvkm_perfmon_mthd
(
struct
nvkm_object
*
object
,
u32
mthd
,
void
*
data
,
u32
size
)
{
switch
(
mthd
)
{
case
NVIF_PERFMON_V0_QUERY_DOMAIN
:
return
nvkm_perfmon_mthd_query_domain
(
object
,
data
,
size
);
case
NVIF_PERFMON_V0_QUERY_SIGNAL
:
return
nvkm_perfmon_mthd_query_signal
(
object
,
data
,
size
);
case
NVIF_PERFMON_V0_QUERY_SOURCE
:
return
nvkm_perfmon_mthd_query_source
(
object
,
data
,
size
);
default:
break
;
}
return
-
EINVAL
;
}
static
struct
nvkm_ofuncs
nvkm_perfmon_ofuncs
=
{
.
ctor
=
_nvkm_object_ctor
,
.
dtor
=
nvkm_object_destroy
,
.
init
=
nvkm_object_init
,
.
fini
=
nvkm_object_fini
,
.
mthd
=
nvkm_perfmon_mthd
,
};
struct
nvkm_oclass
nvkm_pm_sclass
[]
=
{
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录