Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
cd821077
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
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看板
提交
cd821077
编写于
8月 20, 2015
作者:
B
Ben Skeggs
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/nouveau/mmu: switch to gpuobj accessor macros
Signed-off-by:
N
Ben Skeggs
<
bskeggs@redhat.com
>
上级
19187075
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
68 addition
and
38 deletion
+68
-38
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gf100.c
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gf100.c
+16
-8
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/nv04.c
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/nv04.c
+10
-4
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/nv41.c
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/nv41.c
+6
-2
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/nv44.c
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/nv44.c
+20
-16
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/nv50.c
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/nv50.c
+16
-8
未找到文件。
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/gf100.c
浏览文件 @
cd821077
...
...
@@ -79,8 +79,10 @@ gf100_vm_map_pgt(struct nvkm_gpuobj *pgd, u32 index, struct nvkm_gpuobj *pgt[2])
if
(
pgt
[
1
])
pde
[
0
]
=
0x00000001
|
(
pgt
[
1
]
->
addr
>>
8
);
nv_wo32
(
pgd
,
(
index
*
8
)
+
0
,
pde
[
0
]);
nv_wo32
(
pgd
,
(
index
*
8
)
+
4
,
pde
[
1
]);
nvkm_kmap
(
pgd
);
nvkm_wo32
(
pgd
,
(
index
*
8
)
+
0
,
pde
[
0
]);
nvkm_wo32
(
pgd
,
(
index
*
8
)
+
4
,
pde
[
1
]);
nvkm_done
(
pgd
);
}
static
inline
u64
...
...
@@ -114,12 +116,14 @@ gf100_vm_map(struct nvkm_vma *vma, struct nvkm_gpuobj *pgt,
ltc
->
tags_clear
(
ltc
,
tag
,
cnt
);
}
nvkm_kmap
(
pgt
);
while
(
cnt
--
)
{
nv_wo32
(
pgt
,
pte
+
0
,
lower_32_bits
(
phys
));
nv_wo32
(
pgt
,
pte
+
4
,
upper_32_bits
(
phys
));
nv
km
_wo32
(
pgt
,
pte
+
0
,
lower_32_bits
(
phys
));
nv
km
_wo32
(
pgt
,
pte
+
4
,
upper_32_bits
(
phys
));
phys
+=
next
;
pte
+=
8
;
}
nvkm_done
(
pgt
);
}
static
void
...
...
@@ -130,24 +134,28 @@ gf100_vm_map_sg(struct nvkm_vma *vma, struct nvkm_gpuobj *pgt,
/* compressed storage types are invalid for system memory */
u32
memtype
=
gf100_pte_storage_type_map
[
mem
->
memtype
&
0xff
];
nvkm_kmap
(
pgt
);
pte
<<=
3
;
while
(
cnt
--
)
{
u64
phys
=
gf100_vm_addr
(
vma
,
*
list
++
,
memtype
,
target
);
nv_wo32
(
pgt
,
pte
+
0
,
lower_32_bits
(
phys
));
nv_wo32
(
pgt
,
pte
+
4
,
upper_32_bits
(
phys
));
nv
km
_wo32
(
pgt
,
pte
+
0
,
lower_32_bits
(
phys
));
nv
km
_wo32
(
pgt
,
pte
+
4
,
upper_32_bits
(
phys
));
pte
+=
8
;
}
nvkm_done
(
pgt
);
}
static
void
gf100_vm_unmap
(
struct
nvkm_gpuobj
*
pgt
,
u32
pte
,
u32
cnt
)
{
nvkm_kmap
(
pgt
);
pte
<<=
3
;
while
(
cnt
--
)
{
nv_wo32
(
pgt
,
pte
+
0
,
0x00000000
);
nv_wo32
(
pgt
,
pte
+
4
,
0x00000000
);
nv
km
_wo32
(
pgt
,
pte
+
0
,
0x00000000
);
nv
km
_wo32
(
pgt
,
pte
+
4
,
0x00000000
);
pte
+=
8
;
}
nvkm_done
(
pgt
);
}
static
void
...
...
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/nv04.c
浏览文件 @
cd821077
...
...
@@ -37,26 +37,30 @@ nv04_vm_map_sg(struct nvkm_vma *vma, struct nvkm_gpuobj *pgt,
struct
nvkm_mem
*
mem
,
u32
pte
,
u32
cnt
,
dma_addr_t
*
list
)
{
pte
=
0x00008
+
(
pte
*
4
);
nvkm_kmap
(
pgt
);
while
(
cnt
)
{
u32
page
=
PAGE_SIZE
/
NV04_PDMA_PAGE
;
u32
phys
=
(
u32
)
*
list
++
;
while
(
cnt
&&
page
--
)
{
nv_wo32
(
pgt
,
pte
,
phys
|
3
);
nv
km
_wo32
(
pgt
,
pte
,
phys
|
3
);
phys
+=
NV04_PDMA_PAGE
;
pte
+=
4
;
cnt
-=
1
;
}
}
nvkm_done
(
pgt
);
}
static
void
nv04_vm_unmap
(
struct
nvkm_gpuobj
*
pgt
,
u32
pte
,
u32
cnt
)
{
pte
=
0x00008
+
(
pte
*
4
);
nvkm_kmap
(
pgt
);
while
(
cnt
--
)
{
nv_wo32
(
pgt
,
pte
,
0x00000000
);
nv
km
_wo32
(
pgt
,
pte
,
0x00000000
);
pte
+=
4
;
}
nvkm_done
(
pgt
);
}
static
void
...
...
@@ -118,8 +122,10 @@ nv04_mmu_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
if
(
ret
)
return
ret
;
nv_wo32
(
dma
,
0x00000
,
0x0002103d
);
/* PCI, RW, PT, !LN */
nv_wo32
(
dma
,
0x00004
,
NV04_PDMA_SIZE
-
1
);
nvkm_kmap
(
dma
);
nvkm_wo32
(
dma
,
0x00000
,
0x0002103d
);
/* PCI, RW, PT, !LN */
nvkm_wo32
(
dma
,
0x00004
,
NV04_PDMA_SIZE
-
1
);
nvkm_done
(
dma
);
return
0
;
}
...
...
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/nv41.c
浏览文件 @
cd821077
...
...
@@ -39,26 +39,30 @@ nv41_vm_map_sg(struct nvkm_vma *vma, struct nvkm_gpuobj *pgt,
struct
nvkm_mem
*
mem
,
u32
pte
,
u32
cnt
,
dma_addr_t
*
list
)
{
pte
=
pte
*
4
;
nvkm_kmap
(
pgt
);
while
(
cnt
)
{
u32
page
=
PAGE_SIZE
/
NV41_GART_PAGE
;
u64
phys
=
(
u64
)
*
list
++
;
while
(
cnt
&&
page
--
)
{
nv_wo32
(
pgt
,
pte
,
(
phys
>>
7
)
|
1
);
nv
km
_wo32
(
pgt
,
pte
,
(
phys
>>
7
)
|
1
);
phys
+=
NV41_GART_PAGE
;
pte
+=
4
;
cnt
-=
1
;
}
}
nvkm_done
(
pgt
);
}
static
void
nv41_vm_unmap
(
struct
nvkm_gpuobj
*
pgt
,
u32
pte
,
u32
cnt
)
{
pte
=
pte
*
4
;
nvkm_kmap
(
pgt
);
while
(
cnt
--
)
{
nv_wo32
(
pgt
,
pte
,
0x00000000
);
nv
km
_wo32
(
pgt
,
pte
,
0x00000000
);
pte
+=
4
;
}
nvkm_done
(
pgt
);
}
static
void
...
...
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/nv44.c
浏览文件 @
cd821077
...
...
@@ -41,10 +41,10 @@ nv44_vm_fill(struct nvkm_gpuobj *pgt, dma_addr_t null,
u32
base
=
(
pte
<<
2
)
&
~
0x0000000f
;
u32
tmp
[
4
];
tmp
[
0
]
=
nv_ro32
(
pgt
,
base
+
0x0
);
tmp
[
1
]
=
nv_ro32
(
pgt
,
base
+
0x4
);
tmp
[
2
]
=
nv_ro32
(
pgt
,
base
+
0x8
);
tmp
[
3
]
=
nv_ro32
(
pgt
,
base
+
0xc
);
tmp
[
0
]
=
nv
km
_ro32
(
pgt
,
base
+
0x0
);
tmp
[
1
]
=
nv
km
_ro32
(
pgt
,
base
+
0x4
);
tmp
[
2
]
=
nv
km
_ro32
(
pgt
,
base
+
0x8
);
tmp
[
3
]
=
nv
km
_ro32
(
pgt
,
base
+
0xc
);
while
(
cnt
--
)
{
u32
addr
=
list
?
(
*
list
++
>>
12
)
:
(
null
>>
12
);
...
...
@@ -74,10 +74,10 @@ nv44_vm_fill(struct nvkm_gpuobj *pgt, dma_addr_t null,
}
}
nv_wo32
(
pgt
,
base
+
0x0
,
tmp
[
0
]);
nv_wo32
(
pgt
,
base
+
0x4
,
tmp
[
1
]);
nv_wo32
(
pgt
,
base
+
0x8
,
tmp
[
2
]);
nv_wo32
(
pgt
,
base
+
0xc
,
tmp
[
3
]
|
0x40000000
);
nv
km
_wo32
(
pgt
,
base
+
0x0
,
tmp
[
0
]);
nv
km
_wo32
(
pgt
,
base
+
0x4
,
tmp
[
1
]);
nv
km
_wo32
(
pgt
,
base
+
0x8
,
tmp
[
2
]);
nv
km
_wo32
(
pgt
,
base
+
0xc
,
tmp
[
3
]
|
0x40000000
);
}
static
void
...
...
@@ -88,6 +88,7 @@ nv44_vm_map_sg(struct nvkm_vma *vma, struct nvkm_gpuobj *pgt,
u32
tmp
[
4
];
int
i
;
nvkm_kmap
(
pgt
);
if
(
pte
&
3
)
{
u32
max
=
4
-
(
pte
&
3
);
u32
part
=
(
cnt
>
max
)
?
max
:
cnt
;
...
...
@@ -100,15 +101,16 @@ nv44_vm_map_sg(struct nvkm_vma *vma, struct nvkm_gpuobj *pgt,
while
(
cnt
>=
4
)
{
for
(
i
=
0
;
i
<
4
;
i
++
)
tmp
[
i
]
=
*
list
++
>>
12
;
nv_wo32
(
pgt
,
pte
++
*
4
,
tmp
[
0
]
>>
0
|
tmp
[
1
]
<<
27
);
nv_wo32
(
pgt
,
pte
++
*
4
,
tmp
[
1
]
>>
5
|
tmp
[
2
]
<<
22
);
nv_wo32
(
pgt
,
pte
++
*
4
,
tmp
[
2
]
>>
10
|
tmp
[
3
]
<<
17
);
nv_wo32
(
pgt
,
pte
++
*
4
,
tmp
[
3
]
>>
15
|
0x40000000
);
nv
km
_wo32
(
pgt
,
pte
++
*
4
,
tmp
[
0
]
>>
0
|
tmp
[
1
]
<<
27
);
nv
km
_wo32
(
pgt
,
pte
++
*
4
,
tmp
[
1
]
>>
5
|
tmp
[
2
]
<<
22
);
nv
km
_wo32
(
pgt
,
pte
++
*
4
,
tmp
[
2
]
>>
10
|
tmp
[
3
]
<<
17
);
nv
km
_wo32
(
pgt
,
pte
++
*
4
,
tmp
[
3
]
>>
15
|
0x40000000
);
cnt
-=
4
;
}
if
(
cnt
)
nv44_vm_fill
(
pgt
,
mmu
->
null
,
list
,
pte
,
cnt
);
nvkm_done
(
pgt
);
}
static
void
...
...
@@ -116,6 +118,7 @@ nv44_vm_unmap(struct nvkm_gpuobj *pgt, u32 pte, u32 cnt)
{
struct
nv04_mmu
*
mmu
=
(
void
*
)
nvkm_mmu
(
pgt
);
nvkm_kmap
(
pgt
);
if
(
pte
&
3
)
{
u32
max
=
4
-
(
pte
&
3
);
u32
part
=
(
cnt
>
max
)
?
max
:
cnt
;
...
...
@@ -125,15 +128,16 @@ nv44_vm_unmap(struct nvkm_gpuobj *pgt, u32 pte, u32 cnt)
}
while
(
cnt
>=
4
)
{
nv_wo32
(
pgt
,
pte
++
*
4
,
0x00000000
);
nv_wo32
(
pgt
,
pte
++
*
4
,
0x00000000
);
nv_wo32
(
pgt
,
pte
++
*
4
,
0x00000000
);
nv_wo32
(
pgt
,
pte
++
*
4
,
0x00000000
);
nv
km
_wo32
(
pgt
,
pte
++
*
4
,
0x00000000
);
nv
km
_wo32
(
pgt
,
pte
++
*
4
,
0x00000000
);
nv
km
_wo32
(
pgt
,
pte
++
*
4
,
0x00000000
);
nv
km
_wo32
(
pgt
,
pte
++
*
4
,
0x00000000
);
cnt
-=
4
;
}
if
(
cnt
)
nv44_vm_fill
(
pgt
,
mmu
->
null
,
NULL
,
pte
,
cnt
);
nvkm_done
(
pgt
);
}
static
void
...
...
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/nv50.c
浏览文件 @
cd821077
...
...
@@ -53,8 +53,10 @@ nv50_vm_map_pgt(struct nvkm_gpuobj *pgd, u32 pde, struct nvkm_gpuobj *pgt[2])
phys
|=
0x20
;
}
nv_wo32
(
pgd
,
(
pde
*
8
)
+
0
,
lower_32_bits
(
phys
));
nv_wo32
(
pgd
,
(
pde
*
8
)
+
4
,
upper_32_bits
(
phys
));
nvkm_kmap
(
pgd
);
nvkm_wo32
(
pgd
,
(
pde
*
8
)
+
0
,
lower_32_bits
(
phys
));
nvkm_wo32
(
pgd
,
(
pde
*
8
)
+
4
,
upper_32_bits
(
phys
));
nvkm_done
(
pgd
);
}
static
inline
u64
...
...
@@ -89,6 +91,7 @@ nv50_vm_map(struct nvkm_vma *vma, struct nvkm_gpuobj *pgt,
pte
<<=
3
;
cnt
<<=
3
;
nvkm_kmap
(
pgt
);
while
(
cnt
)
{
u32
offset_h
=
upper_32_bits
(
phys
);
u32
offset_l
=
lower_32_bits
(
phys
);
...
...
@@ -109,12 +112,13 @@ nv50_vm_map(struct nvkm_vma *vma, struct nvkm_gpuobj *pgt,
}
while
(
block
)
{
nv_wo32
(
pgt
,
pte
+
0
,
offset_l
);
nv_wo32
(
pgt
,
pte
+
4
,
offset_h
);
nv
km
_wo32
(
pgt
,
pte
+
0
,
offset_l
);
nv
km
_wo32
(
pgt
,
pte
+
4
,
offset_h
);
pte
+=
8
;
block
-=
8
;
}
}
nvkm_done
(
pgt
);
}
static
void
...
...
@@ -123,23 +127,27 @@ nv50_vm_map_sg(struct nvkm_vma *vma, struct nvkm_gpuobj *pgt,
{
u32
target
=
(
vma
->
access
&
NV_MEM_ACCESS_NOSNOOP
)
?
3
:
2
;
pte
<<=
3
;
nvkm_kmap
(
pgt
);
while
(
cnt
--
)
{
u64
phys
=
vm_addr
(
vma
,
(
u64
)
*
list
++
,
mem
->
memtype
,
target
);
nv_wo32
(
pgt
,
pte
+
0
,
lower_32_bits
(
phys
));
nv_wo32
(
pgt
,
pte
+
4
,
upper_32_bits
(
phys
));
nv
km
_wo32
(
pgt
,
pte
+
0
,
lower_32_bits
(
phys
));
nv
km
_wo32
(
pgt
,
pte
+
4
,
upper_32_bits
(
phys
));
pte
+=
8
;
}
nvkm_done
(
pgt
);
}
static
void
nv50_vm_unmap
(
struct
nvkm_gpuobj
*
pgt
,
u32
pte
,
u32
cnt
)
{
pte
<<=
3
;
nvkm_kmap
(
pgt
);
while
(
cnt
--
)
{
nv_wo32
(
pgt
,
pte
+
0
,
0x00000000
);
nv_wo32
(
pgt
,
pte
+
4
,
0x00000000
);
nv
km
_wo32
(
pgt
,
pte
+
0
,
0x00000000
);
nv
km
_wo32
(
pgt
,
pte
+
4
,
0x00000000
);
pte
+=
8
;
}
nvkm_done
(
pgt
);
}
static
void
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录