Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
227c95d9
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看板
提交
227c95d9
编写于
8月 20, 2015
作者:
B
Ben Skeggs
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/nouveau/gr: directly use instmem where currently possible
Signed-off-by:
N
Ben Skeggs
<
bskeggs@redhat.com
>
上级
358ce601
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
87 addition
and
63 deletion
+87
-63
drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgf100.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgf100.c
+15
-12
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c
+29
-19
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.h
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.h
+4
-4
drivers/gpu/drm/nouveau/nvkm/engine/gr/gk104.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gk104.c
+2
-2
drivers/gpu/drm/nouveau/nvkm/engine/gr/gk20a.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gk20a.c
+2
-2
drivers/gpu/drm/nouveau/nvkm/engine/gr/gm107.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gm107.c
+2
-2
drivers/gpu/drm/nouveau/nvkm/engine/gr/gm204.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gm204.c
+4
-4
drivers/gpu/drm/nouveau/nvkm/engine/gr/nv20.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/nv20.c
+6
-4
drivers/gpu/drm/nouveau/nvkm/engine/gr/nv20.h
drivers/gpu/drm/nouveau/nvkm/engine/gr/nv20.h
+1
-1
drivers/gpu/drm/nouveau/nvkm/engine/gr/nv25.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/nv25.c
+3
-2
drivers/gpu/drm/nouveau/nvkm/engine/gr/nv2a.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/nv2a.c
+3
-2
drivers/gpu/drm/nouveau/nvkm/engine/gr/nv30.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/nv30.c
+5
-3
drivers/gpu/drm/nouveau/nvkm/engine/gr/nv34.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/nv34.c
+3
-2
drivers/gpu/drm/nouveau/nvkm/engine/gr/nv35.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/nv35.c
+3
-2
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/base.c
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/base.c
+5
-2
未找到文件。
drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgf100.c
浏览文件 @
227c95d9
...
@@ -1272,34 +1272,37 @@ gf100_grctx_generate(struct gf100_gr *gr)
...
@@ -1272,34 +1272,37 @@ gf100_grctx_generate(struct gf100_gr *gr)
struct
gf100_grctx_oclass
*
oclass
=
(
void
*
)
nv_engine
(
gr
)
->
cclass
;
struct
gf100_grctx_oclass
*
oclass
=
(
void
*
)
nv_engine
(
gr
)
->
cclass
;
struct
nvkm_subdev
*
subdev
=
&
gr
->
base
.
engine
.
subdev
;
struct
nvkm_subdev
*
subdev
=
&
gr
->
base
.
engine
.
subdev
;
struct
nvkm_device
*
device
=
subdev
->
device
;
struct
nvkm_device
*
device
=
subdev
->
device
;
struct
nvkm_
gpuobj
*
chan
;
struct
nvkm_
memory
*
chan
;
struct
gf100_grctx
info
;
struct
gf100_grctx
info
;
int
ret
,
i
;
int
ret
,
i
;
u64
addr
;
/* allocate memory to for a "channel", which we'll use to generate
/* allocate memory to for a "channel", which we'll use to generate
* the default context values
* the default context values
*/
*/
ret
=
nvkm_
gpuobj_new
(
nv_object
(
gr
),
NULL
,
0x80000
+
gr
->
size
,
ret
=
nvkm_
memory_new
(
device
,
NVKM_MEM_TARGET_INST
,
0x80000
+
gr
->
size
,
0x1000
,
NVOBJ_FLAG_ZERO_ALLOC
,
&
chan
);
0x1000
,
true
,
&
chan
);
if
(
ret
)
{
if
(
ret
)
{
nvkm_error
(
subdev
,
"failed to allocate chan memory, %d
\n
"
,
ret
);
nvkm_error
(
subdev
,
"failed to allocate chan memory, %d
\n
"
,
ret
);
return
ret
;
return
ret
;
}
}
addr
=
nvkm_memory_addr
(
chan
);
/* PGD pointer */
/* PGD pointer */
nvkm_kmap
(
chan
);
nvkm_kmap
(
chan
);
nvkm_wo32
(
chan
,
0x0200
,
lower_32_bits
(
chan
->
addr
+
0x1000
));
nvkm_wo32
(
chan
,
0x0200
,
lower_32_bits
(
addr
+
0x1000
));
nvkm_wo32
(
chan
,
0x0204
,
upper_32_bits
(
chan
->
addr
+
0x1000
));
nvkm_wo32
(
chan
,
0x0204
,
upper_32_bits
(
addr
+
0x1000
));
nvkm_wo32
(
chan
,
0x0208
,
0xffffffff
);
nvkm_wo32
(
chan
,
0x0208
,
0xffffffff
);
nvkm_wo32
(
chan
,
0x020c
,
0x000000ff
);
nvkm_wo32
(
chan
,
0x020c
,
0x000000ff
);
/* PGT[0] pointer */
/* PGT[0] pointer */
nvkm_wo32
(
chan
,
0x1000
,
0x00000000
);
nvkm_wo32
(
chan
,
0x1000
,
0x00000000
);
nvkm_wo32
(
chan
,
0x1004
,
0x00000001
|
(
chan
->
addr
+
0x2000
)
>>
8
);
nvkm_wo32
(
chan
,
0x1004
,
0x00000001
|
(
addr
+
0x2000
)
>>
8
);
/* identity-map the whole "channel" into its own vm */
/* identity-map the whole "channel" into its own vm */
for
(
i
=
0
;
i
<
chan
->
size
/
4096
;
i
++
)
{
for
(
i
=
0
;
i
<
nvkm_memory_size
(
chan
)
/
4096
;
i
++
)
{
u64
addr
=
((
chan
->
addr
+
(
i
*
4096
))
>>
8
)
|
1
;
u64
addr
=
((
nvkm_memory_addr
(
chan
)
+
(
i
*
4096
))
>>
8
)
|
1
;
nvkm_wo32
(
chan
,
0x2000
+
(
i
*
8
),
lower_32_bits
(
addr
));
nvkm_wo32
(
chan
,
0x2000
+
(
i
*
8
),
lower_32_bits
(
addr
));
nvkm_wo32
(
chan
,
0x2004
+
(
i
*
8
),
upper_32_bits
(
addr
));
nvkm_wo32
(
chan
,
0x2004
+
(
i
*
8
),
upper_32_bits
(
addr
));
}
}
...
@@ -1309,7 +1312,7 @@ gf100_grctx_generate(struct gf100_gr *gr)
...
@@ -1309,7 +1312,7 @@ gf100_grctx_generate(struct gf100_gr *gr)
nvkm_wo32
(
chan
,
0x0214
,
0x00000000
);
nvkm_wo32
(
chan
,
0x0214
,
0x00000000
);
nvkm_done
(
chan
);
nvkm_done
(
chan
);
nvkm_wr32
(
device
,
0x100cb8
,
(
chan
->
addr
+
0x1000
)
>>
8
);
nvkm_wr32
(
device
,
0x100cb8
,
(
addr
+
0x1000
)
>>
8
);
nvkm_wr32
(
device
,
0x100cbc
,
0x80000001
);
nvkm_wr32
(
device
,
0x100cbc
,
0x80000001
);
nvkm_msec
(
device
,
2000
,
nvkm_msec
(
device
,
2000
,
if
(
nvkm_rd32
(
device
,
0x100c80
)
&
0x00008000
)
if
(
nvkm_rd32
(
device
,
0x100c80
)
&
0x00008000
)
...
@@ -1326,7 +1329,7 @@ gf100_grctx_generate(struct gf100_gr *gr)
...
@@ -1326,7 +1329,7 @@ gf100_grctx_generate(struct gf100_gr *gr)
/* make channel current */
/* make channel current */
if
(
gr
->
firmware
)
{
if
(
gr
->
firmware
)
{
nvkm_wr32
(
device
,
0x409840
,
0x00000030
);
nvkm_wr32
(
device
,
0x409840
,
0x00000030
);
nvkm_wr32
(
device
,
0x409500
,
0x80000000
|
chan
->
addr
>>
12
);
nvkm_wr32
(
device
,
0x409500
,
0x80000000
|
addr
>>
12
);
nvkm_wr32
(
device
,
0x409504
,
0x00000003
);
nvkm_wr32
(
device
,
0x409504
,
0x00000003
);
nvkm_msec
(
device
,
2000
,
nvkm_msec
(
device
,
2000
,
if
(
nvkm_rd32
(
device
,
0x409800
)
&
0x00000010
)
if
(
nvkm_rd32
(
device
,
0x409800
)
&
0x00000010
)
...
@@ -1341,7 +1344,7 @@ gf100_grctx_generate(struct gf100_gr *gr)
...
@@ -1341,7 +1344,7 @@ gf100_grctx_generate(struct gf100_gr *gr)
nvkm_done
(
chan
);
nvkm_done
(
chan
);
}
else
{
}
else
{
nvkm_wr32
(
device
,
0x409840
,
0x80000000
);
nvkm_wr32
(
device
,
0x409840
,
0x80000000
);
nvkm_wr32
(
device
,
0x409500
,
0x80000000
|
chan
->
addr
>>
12
);
nvkm_wr32
(
device
,
0x409500
,
0x80000000
|
addr
>>
12
);
nvkm_wr32
(
device
,
0x409504
,
0x00000001
);
nvkm_wr32
(
device
,
0x409504
,
0x00000001
);
nvkm_msec
(
device
,
2000
,
nvkm_msec
(
device
,
2000
,
if
(
nvkm_rd32
(
device
,
0x409800
)
&
0x80000000
)
if
(
nvkm_rd32
(
device
,
0x409800
)
&
0x80000000
)
...
@@ -1376,7 +1379,7 @@ gf100_grctx_generate(struct gf100_gr *gr)
...
@@ -1376,7 +1379,7 @@ gf100_grctx_generate(struct gf100_gr *gr)
}
}
done:
done:
nvkm_
gpuobj_ref
(
NULL
,
&
chan
);
nvkm_
memory_del
(
&
chan
);
return
ret
;
return
ret
;
}
}
...
...
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c
浏览文件 @
227c95d9
...
@@ -283,6 +283,7 @@ gf100_gr_context_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
...
@@ -283,6 +283,7 @@ gf100_gr_context_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
struct
gf100_gr_data
*
data
=
gr
->
mmio_data
;
struct
gf100_gr_data
*
data
=
gr
->
mmio_data
;
struct
gf100_gr_mmio
*
mmio
=
gr
->
mmio_list
;
struct
gf100_gr_mmio
*
mmio
=
gr
->
mmio_list
;
struct
gf100_gr_chan
*
chan
;
struct
gf100_gr_chan
*
chan
;
struct
nvkm_device
*
device
=
gr
->
base
.
engine
.
subdev
.
device
;
struct
nvkm_gpuobj
*
image
;
struct
nvkm_gpuobj
*
image
;
int
ret
,
i
;
int
ret
,
i
;
...
@@ -298,29 +299,32 @@ gf100_gr_context_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
...
@@ -298,29 +299,32 @@ gf100_gr_context_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
* fuc to modify some per-context register settings on first load
* fuc to modify some per-context register settings on first load
* of the context.
* of the context.
*/
*/
ret
=
nvkm_
gpuobj_new
(
nv_object
(
chan
),
NULL
,
0x1000
,
0x100
,
0
,
ret
=
nvkm_
memory_new
(
device
,
NVKM_MEM_TARGET_INST
,
0x1000
,
0x10
0
,
&
chan
->
mmio
);
false
,
&
chan
->
mmio
);
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
ret
=
nvkm_gpuobj_map_vm
(
nv_gpuobj
(
chan
->
mmio
),
vm
,
ret
=
nvkm_vm_get
(
vm
,
0x1000
,
12
,
NV_MEM_ACCESS_RW
|
NV_MEM_ACCESS_RW
|
NV_MEM_ACCESS_SYS
,
NV_MEM_ACCESS_SYS
,
&
chan
->
mmio_vma
);
&
chan
->
mmio_vma
);
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
nvkm_memory_map
(
chan
->
mmio
,
&
chan
->
mmio_vma
,
0
);
/* allocate buffers referenced by mmio list */
/* allocate buffers referenced by mmio list */
for
(
i
=
0
;
data
->
size
&&
i
<
ARRAY_SIZE
(
gr
->
mmio_data
);
i
++
)
{
for
(
i
=
0
;
data
->
size
&&
i
<
ARRAY_SIZE
(
gr
->
mmio_data
);
i
++
)
{
ret
=
nvkm_gpuobj_new
(
nv_object
(
chan
),
NULL
,
data
->
size
,
ret
=
nvkm_memory_new
(
device
,
NVKM_MEM_TARGET_INST
,
data
->
align
,
0
,
&
chan
->
data
[
i
].
mem
);
data
->
size
,
data
->
align
,
false
,
&
chan
->
data
[
i
].
mem
);
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
ret
=
nvkm_
gpuobj_map_vm
(
chan
->
data
[
i
].
mem
,
vm
,
data
->
access
,
ret
=
nvkm_
vm_get
(
vm
,
nvkm_memory_size
(
chan
->
data
[
i
].
mem
)
,
&
chan
->
data
[
i
].
vma
);
12
,
data
->
access
,
&
chan
->
data
[
i
].
vma
);
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
nvkm_memory_map
(
chan
->
data
[
i
].
mem
,
&
chan
->
data
[
i
].
vma
,
0
);
data
++
;
data
++
;
}
}
...
@@ -372,12 +376,18 @@ gf100_gr_context_dtor(struct nvkm_object *object)
...
@@ -372,12 +376,18 @@ gf100_gr_context_dtor(struct nvkm_object *object)
int
i
;
int
i
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
chan
->
data
);
i
++
)
{
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
chan
->
data
);
i
++
)
{
nvkm_gpuobj_unmap
(
&
chan
->
data
[
i
].
vma
);
if
(
chan
->
data
[
i
].
vma
.
node
)
{
nvkm_gpuobj_ref
(
NULL
,
&
chan
->
data
[
i
].
mem
);
nvkm_vm_unmap
(
&
chan
->
data
[
i
].
vma
);
nvkm_vm_put
(
&
chan
->
data
[
i
].
vma
);
}
nvkm_memory_del
(
&
chan
->
data
[
i
].
mem
);
}
}
nvkm_gpuobj_unmap
(
&
chan
->
mmio_vma
);
if
(
chan
->
mmio_vma
.
node
)
{
nvkm_gpuobj_ref
(
NULL
,
&
chan
->
mmio
);
nvkm_vm_unmap
(
&
chan
->
mmio_vma
);
nvkm_vm_put
(
&
chan
->
mmio_vma
);
}
nvkm_memory_del
(
&
chan
->
mmio
);
nvkm_gr_context_destroy
(
&
chan
->
base
);
nvkm_gr_context_destroy
(
&
chan
->
base
);
}
}
...
@@ -1490,8 +1500,8 @@ gf100_gr_init(struct nvkm_object *object)
...
@@ -1490,8 +1500,8 @@ gf100_gr_init(struct nvkm_object *object)
nvkm_wr32
(
device
,
GPC_BCAST
(
0x088c
),
0x00000000
);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x088c
),
0x00000000
);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x0890
),
0x00000000
);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x0890
),
0x00000000
);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x0894
),
0x00000000
);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x0894
),
0x00000000
);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x08b4
),
gr
->
unk4188b4
->
addr
>>
8
);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x08b4
),
nvkm_memory_addr
(
gr
->
unk4188b4
)
>>
8
);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x08b8
),
gr
->
unk4188b8
->
addr
>>
8
);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x08b8
),
nvkm_memory_addr
(
gr
->
unk4188b8
)
>>
8
);
gf100_gr_mmio
(
gr
,
oclass
->
mmio
);
gf100_gr_mmio
(
gr
,
oclass
->
mmio
);
...
@@ -1634,8 +1644,8 @@ gf100_gr_dtor(struct nvkm_object *object)
...
@@ -1634,8 +1644,8 @@ gf100_gr_dtor(struct nvkm_object *object)
gf100_gr_dtor_fw
(
&
gr
->
fuc41ac
);
gf100_gr_dtor_fw
(
&
gr
->
fuc41ac
);
gf100_gr_dtor_fw
(
&
gr
->
fuc41ad
);
gf100_gr_dtor_fw
(
&
gr
->
fuc41ad
);
nvkm_
gpuobj_ref
(
NULL
,
&
gr
->
unk4188b8
);
nvkm_
memory_del
(
&
gr
->
unk4188b8
);
nvkm_
gpuobj_ref
(
NULL
,
&
gr
->
unk4188b4
);
nvkm_
memory_del
(
&
gr
->
unk4188b4
);
nvkm_gr_destroy
(
&
gr
->
base
);
nvkm_gr_destroy
(
&
gr
->
base
);
}
}
...
@@ -1675,12 +1685,12 @@ gf100_gr_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
...
@@ -1675,12 +1685,12 @@ gf100_gr_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
gr
->
firmware
=
true
;
gr
->
firmware
=
true
;
}
}
ret
=
nvkm_
gpuobj_new
(
nv_object
(
gr
),
NULL
,
0x1000
,
256
,
0
,
ret
=
nvkm_
memory_new
(
device
,
NVKM_MEM_TARGET_INST
,
0x1000
,
256
,
false
,
&
gr
->
unk4188b4
);
&
gr
->
unk4188b4
);
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
ret
=
nvkm_
gpuobj_new
(
nv_object
(
gr
),
NULL
,
0x1000
,
256
,
0
,
ret
=
nvkm_
memory_new
(
device
,
NVKM_MEM_TARGET_INST
,
0x1000
,
256
,
false
,
&
gr
->
unk4188b8
);
&
gr
->
unk4188b8
);
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
...
...
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.h
浏览文件 @
227c95d9
...
@@ -95,8 +95,8 @@ struct gf100_gr {
...
@@ -95,8 +95,8 @@ struct gf100_gr {
u8
ppc_nr
[
GPC_MAX
];
u8
ppc_nr
[
GPC_MAX
];
u8
ppc_tpc_nr
[
GPC_MAX
][
4
];
u8
ppc_tpc_nr
[
GPC_MAX
][
4
];
struct
nvkm_
gpuobj
*
unk4188b4
;
struct
nvkm_
memory
*
unk4188b4
;
struct
nvkm_
gpuobj
*
unk4188b8
;
struct
nvkm_
memory
*
unk4188b8
;
struct
gf100_gr_data
mmio_data
[
4
];
struct
gf100_gr_data
mmio_data
[
4
];
struct
gf100_gr_mmio
mmio_list
[
4096
/
8
];
struct
gf100_gr_mmio
mmio_list
[
4096
/
8
];
...
@@ -109,11 +109,11 @@ struct gf100_gr {
...
@@ -109,11 +109,11 @@ struct gf100_gr {
struct
gf100_gr_chan
{
struct
gf100_gr_chan
{
struct
nvkm_gr_chan
base
;
struct
nvkm_gr_chan
base
;
struct
nvkm_
gpuobj
*
mmio
;
struct
nvkm_
memory
*
mmio
;
struct
nvkm_vma
mmio_vma
;
struct
nvkm_vma
mmio_vma
;
int
mmio_nr
;
int
mmio_nr
;
struct
{
struct
{
struct
nvkm_
gpuobj
*
mem
;
struct
nvkm_
memory
*
mem
;
struct
nvkm_vma
vma
;
struct
nvkm_vma
vma
;
}
data
[
4
];
}
data
[
4
];
};
};
...
...
drivers/gpu/drm/nouveau/nvkm/engine/gr/gk104.c
浏览文件 @
227c95d9
...
@@ -218,8 +218,8 @@ gk104_gr_init(struct nvkm_object *object)
...
@@ -218,8 +218,8 @@ gk104_gr_init(struct nvkm_object *object)
nvkm_wr32
(
device
,
GPC_BCAST
(
0x088c
),
0x00000000
);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x088c
),
0x00000000
);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x0890
),
0x00000000
);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x0890
),
0x00000000
);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x0894
),
0x00000000
);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x0894
),
0x00000000
);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x08b4
),
gr
->
unk4188b4
->
addr
>>
8
);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x08b4
),
nvkm_memory_addr
(
gr
->
unk4188b4
)
>>
8
);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x08b8
),
gr
->
unk4188b8
->
addr
>>
8
);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x08b8
),
nvkm_memory_addr
(
gr
->
unk4188b8
)
>>
8
);
gf100_gr_mmio
(
gr
,
oclass
->
mmio
);
gf100_gr_mmio
(
gr
,
oclass
->
mmio
);
...
...
drivers/gpu/drm/nouveau/nvkm/engine/gr/gk20a.c
浏览文件 @
227c95d9
...
@@ -280,8 +280,8 @@ gk20a_gr_init(struct nvkm_object *object)
...
@@ -280,8 +280,8 @@ gk20a_gr_init(struct nvkm_object *object)
return
ret
;
return
ret
;
/* MMU debug buffer */
/* MMU debug buffer */
nvkm_wr32
(
device
,
0x100cc8
,
gr
->
unk4188b4
->
addr
>>
8
);
nvkm_wr32
(
device
,
0x100cc8
,
nvkm_memory_addr
(
gr
->
unk4188b4
)
>>
8
);
nvkm_wr32
(
device
,
0x100ccc
,
gr
->
unk4188b8
->
addr
>>
8
);
nvkm_wr32
(
device
,
0x100ccc
,
nvkm_memory_addr
(
gr
->
unk4188b8
)
>>
8
);
if
(
oclass
->
init_gpc_mmu
)
if
(
oclass
->
init_gpc_mmu
)
oclass
->
init_gpc_mmu
(
gr
);
oclass
->
init_gpc_mmu
(
gr
);
...
...
drivers/gpu/drm/nouveau/nvkm/engine/gr/gm107.c
浏览文件 @
227c95d9
...
@@ -339,8 +339,8 @@ gm107_gr_init(struct nvkm_object *object)
...
@@ -339,8 +339,8 @@ gm107_gr_init(struct nvkm_object *object)
nvkm_wr32
(
device
,
GPC_BCAST
(
0x0880
),
0x00000000
);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x0880
),
0x00000000
);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x0890
),
0x00000000
);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x0890
),
0x00000000
);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x0894
),
0x00000000
);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x0894
),
0x00000000
);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x08b4
),
gr
->
unk4188b4
->
addr
>>
8
);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x08b4
),
nvkm_memory_addr
(
gr
->
unk4188b4
)
>>
8
);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x08b8
),
gr
->
unk4188b8
->
addr
>>
8
);
nvkm_wr32
(
device
,
GPC_BCAST
(
0x08b8
),
nvkm_memory_addr
(
gr
->
unk4188b8
)
>>
8
);
gf100_gr_mmio
(
gr
,
oclass
->
mmio
);
gf100_gr_mmio
(
gr
,
oclass
->
mmio
);
...
...
drivers/gpu/drm/nouveau/nvkm/engine/gr/gm204.c
浏览文件 @
227c95d9
...
@@ -269,13 +269,13 @@ gm204_gr_init(struct nvkm_object *object)
...
@@ -269,13 +269,13 @@ gm204_gr_init(struct nvkm_object *object)
nvkm_wr32
(
device
,
0x418880
,
0x00001000
|
(
tmp
&
0x00000fff
));
nvkm_wr32
(
device
,
0x418880
,
0x00001000
|
(
tmp
&
0x00000fff
));
nvkm_wr32
(
device
,
0x418890
,
0x00000000
);
nvkm_wr32
(
device
,
0x418890
,
0x00000000
);
nvkm_wr32
(
device
,
0x418894
,
0x00000000
);
nvkm_wr32
(
device
,
0x418894
,
0x00000000
);
nvkm_wr32
(
device
,
0x4188b4
,
gr
->
unk4188b4
->
addr
>>
8
);
nvkm_wr32
(
device
,
0x4188b4
,
nvkm_memory_addr
(
gr
->
unk4188b4
)
>>
8
);
nvkm_wr32
(
device
,
0x4188b8
,
gr
->
unk4188b8
->
addr
>>
8
);
nvkm_wr32
(
device
,
0x4188b8
,
nvkm_memory_addr
(
gr
->
unk4188b8
)
>>
8
);
nvkm_mask
(
device
,
0x4188b0
,
0x00040000
,
0x00040000
);
nvkm_mask
(
device
,
0x4188b0
,
0x00040000
,
0x00040000
);
/*XXX: belongs in fb */
/*XXX: belongs in fb */
nvkm_wr32
(
device
,
0x100cc8
,
gr
->
unk4188b4
->
addr
>>
8
);
nvkm_wr32
(
device
,
0x100cc8
,
nvkm_memory_addr
(
gr
->
unk4188b4
)
>>
8
);
nvkm_wr32
(
device
,
0x100ccc
,
gr
->
unk4188b8
->
addr
>>
8
);
nvkm_wr32
(
device
,
0x100ccc
,
nvkm_memory_addr
(
gr
->
unk4188b8
)
>>
8
);
nvkm_mask
(
device
,
0x100cc4
,
0x00040000
,
0x00040000
);
nvkm_mask
(
device
,
0x100cc4
,
0x00040000
,
0x00040000
);
gf100_gr_mmio
(
gr
,
oclass
->
mmio
);
gf100_gr_mmio
(
gr
,
oclass
->
mmio
);
...
...
drivers/gpu/drm/nouveau/nvkm/engine/gr/nv20.c
浏览文件 @
227c95d9
...
@@ -249,6 +249,7 @@ nv20_gr_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
...
@@ -249,6 +249,7 @@ nv20_gr_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
struct
nvkm_oclass
*
oclass
,
void
*
data
,
u32
size
,
struct
nvkm_oclass
*
oclass
,
void
*
data
,
u32
size
,
struct
nvkm_object
**
pobject
)
struct
nvkm_object
**
pobject
)
{
{
struct
nvkm_device
*
device
=
(
void
*
)
parent
;
struct
nv20_gr
*
gr
;
struct
nv20_gr
*
gr
;
int
ret
;
int
ret
;
...
@@ -257,8 +258,8 @@ nv20_gr_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
...
@@ -257,8 +258,8 @@ nv20_gr_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
ret
=
nvkm_
gpuobj_new
(
nv_object
(
gr
),
NULL
,
32
*
4
,
16
,
ret
=
nvkm_
memory_new
(
device
,
NVKM_MEM_TARGET_INST
,
32
*
4
,
16
,
true
,
NVOBJ_FLAG_ZERO_ALLOC
,
&
gr
->
ctxtab
);
&
gr
->
ctxtab
);
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
...
@@ -274,7 +275,7 @@ void
...
@@ -274,7 +275,7 @@ void
nv20_gr_dtor
(
struct
nvkm_object
*
object
)
nv20_gr_dtor
(
struct
nvkm_object
*
object
)
{
{
struct
nv20_gr
*
gr
=
(
void
*
)
object
;
struct
nv20_gr
*
gr
=
(
void
*
)
object
;
nvkm_
gpuobj_ref
(
NULL
,
&
gr
->
ctxtab
);
nvkm_
memory_del
(
&
gr
->
ctxtab
);
nvkm_gr_destroy
(
&
gr
->
base
);
nvkm_gr_destroy
(
&
gr
->
base
);
}
}
...
@@ -292,7 +293,8 @@ nv20_gr_init(struct nvkm_object *object)
...
@@ -292,7 +293,8 @@ nv20_gr_init(struct nvkm_object *object)
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
nvkm_wr32
(
device
,
NV20_PGRAPH_CHANNEL_CTX_TABLE
,
gr
->
ctxtab
->
addr
>>
4
);
nvkm_wr32
(
device
,
NV20_PGRAPH_CHANNEL_CTX_TABLE
,
nvkm_memory_addr
(
gr
->
ctxtab
)
>>
4
);
if
(
nv_device
(
gr
)
->
chipset
==
0x20
)
{
if
(
nv_device
(
gr
)
->
chipset
==
0x20
)
{
nvkm_wr32
(
device
,
NV10_PGRAPH_RDI_INDEX
,
0x003d0000
);
nvkm_wr32
(
device
,
NV10_PGRAPH_RDI_INDEX
,
0x003d0000
);
...
...
drivers/gpu/drm/nouveau/nvkm/engine/gr/nv20.h
浏览文件 @
227c95d9
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
struct
nv20_gr
{
struct
nv20_gr
{
struct
nvkm_gr
base
;
struct
nvkm_gr
base
;
struct
nvkm_
gpuobj
*
ctxtab
;
struct
nvkm_
memory
*
ctxtab
;
};
};
struct
nv20_gr_chan
{
struct
nv20_gr_chan
{
...
...
drivers/gpu/drm/nouveau/nvkm/engine/gr/nv25.c
浏览文件 @
227c95d9
...
@@ -129,6 +129,7 @@ nv25_gr_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
...
@@ -129,6 +129,7 @@ nv25_gr_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
struct
nvkm_oclass
*
oclass
,
void
*
data
,
u32
size
,
struct
nvkm_oclass
*
oclass
,
void
*
data
,
u32
size
,
struct
nvkm_object
**
pobject
)
struct
nvkm_object
**
pobject
)
{
{
struct
nvkm_device
*
device
=
(
void
*
)
parent
;
struct
nv20_gr
*
gr
;
struct
nv20_gr
*
gr
;
int
ret
;
int
ret
;
...
@@ -137,8 +138,8 @@ nv25_gr_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
...
@@ -137,8 +138,8 @@ nv25_gr_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
ret
=
nvkm_
gpuobj_new
(
nv_object
(
gr
),
NULL
,
32
*
4
,
16
,
ret
=
nvkm_
memory_new
(
device
,
NVKM_MEM_TARGET_INST
,
32
*
4
,
16
,
true
,
NVOBJ_FLAG_ZERO_ALLOC
,
&
gr
->
ctxtab
);
&
gr
->
ctxtab
);
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
...
...
drivers/gpu/drm/nouveau/nvkm/engine/gr/nv2a.c
浏览文件 @
227c95d9
...
@@ -96,6 +96,7 @@ nv2a_gr_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
...
@@ -96,6 +96,7 @@ nv2a_gr_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
struct
nvkm_oclass
*
oclass
,
void
*
data
,
u32
size
,
struct
nvkm_oclass
*
oclass
,
void
*
data
,
u32
size
,
struct
nvkm_object
**
pobject
)
struct
nvkm_object
**
pobject
)
{
{
struct
nvkm_device
*
device
=
(
void
*
)
parent
;
struct
nv20_gr
*
gr
;
struct
nv20_gr
*
gr
;
int
ret
;
int
ret
;
...
@@ -104,8 +105,8 @@ nv2a_gr_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
...
@@ -104,8 +105,8 @@ nv2a_gr_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
ret
=
nvkm_
gpuobj_new
(
nv_object
(
gr
),
NULL
,
32
*
4
,
16
,
ret
=
nvkm_
memory_new
(
device
,
NVKM_MEM_TARGET_INST
,
32
*
4
,
16
,
true
,
NVOBJ_FLAG_ZERO_ALLOC
,
&
gr
->
ctxtab
);
&
gr
->
ctxtab
);
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
...
...
drivers/gpu/drm/nouveau/nvkm/engine/gr/nv30.c
浏览文件 @
227c95d9
...
@@ -131,6 +131,7 @@ nv30_gr_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
...
@@ -131,6 +131,7 @@ nv30_gr_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
struct
nvkm_oclass
*
oclass
,
void
*
data
,
u32
size
,
struct
nvkm_oclass
*
oclass
,
void
*
data
,
u32
size
,
struct
nvkm_object
**
pobject
)
struct
nvkm_object
**
pobject
)
{
{
struct
nvkm_device
*
device
=
(
void
*
)
parent
;
struct
nv20_gr
*
gr
;
struct
nv20_gr
*
gr
;
int
ret
;
int
ret
;
...
@@ -139,8 +140,8 @@ nv30_gr_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
...
@@ -139,8 +140,8 @@ nv30_gr_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
ret
=
nvkm_
gpuobj_new
(
nv_object
(
gr
),
NULL
,
32
*
4
,
16
,
ret
=
nvkm_
memory_new
(
device
,
NVKM_MEM_TARGET_INST
,
32
*
4
,
16
,
true
,
NVOBJ_FLAG_ZERO_ALLOC
,
&
gr
->
ctxtab
);
&
gr
->
ctxtab
);
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
...
@@ -165,7 +166,8 @@ nv30_gr_init(struct nvkm_object *object)
...
@@ -165,7 +166,8 @@ nv30_gr_init(struct nvkm_object *object)
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
nvkm_wr32
(
device
,
NV20_PGRAPH_CHANNEL_CTX_TABLE
,
gr
->
ctxtab
->
addr
>>
4
);
nvkm_wr32
(
device
,
NV20_PGRAPH_CHANNEL_CTX_TABLE
,
nvkm_memory_addr
(
gr
->
ctxtab
)
>>
4
);
nvkm_wr32
(
device
,
NV03_PGRAPH_INTR
,
0xFFFFFFFF
);
nvkm_wr32
(
device
,
NV03_PGRAPH_INTR
,
0xFFFFFFFF
);
nvkm_wr32
(
device
,
NV03_PGRAPH_INTR_EN
,
0xFFFFFFFF
);
nvkm_wr32
(
device
,
NV03_PGRAPH_INTR_EN
,
0xFFFFFFFF
);
...
...
drivers/gpu/drm/nouveau/nvkm/engine/gr/nv34.c
浏览文件 @
227c95d9
...
@@ -130,6 +130,7 @@ nv34_gr_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
...
@@ -130,6 +130,7 @@ nv34_gr_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
struct
nvkm_oclass
*
oclass
,
void
*
data
,
u32
size
,
struct
nvkm_oclass
*
oclass
,
void
*
data
,
u32
size
,
struct
nvkm_object
**
pobject
)
struct
nvkm_object
**
pobject
)
{
{
struct
nvkm_device
*
device
=
(
void
*
)
parent
;
struct
nv20_gr
*
gr
;
struct
nv20_gr
*
gr
;
int
ret
;
int
ret
;
...
@@ -138,8 +139,8 @@ nv34_gr_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
...
@@ -138,8 +139,8 @@ nv34_gr_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
ret
=
nvkm_
gpuobj_new
(
nv_object
(
gr
),
NULL
,
32
*
4
,
16
,
ret
=
nvkm_
memory_new
(
device
,
NVKM_MEM_TARGET_INST
,
32
*
4
,
16
,
true
,
NVOBJ_FLAG_ZERO_ALLOC
,
&
gr
->
ctxtab
);
&
gr
->
ctxtab
);
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
...
...
drivers/gpu/drm/nouveau/nvkm/engine/gr/nv35.c
浏览文件 @
227c95d9
...
@@ -130,6 +130,7 @@ nv35_gr_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
...
@@ -130,6 +130,7 @@ nv35_gr_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
struct
nvkm_oclass
*
oclass
,
void
*
data
,
u32
size
,
struct
nvkm_oclass
*
oclass
,
void
*
data
,
u32
size
,
struct
nvkm_object
**
pobject
)
struct
nvkm_object
**
pobject
)
{
{
struct
nvkm_device
*
device
=
(
void
*
)
parent
;
struct
nv20_gr
*
gr
;
struct
nv20_gr
*
gr
;
int
ret
;
int
ret
;
...
@@ -138,8 +139,8 @@ nv35_gr_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
...
@@ -138,8 +139,8 @@ nv35_gr_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
ret
=
nvkm_
gpuobj_new
(
nv_object
(
gr
),
NULL
,
32
*
4
,
16
,
ret
=
nvkm_
memory_new
(
device
,
NVKM_MEM_TARGET_INST
,
32
*
4
,
16
,
true
,
NVOBJ_FLAG_ZERO_ALLOC
,
&
gr
->
ctxtab
);
&
gr
->
ctxtab
);
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
...
...
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/base.c
浏览文件 @
227c95d9
...
@@ -321,12 +321,15 @@ nvkm_vm_get(struct nvkm_vm *vm, u64 size, u32 page_shift, u32 access,
...
@@ -321,12 +321,15 @@ nvkm_vm_get(struct nvkm_vm *vm, u64 size, u32 page_shift, u32 access,
void
void
nvkm_vm_put
(
struct
nvkm_vma
*
vma
)
nvkm_vm_put
(
struct
nvkm_vma
*
vma
)
{
{
struct
nvkm_
vm
*
vm
=
vma
->
vm
;
struct
nvkm_
mmu
*
mmu
;
struct
nvkm_
mmu
*
mmu
=
vm
->
mmu
;
struct
nvkm_
vm
*
vm
;
u32
fpde
,
lpde
;
u32
fpde
,
lpde
;
if
(
unlikely
(
vma
->
node
==
NULL
))
if
(
unlikely
(
vma
->
node
==
NULL
))
return
;
return
;
vm
=
vma
->
vm
;
mmu
=
vm
->
mmu
;
fpde
=
(
vma
->
node
->
offset
>>
mmu
->
pgt_bits
);
fpde
=
(
vma
->
node
->
offset
>>
mmu
->
pgt_bits
);
lpde
=
(
vma
->
node
->
offset
+
vma
->
node
->
length
-
1
)
>>
mmu
->
pgt_bits
;
lpde
=
(
vma
->
node
->
offset
+
vma
->
node
->
length
-
1
)
>>
mmu
->
pgt_bits
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录