Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
9f6219fd
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
9f6219fd
编写于
11月 01, 2017
作者:
B
Ben Skeggs
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/nouveau/mmu/nv50,g84: implement vmm on top of new base
Signed-off-by:
N
Ben Skeggs
<
bskeggs@redhat.com
>
上级
03b0ba7b
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
122 addition
and
5 deletion
+122
-5
drivers/gpu/drm/nouveau/include/nvif/class.h
drivers/gpu/drm/nouveau/include/nvif/class.h
+1
-0
drivers/gpu/drm/nouveau/include/nvif/if500d.h
drivers/gpu/drm/nouveau/include/nvif/if500d.h
+8
-0
drivers/gpu/drm/nouveau/include/nvkm/subdev/mmu.h
drivers/gpu/drm/nouveau/include/nvkm/subdev/mmu.h
+0
-1
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/Kbuild
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/Kbuild
+1
-0
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/base.c
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/base.c
+0
-1
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/g84.c
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/g84.c
+4
-1
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/nv50.c
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/nv50.c
+4
-2
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/priv.h
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/priv.h
+1
-0
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.h
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.h
+9
-0
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmnv50.c
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmnv50.c
+94
-0
未找到文件。
drivers/gpu/drm/nouveau/include/nvif/class.h
浏览文件 @
9f6219fd
...
...
@@ -16,6 +16,7 @@
#define NVIF_CLASS_VMM
/* if000c.h */
0x8000000c
#define NVIF_CLASS_VMM_NV04
/* if000d.h */
0x8000000d
#define NVIF_CLASS_VMM_NV50
/* if500d.h */
0x8000500d
/* the below match nvidia-assigned (either in hw, or sw) class numbers */
#define NV_NULL_CLASS 0x00000030
...
...
drivers/gpu/drm/nouveau/include/nvif/if500d.h
0 → 100644
浏览文件 @
9f6219fd
#ifndef __NVIF_IF500D_H__
#define __NVIF_IF500D_H__
#include "if000c.h"
struct
nv50_vmm_vn
{
/* nvif_vmm_vX ... */
};
#endif
drivers/gpu/drm/nouveau/include/nvkm/subdev/mmu.h
浏览文件 @
9f6219fd
...
...
@@ -36,7 +36,6 @@ struct nvkm_vm {
u64
limit
;
struct
nvkm_vmm_pt
*
pd
;
u16
pd_offset
;
struct
list_head
join
;
struct
nvkm_mm
mm
;
...
...
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/Kbuild
浏览文件 @
9f6219fd
...
...
@@ -16,3 +16,4 @@ nvkm-y += nvkm/subdev/mmu/vmm.o
nvkm-y += nvkm/subdev/mmu/vmmnv04.o
nvkm-y += nvkm/subdev/mmu/vmmnv41.o
nvkm-y += nvkm/subdev/mmu/vmmnv44.o
nvkm-y += nvkm/subdev/mmu/vmmnv50.o
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/base.c
浏览文件 @
9f6219fd
...
...
@@ -727,7 +727,6 @@ nvkm_vm_del(struct kref *kref)
nvkm_mm_fini
(
&
vm
->
mm
);
vfree
(
vm
->
pgt
);
if
(
vm
->
func
)
nvkm_vmm_dtor
(
vm
);
kfree
(
vm
);
...
...
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/g84.c
浏览文件 @
9f6219fd
...
...
@@ -19,7 +19,9 @@
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
#include "priv.h"
#include "vmm.h"
#include <nvif/class.h>
static
const
struct
nvkm_mmu_func
g84_mmu
=
{
...
...
@@ -34,6 +36,7 @@ g84_mmu = {
.
map_sg
=
nv50_vm_map_sg
,
.
unmap
=
nv50_vm_unmap
,
.
flush
=
nv50_vm_flush
,
.
vmm
=
{{
-
1
,
-
1
,
NVIF_CLASS_VMM_NV50
},
nv50_vmm_new
,
false
,
0x0200
},
};
int
...
...
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/nv50.c
浏览文件 @
9f6219fd
...
...
@@ -21,13 +21,15 @@
*
* Authors: Ben Skeggs
*/
#include "
priv
.h"
#include "
vmm
.h"
#include <core/gpuobj.h>
#include <subdev/fb.h>
#include <subdev/timer.h>
#include <engine/gr.h>
#include <nvif/class.h>
void
nv50_vm_map_pgt
(
struct
nvkm_gpuobj
*
pgd
,
u32
pde
,
struct
nvkm_memory
*
pgt
[
2
])
{
...
...
@@ -205,7 +207,6 @@ nv50_vm_create(struct nvkm_mmu *mmu, u64 offset, u64 length, u64 mm_offset,
u32
block
=
(
1
<<
(
mmu
->
func
->
pgt_bits
+
12
));
if
(
block
>
length
)
block
=
length
;
return
nvkm_vm_create
(
mmu
,
offset
,
length
,
mm_offset
,
block
,
key
,
pvm
);
}
...
...
@@ -222,6 +223,7 @@ nv50_mmu = {
.
map_sg
=
nv50_vm_map_sg
,
.
unmap
=
nv50_vm_unmap
,
.
flush
=
nv50_vm_flush
,
.
vmm
=
{{
-
1
,
-
1
,
NVIF_CLASS_VMM_NV50
},
nv50_vmm_new
,
false
,
0x1400
},
};
int
...
...
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/priv.h
浏览文件 @
9f6219fd
...
...
@@ -38,6 +38,7 @@ struct nvkm_mmu_func {
void
*
argv
,
u32
argc
,
struct
lock_class_key
*
,
const
char
*
name
,
struct
nvkm_vmm
**
);
bool
global
;
u32
pd_offset
;
}
vmm
;
};
...
...
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.h
浏览文件 @
9f6219fd
...
...
@@ -94,6 +94,11 @@ struct nvkm_vmm_func {
const
struct
nvkm_vmm_page
page
[];
};
struct
nvkm_vmm_join
{
struct
nvkm_memory
*
inst
;
struct
list_head
head
;
};
int
nvkm_vmm_new_
(
const
struct
nvkm_vmm_func
*
,
struct
nvkm_mmu
*
,
u32
pd_header
,
u64
addr
,
u64
size
,
struct
lock_class_key
*
,
const
char
*
name
,
struct
nvkm_vmm
**
);
...
...
@@ -112,4 +117,8 @@ int nv41_vmm_new(struct nvkm_mmu *, u64, u64, void *, u32,
struct
lock_class_key
*
,
const
char
*
,
struct
nvkm_vmm
**
);
int
nv44_vmm_new
(
struct
nvkm_mmu
*
,
u64
,
u64
,
void
*
,
u32
,
struct
lock_class_key
*
,
const
char
*
,
struct
nvkm_vmm
**
);
int
nv50_vmm_new
(
struct
nvkm_mmu
*
,
u64
,
u64
,
void
*
,
u32
,
struct
lock_class_key
*
,
const
char
*
,
struct
nvkm_vmm
**
);
int
g84_vmm_new
(
struct
nvkm_mmu
*
,
u64
,
u64
,
void
*
,
u32
,
struct
lock_class_key
*
,
const
char
*
,
struct
nvkm_vmm
**
);
#endif
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmnv50.c
0 → 100644
浏览文件 @
9f6219fd
/*
* Copyright 2017 Red Hat Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
#include "vmm.h"
#include <nvif/if500d.h>
#include <nvif/unpack.h>
static
const
struct
nvkm_vmm_desc_func
nv50_vmm_pgt
=
{
};
static
const
struct
nvkm_vmm_desc_func
nv50_vmm_pgd
=
{
};
static
const
struct
nvkm_vmm_desc
nv50_vmm_desc_12
[]
=
{
{
PGT
,
17
,
8
,
0x1000
,
&
nv50_vmm_pgt
},
{
PGD
,
11
,
0
,
0x0000
,
&
nv50_vmm_pgd
},
{}
};
static
const
struct
nvkm_vmm_desc
nv50_vmm_desc_16
[]
=
{
{
PGT
,
13
,
8
,
0x1000
,
&
nv50_vmm_pgt
},
{
PGD
,
11
,
0
,
0x0000
,
&
nv50_vmm_pgd
},
{}
};
static
void
nv50_vmm_part
(
struct
nvkm_vmm
*
vmm
,
struct
nvkm_memory
*
inst
)
{
struct
nvkm_vmm_join
*
join
;
list_for_each_entry
(
join
,
&
vmm
->
join
,
head
)
{
if
(
join
->
inst
==
inst
)
{
list_del
(
&
join
->
head
);
kfree
(
join
);
break
;
}
}
}
static
int
nv50_vmm_join
(
struct
nvkm_vmm
*
vmm
,
struct
nvkm_memory
*
inst
)
{
struct
nvkm_vmm_join
*
join
;
if
(
!
(
join
=
kmalloc
(
sizeof
(
*
join
),
GFP_KERNEL
)))
return
-
ENOMEM
;
join
->
inst
=
inst
;
list_add_tail
(
&
join
->
head
,
&
vmm
->
join
);
return
0
;
}
static
const
struct
nvkm_vmm_func
nv50_vmm
=
{
.
join
=
nv50_vmm_join
,
.
part
=
nv50_vmm_part
,
.
page_block
=
1
<<
29
,
.
page
=
{
{
16
,
&
nv50_vmm_desc_16
[
0
],
NVKM_VMM_PAGE_xVxC
},
{
12
,
&
nv50_vmm_desc_12
[
0
],
NVKM_VMM_PAGE_xVHx
},
{}
}
};
int
nv50_vmm_new
(
struct
nvkm_mmu
*
mmu
,
u64
addr
,
u64
size
,
void
*
argv
,
u32
argc
,
struct
lock_class_key
*
key
,
const
char
*
name
,
struct
nvkm_vmm
**
pvmm
)
{
return
nv04_vmm_new_
(
&
nv50_vmm
,
mmu
,
0
,
addr
,
size
,
argv
,
argc
,
key
,
name
,
pvmm
);
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录