Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
02917aa3
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
161
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看板
提交
02917aa3
编写于
5月 08, 2018
作者:
B
Ben Skeggs
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/nouveau/gr/gf100-: virtualise init_zcull
Signed-off-by:
N
Ben Skeggs
<
bskeggs@redhat.com
>
上级
2fe5ff63
变更
19
隐藏空白更改
内联
并排
Showing
19 changed file
with
85 addition
and
178 deletion
+85
-178
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c
+30
-32
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.h
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.h
+4
-0
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf104.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf104.c
+1
-0
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf108.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf108.c
+1
-0
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf110.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf110.c
+1
-0
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf117.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf117.c
+29
-0
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf119.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf119.c
+1
-0
drivers/gpu/drm/nouveau/nvkm/engine/gr/gk104.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gk104.c
+2
-29
drivers/gpu/drm/nouveau/nvkm/engine/gr/gk110.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gk110.c
+1
-0
drivers/gpu/drm/nouveau/nvkm/engine/gr/gk110b.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gk110b.c
+1
-0
drivers/gpu/drm/nouveau/nvkm/engine/gr/gk208.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gk208.c
+1
-0
drivers/gpu/drm/nouveau/nvkm/engine/gr/gk20a.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gk20a.c
+3
-30
drivers/gpu/drm/nouveau/nvkm/engine/gr/gm107.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gm107.c
+2
-29
drivers/gpu/drm/nouveau/nvkm/engine/gr/gm200.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gm200.c
+2
-29
drivers/gpu/drm/nouveau/nvkm/engine/gr/gm20b.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gm20b.c
+1
-0
drivers/gpu/drm/nouveau/nvkm/engine/gr/gp100.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gp100.c
+2
-29
drivers/gpu/drm/nouveau/nvkm/engine/gr/gp102.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gp102.c
+1
-0
drivers/gpu/drm/nouveau/nvkm/engine/gr/gp107.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gp107.c
+1
-0
drivers/gpu/drm/nouveau/nvkm/engine/gr/gp10b.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gp10b.c
+1
-0
未找到文件。
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c
浏览文件 @
02917aa3
...
...
@@ -1930,6 +1930,34 @@ gf100_gr_init_gpc_mmu(struct gf100_gr *gr)
nvkm_wr32
(
device
,
0x4188b8
,
nvkm_memory_addr
(
fb
->
mmu_rd
)
>>
8
);
}
void
gf100_gr_init_zcull
(
struct
gf100_gr
*
gr
)
{
struct
nvkm_device
*
device
=
gr
->
base
.
engine
.
subdev
.
device
;
const
u32
magicgpc918
=
DIV_ROUND_UP
(
0x00800000
,
gr
->
tpc_total
);
u32
data
[
TPC_MAX
/
8
]
=
{};
u8
tpcnr
[
GPC_MAX
];
int
gpc
,
tpc
;
int
i
;
memcpy
(
tpcnr
,
gr
->
tpc_nr
,
sizeof
(
gr
->
tpc_nr
));
for
(
i
=
0
,
gpc
=
-
1
;
i
<
gr
->
tpc_total
;
i
++
)
{
do
{
gpc
=
(
gpc
+
1
)
%
gr
->
gpc_nr
;
}
while
(
!
tpcnr
[
gpc
]);
tpc
=
gr
->
tpc_nr
[
gpc
]
-
tpcnr
[
gpc
]
--
;
data
[
i
/
8
]
|=
tpc
<<
((
i
%
8
)
*
4
);
}
nvkm_wr32
(
device
,
GPC_BCAST
(
0x0980
),
data
[
0
]);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x0984
),
data
[
1
]);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x0988
),
data
[
2
]);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x098c
),
data
[
3
]);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x1bd4
),
magicgpc918
);
}
void
gf100_gr_init_vsc_stream_master
(
struct
gf100_gr
*
gr
)
{
...
...
@@ -1941,11 +1969,7 @@ int
gf100_gr_init
(
struct
gf100_gr
*
gr
)
{
struct
nvkm_device
*
device
=
gr
->
base
.
engine
.
subdev
.
device
;
const
u32
magicgpc918
=
DIV_ROUND_UP
(
0x00800000
,
gr
->
tpc_total
);
u32
data
[
TPC_MAX
/
8
]
=
{};
u8
tpcnr
[
GPC_MAX
];
int
gpc
,
tpc
,
rop
;
int
i
;
gr
->
func
->
init_gpc_mmu
(
gr
);
...
...
@@ -1964,34 +1988,7 @@ gf100_gr_init(struct gf100_gr *gr)
gr
->
func
->
init_bios
(
gr
);
gr
->
func
->
init_vsc_stream_master
(
gr
);
memcpy
(
tpcnr
,
gr
->
tpc_nr
,
sizeof
(
gr
->
tpc_nr
));
for
(
i
=
0
,
gpc
=
-
1
;
i
<
gr
->
tpc_total
;
i
++
)
{
do
{
gpc
=
(
gpc
+
1
)
%
gr
->
gpc_nr
;
}
while
(
!
tpcnr
[
gpc
]);
tpc
=
gr
->
tpc_nr
[
gpc
]
-
tpcnr
[
gpc
]
--
;
data
[
i
/
8
]
|=
tpc
<<
((
i
%
8
)
*
4
);
}
nvkm_wr32
(
device
,
GPC_BCAST
(
0x0980
),
data
[
0
]);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x0984
),
data
[
1
]);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x0988
),
data
[
2
]);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x098c
),
data
[
3
]);
for
(
gpc
=
0
;
gpc
<
gr
->
gpc_nr
;
gpc
++
)
{
nvkm_wr32
(
device
,
GPC_UNIT
(
gpc
,
0x0914
),
gr
->
screen_tile_row_offset
<<
8
|
gr
->
tpc_nr
[
gpc
]);
nvkm_wr32
(
device
,
GPC_UNIT
(
gpc
,
0x0910
),
0x00040000
|
gr
->
tpc_total
);
nvkm_wr32
(
device
,
GPC_UNIT
(
gpc
,
0x0918
),
magicgpc918
);
}
if
(
device
->
chipset
!=
0xd7
)
nvkm_wr32
(
device
,
GPC_BCAST
(
0x1bd4
),
magicgpc918
);
else
nvkm_wr32
(
device
,
GPC_BCAST
(
0x3fd4
),
magicgpc918
);
gr
->
func
->
init_zcull
(
gr
);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x08ac
),
nvkm_rd32
(
device
,
0x100800
));
...
...
@@ -2076,6 +2073,7 @@ gf100_gr = {
.
init
=
gf100_gr_init
,
.
init_gpc_mmu
=
gf100_gr_init_gpc_mmu
,
.
init_vsc_stream_master
=
gf100_gr_init_vsc_stream_master
,
.
init_zcull
=
gf100_gr_init_zcull
,
.
mmio
=
gf100_gr_pack_mmio
,
.
fecs
.
ucode
=
&
gf100_gr_fecs_ucode
,
.
gpccs
.
ucode
=
&
gf100_gr_gpccs_ucode
,
...
...
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.h
浏览文件 @
02917aa3
...
...
@@ -125,6 +125,7 @@ struct gf100_gr_func {
void
(
*
init_r405a14
)(
struct
gf100_gr
*
);
void
(
*
init_bios
)(
struct
gf100_gr
*
);
void
(
*
init_vsc_stream_master
)(
struct
gf100_gr
*
);
void
(
*
init_zcull
)(
struct
gf100_gr
*
);
void
(
*
init_rop_active_fbps
)(
struct
gf100_gr
*
);
void
(
*
init_ppc_exceptions
)(
struct
gf100_gr
*
);
void
(
*
init_swdx_pes_mask
)(
struct
gf100_gr
*
);
...
...
@@ -147,6 +148,9 @@ struct gf100_gr_func {
int
gf100_gr_rops
(
struct
gf100_gr
*
);
int
gf100_gr_init
(
struct
gf100_gr
*
);
void
gf100_gr_init_vsc_stream_master
(
struct
gf100_gr
*
);
void
gf100_gr_init_zcull
(
struct
gf100_gr
*
);
void
gf117_gr_init_zcull
(
struct
gf100_gr
*
);
int
gk104_gr_init
(
struct
gf100_gr
*
);
void
gk104_gr_init_vsc_stream_master
(
struct
gf100_gr
*
);
...
...
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf104.c
浏览文件 @
02917aa3
...
...
@@ -117,6 +117,7 @@ gf104_gr = {
.
init
=
gf100_gr_init
,
.
init_gpc_mmu
=
gf100_gr_init_gpc_mmu
,
.
init_vsc_stream_master
=
gf100_gr_init_vsc_stream_master
,
.
init_zcull
=
gf100_gr_init_zcull
,
.
mmio
=
gf104_gr_pack_mmio
,
.
fecs
.
ucode
=
&
gf100_gr_fecs_ucode
,
.
gpccs
.
ucode
=
&
gf100_gr_gpccs_ucode
,
...
...
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf108.c
浏览文件 @
02917aa3
...
...
@@ -115,6 +115,7 @@ gf108_gr = {
.
init_gpc_mmu
=
gf100_gr_init_gpc_mmu
,
.
init_r405a14
=
gf108_gr_init_r405a14
,
.
init_vsc_stream_master
=
gf100_gr_init_vsc_stream_master
,
.
init_zcull
=
gf100_gr_init_zcull
,
.
mmio
=
gf108_gr_pack_mmio
,
.
fecs
.
ucode
=
&
gf100_gr_fecs_ucode
,
.
gpccs
.
ucode
=
&
gf100_gr_gpccs_ucode
,
...
...
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf110.c
浏览文件 @
02917aa3
...
...
@@ -89,6 +89,7 @@ gf110_gr = {
.
init
=
gf100_gr_init
,
.
init_gpc_mmu
=
gf100_gr_init_gpc_mmu
,
.
init_vsc_stream_master
=
gf100_gr_init_vsc_stream_master
,
.
init_zcull
=
gf100_gr_init_zcull
,
.
mmio
=
gf110_gr_pack_mmio
,
.
fecs
.
ucode
=
&
gf100_gr_fecs_ucode
,
.
gpccs
.
ucode
=
&
gf100_gr_gpccs_ucode
,
...
...
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf117.c
浏览文件 @
02917aa3
...
...
@@ -120,11 +120,40 @@ gf117_gr_gpccs_ucode = {
.
data
.
size
=
sizeof
(
gf117_grgpc_data
),
};
void
gf117_gr_init_zcull
(
struct
gf100_gr
*
gr
)
{
struct
nvkm_device
*
device
=
gr
->
base
.
engine
.
subdev
.
device
;
const
u32
magicgpc918
=
DIV_ROUND_UP
(
0x00800000
,
gr
->
tpc_total
);
u32
data
[
TPC_MAX
/
8
]
=
{};
u8
tpcnr
[
GPC_MAX
];
int
gpc
,
tpc
;
int
i
;
memcpy
(
tpcnr
,
gr
->
tpc_nr
,
sizeof
(
gr
->
tpc_nr
));
for
(
i
=
0
,
gpc
=
-
1
;
i
<
gr
->
tpc_total
;
i
++
)
{
do
{
gpc
=
(
gpc
+
1
)
%
gr
->
gpc_nr
;
}
while
(
!
tpcnr
[
gpc
]);
tpc
=
gr
->
tpc_nr
[
gpc
]
-
tpcnr
[
gpc
]
--
;
data
[
i
/
8
]
|=
tpc
<<
((
i
%
8
)
*
4
);
}
nvkm_wr32
(
device
,
GPC_BCAST
(
0x0980
),
data
[
0
]);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x0984
),
data
[
1
]);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x0988
),
data
[
2
]);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x098c
),
data
[
3
]);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x3fd4
),
magicgpc918
);
}
static
const
struct
gf100_gr_func
gf117_gr
=
{
.
init
=
gf100_gr_init
,
.
init_gpc_mmu
=
gf100_gr_init_gpc_mmu
,
.
init_vsc_stream_master
=
gf100_gr_init_vsc_stream_master
,
.
init_zcull
=
gf117_gr_init_zcull
,
.
mmio
=
gf117_gr_pack_mmio
,
.
fecs
.
ucode
=
&
gf117_gr_fecs_ucode
,
.
gpccs
.
ucode
=
&
gf117_gr_gpccs_ucode
,
...
...
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf119.c
浏览文件 @
02917aa3
...
...
@@ -180,6 +180,7 @@ gf119_gr = {
.
init
=
gf100_gr_init
,
.
init_gpc_mmu
=
gf100_gr_init_gpc_mmu
,
.
init_vsc_stream_master
=
gf100_gr_init_vsc_stream_master
,
.
init_zcull
=
gf100_gr_init_zcull
,
.
mmio
=
gf119_gr_pack_mmio
,
.
fecs
.
ucode
=
&
gf100_gr_fecs_ucode
,
.
gpccs
.
ucode
=
&
gf100_gr_gpccs_ucode
,
...
...
drivers/gpu/drm/nouveau/nvkm/engine/gr/gk104.c
浏览文件 @
02917aa3
...
...
@@ -415,11 +415,7 @@ int
gk104_gr_init
(
struct
gf100_gr
*
gr
)
{
struct
nvkm_device
*
device
=
gr
->
base
.
engine
.
subdev
.
device
;
const
u32
magicgpc918
=
DIV_ROUND_UP
(
0x00800000
,
gr
->
tpc_total
);
u32
data
[
TPC_MAX
/
8
]
=
{};
u8
tpcnr
[
GPC_MAX
];
int
gpc
,
tpc
,
rop
;
int
i
;
gr
->
func
->
init_gpc_mmu
(
gr
);
...
...
@@ -429,32 +425,8 @@ gk104_gr_init(struct gf100_gr *gr)
gr
->
func
->
clkgate_pack
);
gr
->
func
->
init_vsc_stream_master
(
gr
);
gr
->
func
->
init_zcull
(
gr
);
memset
(
data
,
0x00
,
sizeof
(
data
));
memcpy
(
tpcnr
,
gr
->
tpc_nr
,
sizeof
(
gr
->
tpc_nr
));
for
(
i
=
0
,
gpc
=
-
1
;
i
<
gr
->
tpc_total
;
i
++
)
{
do
{
gpc
=
(
gpc
+
1
)
%
gr
->
gpc_nr
;
}
while
(
!
tpcnr
[
gpc
]);
tpc
=
gr
->
tpc_nr
[
gpc
]
-
tpcnr
[
gpc
]
--
;
data
[
i
/
8
]
|=
tpc
<<
((
i
%
8
)
*
4
);
}
nvkm_wr32
(
device
,
GPC_BCAST
(
0x0980
),
data
[
0
]);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x0984
),
data
[
1
]);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x0988
),
data
[
2
]);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x098c
),
data
[
3
]);
for
(
gpc
=
0
;
gpc
<
gr
->
gpc_nr
;
gpc
++
)
{
nvkm_wr32
(
device
,
GPC_UNIT
(
gpc
,
0x0914
),
gr
->
screen_tile_row_offset
<<
8
|
gr
->
tpc_nr
[
gpc
]);
nvkm_wr32
(
device
,
GPC_UNIT
(
gpc
,
0x0910
),
0x00040000
|
gr
->
tpc_total
);
nvkm_wr32
(
device
,
GPC_UNIT
(
gpc
,
0x0918
),
magicgpc918
);
}
nvkm_wr32
(
device
,
GPC_BCAST
(
0x3fd4
),
magicgpc918
);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x08ac
),
nvkm_rd32
(
device
,
0x100800
));
gr
->
func
->
init_rop_active_fbps
(
gr
);
...
...
@@ -544,6 +516,7 @@ gk104_gr = {
.
init
=
gk104_gr_init
,
.
init_gpc_mmu
=
gf100_gr_init_gpc_mmu
,
.
init_vsc_stream_master
=
gk104_gr_init_vsc_stream_master
,
.
init_zcull
=
gf117_gr_init_zcull
,
.
init_rop_active_fbps
=
gk104_gr_init_rop_active_fbps
,
.
init_ppc_exceptions
=
gk104_gr_init_ppc_exceptions
,
.
mmio
=
gk104_gr_pack_mmio
,
...
...
drivers/gpu/drm/nouveau/nvkm/engine/gr/gk110.c
浏览文件 @
02917aa3
...
...
@@ -339,6 +339,7 @@ gk110_gr = {
.
init
=
gk104_gr_init
,
.
init_gpc_mmu
=
gf100_gr_init_gpc_mmu
,
.
init_vsc_stream_master
=
gk104_gr_init_vsc_stream_master
,
.
init_zcull
=
gf117_gr_init_zcull
,
.
init_rop_active_fbps
=
gk104_gr_init_rop_active_fbps
,
.
init_ppc_exceptions
=
gk104_gr_init_ppc_exceptions
,
.
mmio
=
gk110_gr_pack_mmio
,
...
...
drivers/gpu/drm/nouveau/nvkm/engine/gr/gk110b.c
浏览文件 @
02917aa3
...
...
@@ -105,6 +105,7 @@ gk110b_gr = {
.
init
=
gk104_gr_init
,
.
init_gpc_mmu
=
gf100_gr_init_gpc_mmu
,
.
init_vsc_stream_master
=
gk104_gr_init_vsc_stream_master
,
.
init_zcull
=
gf117_gr_init_zcull
,
.
init_rop_active_fbps
=
gk104_gr_init_rop_active_fbps
,
.
init_ppc_exceptions
=
gk104_gr_init_ppc_exceptions
,
.
mmio
=
gk110b_gr_pack_mmio
,
...
...
drivers/gpu/drm/nouveau/nvkm/engine/gr/gk208.c
浏览文件 @
02917aa3
...
...
@@ -164,6 +164,7 @@ gk208_gr = {
.
init
=
gk104_gr_init
,
.
init_gpc_mmu
=
gf100_gr_init_gpc_mmu
,
.
init_vsc_stream_master
=
gk104_gr_init_vsc_stream_master
,
.
init_zcull
=
gf117_gr_init_zcull
,
.
init_rop_active_fbps
=
gk104_gr_init_rop_active_fbps
,
.
init_ppc_exceptions
=
gk104_gr_init_ppc_exceptions
,
.
mmio
=
gk208_gr_pack_mmio
,
...
...
drivers/gpu/drm/nouveau/nvkm/engine/gr/gk20a.c
浏览文件 @
02917aa3
...
...
@@ -219,11 +219,7 @@ int
gk20a_gr_init
(
struct
gf100_gr
*
gr
)
{
struct
nvkm_device
*
device
=
gr
->
base
.
engine
.
subdev
.
device
;
const
u32
magicgpc918
=
DIV_ROUND_UP
(
0x00800000
,
gr
->
tpc_total
);
u32
data
[
TPC_MAX
/
8
]
=
{};
u8
tpcnr
[
GPC_MAX
];
int
gpc
,
tpc
;
int
ret
,
i
;
int
ret
;
/* Clear SCC RAM */
nvkm_wr32
(
device
,
0x40802c
,
0x1
);
...
...
@@ -246,31 +242,7 @@ gk20a_gr_init(struct gf100_gr *gr)
nvkm_mask
(
device
,
0x503018
,
0x1
,
0x1
);
/* Zcull init */
memset
(
data
,
0x00
,
sizeof
(
data
));
memcpy
(
tpcnr
,
gr
->
tpc_nr
,
sizeof
(
gr
->
tpc_nr
));
for
(
i
=
0
,
gpc
=
-
1
;
i
<
gr
->
tpc_total
;
i
++
)
{
do
{
gpc
=
(
gpc
+
1
)
%
gr
->
gpc_nr
;
}
while
(
!
tpcnr
[
gpc
]);
tpc
=
gr
->
tpc_nr
[
gpc
]
-
tpcnr
[
gpc
]
--
;
data
[
i
/
8
]
|=
tpc
<<
((
i
%
8
)
*
4
);
}
nvkm_wr32
(
device
,
GPC_BCAST
(
0x0980
),
data
[
0
]);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x0984
),
data
[
1
]);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x0988
),
data
[
2
]);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x098c
),
data
[
3
]);
for
(
gpc
=
0
;
gpc
<
gr
->
gpc_nr
;
gpc
++
)
{
nvkm_wr32
(
device
,
GPC_UNIT
(
gpc
,
0x0914
),
gr
->
screen_tile_row_offset
<<
8
|
gr
->
tpc_nr
[
gpc
]);
nvkm_wr32
(
device
,
GPC_UNIT
(
gpc
,
0x0910
),
0x00040000
|
gr
->
tpc_total
);
nvkm_wr32
(
device
,
GPC_UNIT
(
gpc
,
0x0918
),
magicgpc918
);
}
nvkm_wr32
(
device
,
GPC_BCAST
(
0x3fd4
),
magicgpc918
);
gr
->
func
->
init_zcull
(
gr
);
gr
->
func
->
init_rop_active_fbps
(
gr
);
...
...
@@ -311,6 +283,7 @@ gk20a_gr_init(struct gf100_gr *gr)
static
const
struct
gf100_gr_func
gk20a_gr
=
{
.
init
=
gk20a_gr_init
,
.
init_zcull
=
gf117_gr_init_zcull
,
.
init_rop_active_fbps
=
gk104_gr_init_rop_active_fbps
,
.
set_hww_esr_report_mask
=
gk20a_gr_set_hww_esr_report_mask
,
.
rops
=
gf100_gr_rops
,
...
...
drivers/gpu/drm/nouveau/nvkm/engine/gr/gm107.c
浏览文件 @
02917aa3
...
...
@@ -325,11 +325,7 @@ static int
gm107_gr_init
(
struct
gf100_gr
*
gr
)
{
struct
nvkm_device
*
device
=
gr
->
base
.
engine
.
subdev
.
device
;
const
u32
magicgpc918
=
DIV_ROUND_UP
(
0x00800000
,
gr
->
tpc_total
);
u32
data
[
TPC_MAX
/
8
]
=
{};
u8
tpcnr
[
GPC_MAX
];
int
gpc
,
tpc
,
rop
;
int
i
;
gr
->
func
->
init_gpc_mmu
(
gr
);
...
...
@@ -338,32 +334,8 @@ gm107_gr_init(struct gf100_gr *gr)
gr
->
func
->
init_bios
(
gr
);
gr
->
func
->
init_vsc_stream_master
(
gr
);
gr
->
func
->
init_zcull
(
gr
);
memset
(
data
,
0x00
,
sizeof
(
data
));
memcpy
(
tpcnr
,
gr
->
tpc_nr
,
sizeof
(
gr
->
tpc_nr
));
for
(
i
=
0
,
gpc
=
-
1
;
i
<
gr
->
tpc_total
;
i
++
)
{
do
{
gpc
=
(
gpc
+
1
)
%
gr
->
gpc_nr
;
}
while
(
!
tpcnr
[
gpc
]);
tpc
=
gr
->
tpc_nr
[
gpc
]
-
tpcnr
[
gpc
]
--
;
data
[
i
/
8
]
|=
tpc
<<
((
i
%
8
)
*
4
);
}
nvkm_wr32
(
device
,
GPC_BCAST
(
0x0980
),
data
[
0
]);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x0984
),
data
[
1
]);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x0988
),
data
[
2
]);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x098c
),
data
[
3
]);
for
(
gpc
=
0
;
gpc
<
gr
->
gpc_nr
;
gpc
++
)
{
nvkm_wr32
(
device
,
GPC_UNIT
(
gpc
,
0x0914
),
gr
->
screen_tile_row_offset
<<
8
|
gr
->
tpc_nr
[
gpc
]);
nvkm_wr32
(
device
,
GPC_UNIT
(
gpc
,
0x0910
),
0x00040000
|
gr
->
tpc_total
);
nvkm_wr32
(
device
,
GPC_UNIT
(
gpc
,
0x0918
),
magicgpc918
);
}
nvkm_wr32
(
device
,
GPC_BCAST
(
0x3fd4
),
magicgpc918
);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x08ac
),
nvkm_rd32
(
device
,
0x100800
));
gr
->
func
->
init_rop_active_fbps
(
gr
);
...
...
@@ -453,6 +425,7 @@ gm107_gr = {
.
init_gpc_mmu
=
gm107_gr_init_gpc_mmu
,
.
init_bios
=
gm107_gr_init_bios
,
.
init_vsc_stream_master
=
gk104_gr_init_vsc_stream_master
,
.
init_zcull
=
gf117_gr_init_zcull
,
.
init_rop_active_fbps
=
gk104_gr_init_rop_active_fbps
,
.
init_ppc_exceptions
=
gk104_gr_init_ppc_exceptions
,
.
mmio
=
gm107_gr_pack_mmio
,
...
...
drivers/gpu/drm/nouveau/nvkm/engine/gr/gm200.c
浏览文件 @
02917aa3
...
...
@@ -65,11 +65,7 @@ static int
gm200_gr_init
(
struct
gf100_gr
*
gr
)
{
struct
nvkm_device
*
device
=
gr
->
base
.
engine
.
subdev
.
device
;
const
u32
magicgpc918
=
DIV_ROUND_UP
(
0x00800000
,
gr
->
tpc_total
);
u32
data
[
TPC_MAX
/
8
]
=
{};
u8
tpcnr
[
GPC_MAX
];
int
gpc
,
tpc
,
rop
;
int
i
;
gr
->
func
->
init_gpc_mmu
(
gr
);
...
...
@@ -78,32 +74,8 @@ gm200_gr_init(struct gf100_gr *gr)
gr
->
func
->
init_bios
(
gr
);
gr
->
func
->
init_vsc_stream_master
(
gr
);
gr
->
func
->
init_zcull
(
gr
);
memset
(
data
,
0x00
,
sizeof
(
data
));
memcpy
(
tpcnr
,
gr
->
tpc_nr
,
sizeof
(
gr
->
tpc_nr
));
for
(
i
=
0
,
gpc
=
-
1
;
i
<
gr
->
tpc_total
;
i
++
)
{
do
{
gpc
=
(
gpc
+
1
)
%
gr
->
gpc_nr
;
}
while
(
!
tpcnr
[
gpc
]);
tpc
=
gr
->
tpc_nr
[
gpc
]
-
tpcnr
[
gpc
]
--
;
data
[
i
/
8
]
|=
tpc
<<
((
i
%
8
)
*
4
);
}
nvkm_wr32
(
device
,
GPC_BCAST
(
0x0980
),
data
[
0
]);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x0984
),
data
[
1
]);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x0988
),
data
[
2
]);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x098c
),
data
[
3
]);
for
(
gpc
=
0
;
gpc
<
gr
->
gpc_nr
;
gpc
++
)
{
nvkm_wr32
(
device
,
GPC_UNIT
(
gpc
,
0x0914
),
gr
->
screen_tile_row_offset
<<
8
|
gr
->
tpc_nr
[
gpc
]);
nvkm_wr32
(
device
,
GPC_UNIT
(
gpc
,
0x0910
),
0x00040000
|
gr
->
tpc_total
);
nvkm_wr32
(
device
,
GPC_UNIT
(
gpc
,
0x0918
),
magicgpc918
);
}
nvkm_wr32
(
device
,
GPC_BCAST
(
0x3fd4
),
magicgpc918
);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x08ac
),
nvkm_rd32
(
device
,
0x100800
));
nvkm_wr32
(
device
,
GPC_BCAST
(
0x033c
),
nvkm_rd32
(
device
,
0x100804
));
...
...
@@ -212,6 +184,7 @@ gm200_gr = {
.
init_gpc_mmu
=
gm200_gr_init_gpc_mmu
,
.
init_bios
=
gm107_gr_init_bios
,
.
init_vsc_stream_master
=
gk104_gr_init_vsc_stream_master
,
.
init_zcull
=
gf117_gr_init_zcull
,
.
init_rop_active_fbps
=
gm200_gr_init_rop_active_fbps
,
.
init_ppc_exceptions
=
gk104_gr_init_ppc_exceptions
,
.
rops
=
gm200_gr_rops
,
...
...
drivers/gpu/drm/nouveau/nvkm/engine/gr/gm20b.c
浏览文件 @
02917aa3
...
...
@@ -65,6 +65,7 @@ gm20b_gr_set_hww_esr_report_mask(struct gf100_gr *gr)
static
const
struct
gf100_gr_func
gm20b_gr
=
{
.
init
=
gk20a_gr_init
,
.
init_zcull
=
gf117_gr_init_zcull
,
.
init_gpc_mmu
=
gm20b_gr_init_gpc_mmu
,
.
init_rop_active_fbps
=
gk104_gr_init_rop_active_fbps
,
.
set_hww_esr_report_mask
=
gm20b_gr_set_hww_esr_report_mask
,
...
...
drivers/gpu/drm/nouveau/nvkm/engine/gr/gp100.c
浏览文件 @
02917aa3
...
...
@@ -53,43 +53,15 @@ int
gp100_gr_init
(
struct
gf100_gr
*
gr
)
{
struct
nvkm_device
*
device
=
gr
->
base
.
engine
.
subdev
.
device
;
const
u32
magicgpc918
=
DIV_ROUND_UP
(
0x00800000
,
gr
->
tpc_total
);
u32
data
[
TPC_MAX
/
8
]
=
{};
u8
tpcnr
[
GPC_MAX
];
int
gpc
,
tpc
,
rop
;
int
i
;
gr
->
func
->
init_gpc_mmu
(
gr
);
gf100_gr_mmio
(
gr
,
gr
->
fuc_sw_nonctx
);
gr
->
func
->
init_vsc_stream_master
(
gr
);
gr
->
func
->
init_zcull
(
gr
);
memset
(
data
,
0x00
,
sizeof
(
data
));
memcpy
(
tpcnr
,
gr
->
tpc_nr
,
sizeof
(
gr
->
tpc_nr
));
for
(
i
=
0
,
gpc
=
-
1
;
i
<
gr
->
tpc_total
;
i
++
)
{
do
{
gpc
=
(
gpc
+
1
)
%
gr
->
gpc_nr
;
}
while
(
!
tpcnr
[
gpc
]);
tpc
=
gr
->
tpc_nr
[
gpc
]
-
tpcnr
[
gpc
]
--
;
data
[
i
/
8
]
|=
tpc
<<
((
i
%
8
)
*
4
);
}
nvkm_wr32
(
device
,
GPC_BCAST
(
0x0980
),
data
[
0
]);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x0984
),
data
[
1
]);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x0988
),
data
[
2
]);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x098c
),
data
[
3
]);
for
(
gpc
=
0
;
gpc
<
gr
->
gpc_nr
;
gpc
++
)
{
nvkm_wr32
(
device
,
GPC_UNIT
(
gpc
,
0x0914
),
gr
->
screen_tile_row_offset
<<
8
|
gr
->
tpc_nr
[
gpc
]);
nvkm_wr32
(
device
,
GPC_UNIT
(
gpc
,
0x0910
),
0x00040000
|
gr
->
tpc_total
);
nvkm_wr32
(
device
,
GPC_UNIT
(
gpc
,
0x0918
),
magicgpc918
);
}
nvkm_wr32
(
device
,
GPC_BCAST
(
0x3fd4
),
magicgpc918
);
gr
->
func
->
init_num_active_ltcs
(
gr
);
gr
->
func
->
init_rop_active_fbps
(
gr
);
...
...
@@ -161,6 +133,7 @@ gp100_gr = {
.
init
=
gp100_gr_init
,
.
init_gpc_mmu
=
gm200_gr_init_gpc_mmu
,
.
init_vsc_stream_master
=
gk104_gr_init_vsc_stream_master
,
.
init_zcull
=
gf117_gr_init_zcull
,
.
init_rop_active_fbps
=
gp100_gr_init_rop_active_fbps
,
.
init_ppc_exceptions
=
gk104_gr_init_ppc_exceptions
,
.
init_num_active_ltcs
=
gp100_gr_init_num_active_ltcs
,
...
...
drivers/gpu/drm/nouveau/nvkm/engine/gr/gp102.c
浏览文件 @
02917aa3
...
...
@@ -45,6 +45,7 @@ gp102_gr = {
.
init
=
gp100_gr_init
,
.
init_gpc_mmu
=
gm200_gr_init_gpc_mmu
,
.
init_vsc_stream_master
=
gk104_gr_init_vsc_stream_master
,
.
init_zcull
=
gf117_gr_init_zcull
,
.
init_rop_active_fbps
=
gp100_gr_init_rop_active_fbps
,
.
init_ppc_exceptions
=
gk104_gr_init_ppc_exceptions
,
.
init_swdx_pes_mask
=
gp102_gr_init_swdx_pes_mask
,
...
...
drivers/gpu/drm/nouveau/nvkm/engine/gr/gp107.c
浏览文件 @
02917aa3
...
...
@@ -31,6 +31,7 @@ gp107_gr = {
.
init
=
gp100_gr_init
,
.
init_gpc_mmu
=
gm200_gr_init_gpc_mmu
,
.
init_vsc_stream_master
=
gk104_gr_init_vsc_stream_master
,
.
init_zcull
=
gf117_gr_init_zcull
,
.
init_rop_active_fbps
=
gp100_gr_init_rop_active_fbps
,
.
init_ppc_exceptions
=
gk104_gr_init_ppc_exceptions
,
.
init_swdx_pes_mask
=
gp102_gr_init_swdx_pes_mask
,
...
...
drivers/gpu/drm/nouveau/nvkm/engine/gr/gp10b.c
浏览文件 @
02917aa3
...
...
@@ -38,6 +38,7 @@ gp10b_gr = {
.
init
=
gp100_gr_init
,
.
init_gpc_mmu
=
gm200_gr_init_gpc_mmu
,
.
init_vsc_stream_master
=
gk104_gr_init_vsc_stream_master
,
.
init_zcull
=
gf117_gr_init_zcull
,
.
init_rop_active_fbps
=
gp100_gr_init_rop_active_fbps
,
.
init_ppc_exceptions
=
gk104_gr_init_ppc_exceptions
,
.
init_num_active_ltcs
=
gp10b_gr_init_num_active_ltcs
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录