Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
a2bfb50e
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看板
提交
a2bfb50e
编写于
1月 15, 2020
作者:
B
Ben Skeggs
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/nouveau/gr/gk20a,gm200-: use nvkm_firmware_load_blob for sw init
Signed-off-by:
N
Ben Skeggs
<
bskeggs@redhat.com
>
上级
6f0add0a
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
44 addition
and
48 deletion
+44
-48
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.h
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.h
+2
-8
drivers/gpu/drm/nouveau/nvkm/engine/gr/gk20a.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gk20a.c
+39
-35
drivers/gpu/drm/nouveau/nvkm/engine/gr/gm200.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gm200.c
+3
-5
未找到文件。
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.h
浏览文件 @
a2bfb50e
...
...
@@ -244,6 +244,8 @@ void gp100_gr_zbc_clear_depth(struct gf100_gr *, int);
void
gp102_gr_init_swdx_pes_mask
(
struct
gf100_gr
*
);
extern
const
struct
gf100_gr_func_zbc
gp102_gr_zbc
;
int
gk20a_gr_load_sw
(
struct
gf100_gr
*
,
const
char
*
path
,
int
ver
);
#define gf100_gr_chan(p) container_of((p), struct gf100_gr_chan, object)
#include <core/object.h>
...
...
@@ -304,14 +306,6 @@ void gf100_gr_icmd(struct gf100_gr *, const struct gf100_gr_pack *);
void
gf100_gr_mthd
(
struct
gf100_gr
*
,
const
struct
gf100_gr_pack
*
);
int
gf100_gr_init_ctxctl
(
struct
gf100_gr
*
);
/* external bundles loading functions */
int
gk20a_gr_av_to_init
(
struct
gf100_gr
*
,
const
char
*
,
struct
gf100_gr_pack
**
);
int
gk20a_gr_aiv_to_init
(
struct
gf100_gr
*
,
const
char
*
,
struct
gf100_gr_pack
**
);
int
gk20a_gr_av_to_method
(
struct
gf100_gr
*
,
const
char
*
,
struct
gf100_gr_pack
**
);
int
gm200_gr_new_
(
const
struct
gf100_gr_func
*
,
struct
nvkm_device
*
,
int
,
struct
nvkm_gr
**
);
...
...
drivers/gpu/drm/nouveau/nvkm/engine/gr/gk20a.c
浏览文件 @
a2bfb50e
...
...
@@ -22,6 +22,7 @@
#include "gf100.h"
#include "ctxgf100.h"
#include <core/firmware.h>
#include <subdev/timer.h>
#include <nvif/class.h>
...
...
@@ -33,21 +34,22 @@ struct gk20a_fw_av
};
int
gk20a_gr_av_to_init
(
struct
gf100_gr
*
gr
,
const
char
*
fw_
name
,
struct
gf100_gr_pack
**
ppack
)
gk20a_gr_av_to_init
(
struct
gf100_gr
*
gr
,
const
char
*
path
,
const
char
*
name
,
int
ver
,
struct
gf100_gr_pack
**
ppack
)
{
struct
nvkm_blob
fuc
;
struct
nvkm_subdev
*
subdev
=
&
gr
->
base
.
engine
.
subdev
;
struct
nvkm_blob
blob
;
struct
gf100_gr_init
*
init
;
struct
gf100_gr_pack
*
pack
;
int
nent
;
int
ret
;
int
i
;
ret
=
gf100_gr_ctor_fw
(
gr
,
fw_name
,
&
fuc
);
ret
=
nvkm_firmware_load_blob
(
subdev
,
path
,
name
,
ver
,
&
blob
);
if
(
ret
)
return
ret
;
nent
=
(
fuc
.
size
/
sizeof
(
struct
gk20a_fw_av
));
nent
=
(
blob
.
size
/
sizeof
(
struct
gk20a_fw_av
));
pack
=
vzalloc
((
sizeof
(
*
pack
)
*
2
)
+
(
sizeof
(
*
init
)
*
(
nent
+
1
)));
if
(
!
pack
)
{
ret
=
-
ENOMEM
;
...
...
@@ -59,7 +61,7 @@ gk20a_gr_av_to_init(struct gf100_gr *gr, const char *fw_name,
for
(
i
=
0
;
i
<
nent
;
i
++
)
{
struct
gf100_gr_init
*
ent
=
&
init
[
i
];
struct
gk20a_fw_av
*
av
=
&
((
struct
gk20a_fw_av
*
)
fuc
.
data
)[
i
];
struct
gk20a_fw_av
*
av
=
&
((
struct
gk20a_fw_av
*
)
blob
.
data
)[
i
];
ent
->
addr
=
av
->
addr
;
ent
->
data
=
av
->
data
;
...
...
@@ -70,7 +72,7 @@ gk20a_gr_av_to_init(struct gf100_gr *gr, const char *fw_name,
*
ppack
=
pack
;
end:
nvkm_blob_dtor
(
&
fuc
);
nvkm_blob_dtor
(
&
blob
);
return
ret
;
}
...
...
@@ -82,21 +84,22 @@ struct gk20a_fw_aiv
};
int
gk20a_gr_aiv_to_init
(
struct
gf100_gr
*
gr
,
const
char
*
fw_
name
,
struct
gf100_gr_pack
**
ppack
)
gk20a_gr_aiv_to_init
(
struct
gf100_gr
*
gr
,
const
char
*
path
,
const
char
*
name
,
int
ver
,
struct
gf100_gr_pack
**
ppack
)
{
struct
nvkm_blob
fuc
;
struct
nvkm_subdev
*
subdev
=
&
gr
->
base
.
engine
.
subdev
;
struct
nvkm_blob
blob
;
struct
gf100_gr_init
*
init
;
struct
gf100_gr_pack
*
pack
;
int
nent
;
int
ret
;
int
i
;
ret
=
gf100_gr_ctor_fw
(
gr
,
fw_name
,
&
fuc
);
ret
=
nvkm_firmware_load_blob
(
subdev
,
path
,
name
,
ver
,
&
blob
);
if
(
ret
)
return
ret
;
nent
=
(
fuc
.
size
/
sizeof
(
struct
gk20a_fw_aiv
));
nent
=
(
blob
.
size
/
sizeof
(
struct
gk20a_fw_aiv
));
pack
=
vzalloc
((
sizeof
(
*
pack
)
*
2
)
+
(
sizeof
(
*
init
)
*
(
nent
+
1
)));
if
(
!
pack
)
{
ret
=
-
ENOMEM
;
...
...
@@ -108,7 +111,7 @@ gk20a_gr_aiv_to_init(struct gf100_gr *gr, const char *fw_name,
for
(
i
=
0
;
i
<
nent
;
i
++
)
{
struct
gf100_gr_init
*
ent
=
&
init
[
i
];
struct
gk20a_fw_aiv
*
av
=
&
((
struct
gk20a_fw_aiv
*
)
fuc
.
data
)[
i
];
struct
gk20a_fw_aiv
*
av
=
&
((
struct
gk20a_fw_aiv
*
)
blob
.
data
)[
i
];
ent
->
addr
=
av
->
addr
;
ent
->
data
=
av
->
data
;
...
...
@@ -119,15 +122,16 @@ gk20a_gr_aiv_to_init(struct gf100_gr *gr, const char *fw_name,
*
ppack
=
pack
;
end:
nvkm_blob_dtor
(
&
fuc
);
nvkm_blob_dtor
(
&
blob
);
return
ret
;
}
int
gk20a_gr_av_to_method
(
struct
gf100_gr
*
gr
,
const
char
*
fw_
name
,
struct
gf100_gr_pack
**
ppack
)
gk20a_gr_av_to_method
(
struct
gf100_gr
*
gr
,
const
char
*
path
,
const
char
*
name
,
int
ver
,
struct
gf100_gr_pack
**
ppack
)
{
struct
nvkm_blob
fuc
;
struct
nvkm_subdev
*
subdev
=
&
gr
->
base
.
engine
.
subdev
;
struct
nvkm_blob
blob
;
struct
gf100_gr_init
*
init
;
struct
gf100_gr_pack
*
pack
;
/* We don't suppose we will initialize more than 16 classes here... */
...
...
@@ -137,11 +141,11 @@ gk20a_gr_av_to_method(struct gf100_gr *gr, const char *fw_name,
int
ret
;
int
i
;
ret
=
gf100_gr_ctor_fw
(
gr
,
fw_name
,
&
fuc
);
ret
=
nvkm_firmware_load_blob
(
subdev
,
path
,
name
,
ver
,
&
blob
);
if
(
ret
)
return
ret
;
nent
=
(
fuc
.
size
/
sizeof
(
struct
gk20a_fw_av
));
nent
=
(
blob
.
size
/
sizeof
(
struct
gk20a_fw_av
));
pack
=
vzalloc
((
sizeof
(
*
pack
)
*
(
max_classes
+
1
))
+
(
sizeof
(
*
init
)
*
(
nent
+
max_classes
+
1
)));
...
...
@@ -153,7 +157,7 @@ gk20a_gr_av_to_method(struct gf100_gr *gr, const char *fw_name,
init
=
(
void
*
)(
pack
+
max_classes
+
1
);
for
(
i
=
0
;
i
<
nent
;
i
++
,
init
++
)
{
struct
gk20a_fw_av
*
av
=
&
((
struct
gk20a_fw_av
*
)
fuc
.
data
)[
i
];
struct
gk20a_fw_av
*
av
=
&
((
struct
gk20a_fw_av
*
)
blob
.
data
)[
i
];
u32
class
=
av
->
addr
&
0xffff
;
u32
addr
=
(
av
->
addr
&
0xffff0000
)
>>
14
;
...
...
@@ -179,7 +183,7 @@ gk20a_gr_av_to_method(struct gf100_gr *gr, const char *fw_name,
*
ppack
=
pack
;
end:
nvkm_blob_dtor
(
&
fuc
);
nvkm_blob_dtor
(
&
blob
);
return
ret
;
}
...
...
@@ -303,6 +307,18 @@ gk20a_gr = {
}
};
int
gk20a_gr_load_sw
(
struct
gf100_gr
*
gr
,
const
char
*
path
,
int
ver
)
{
if
(
gk20a_gr_av_to_init
(
gr
,
path
,
"sw_nonctx"
,
ver
,
&
gr
->
fuc_sw_nonctx
)
||
gk20a_gr_aiv_to_init
(
gr
,
path
,
"sw_ctx"
,
ver
,
&
gr
->
fuc_sw_ctx
)
||
gk20a_gr_av_to_init
(
gr
,
path
,
"sw_bundle_init"
,
ver
,
&
gr
->
fuc_bundle
)
||
gk20a_gr_av_to_method
(
gr
,
path
,
"sw_method_init"
,
ver
,
&
gr
->
fuc_method
))
return
-
ENOENT
;
return
0
;
}
int
gk20a_gr_new
(
struct
nvkm_device
*
device
,
int
index
,
struct
nvkm_gr
**
pgr
)
{
...
...
@@ -323,21 +339,9 @@ gk20a_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
gf100_gr_ctor_fw
(
gr
,
"gpccs_data"
,
&
gr
->
fuc41ad
))
return
-
ENODEV
;
ret
=
gk20a_gr_av_to_init
(
gr
,
"sw_nonctx"
,
&
gr
->
fuc_sw_nonctx
);
if
(
ret
)
return
ret
;
ret
=
gk20a_gr_aiv_to_init
(
gr
,
"sw_ctx"
,
&
gr
->
fuc_sw_ctx
);
if
(
ret
)
return
ret
;
ret
=
gk20a_gr_av_to_init
(
gr
,
"sw_bundle_init"
,
&
gr
->
fuc_bundle
);
ret
=
gk20a_gr_load_sw
(
gr
,
""
,
0
);
if
(
ret
)
return
ret
;
ret
=
gk20a_gr_av_to_method
(
gr
,
"sw_method_init"
,
&
gr
->
fuc_method
);
if
(
ret
)
return
ret
;
return
-
ENODEV
;
return
0
;
}
drivers/gpu/drm/nouveau/nvkm/engine/gr/gm200.c
浏览文件 @
a2bfb50e
...
...
@@ -153,11 +153,9 @@ gm200_gr_new_(const struct gf100_gr_func *func, struct nvkm_device *device,
return
ret
;
}
if
((
ret
=
gk20a_gr_av_to_init
(
gr
,
"gr/sw_nonctx"
,
&
gr
->
fuc_sw_nonctx
))
||
(
ret
=
gk20a_gr_aiv_to_init
(
gr
,
"gr/sw_ctx"
,
&
gr
->
fuc_sw_ctx
))
||
(
ret
=
gk20a_gr_av_to_init
(
gr
,
"gr/sw_bundle_init"
,
&
gr
->
fuc_bundle
))
||
(
ret
=
gk20a_gr_av_to_method
(
gr
,
"gr/sw_method_init"
,
&
gr
->
fuc_method
)))
return
ret
;
ret
=
gk20a_gr_load_sw
(
gr
,
"gr/"
,
0
);
if
(
ret
)
return
-
ENODEV
;
return
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录