Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
65270a65
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看板
提交
65270a65
编写于
8月 12, 2014
作者:
B
Ben Skeggs
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/nouveau/core/mm: allow allocation to be confined to a specific slice of heap
Signed-off-by:
N
Ben Skeggs
<
bskeggs@redhat.com
>
上级
13dfe128
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
38 addition
and
26 deletion
+38
-26
drivers/gpu/drm/nouveau/core/core/gpuobj.c
drivers/gpu/drm/nouveau/core/core/gpuobj.c
+1
-1
drivers/gpu/drm/nouveau/core/core/mm.c
drivers/gpu/drm/nouveau/core/core/mm.c
+15
-5
drivers/gpu/drm/nouveau/core/include/core/mm.h
drivers/gpu/drm/nouveau/core/include/core/mm.h
+6
-4
drivers/gpu/drm/nouveau/core/subdev/fb/nv20.c
drivers/gpu/drm/nouveau/core/subdev/fb/nv20.c
+1
-1
drivers/gpu/drm/nouveau/core/subdev/fb/nv25.c
drivers/gpu/drm/nouveau/core/subdev/fb/nv25.c
+1
-1
drivers/gpu/drm/nouveau/core/subdev/fb/nv30.c
drivers/gpu/drm/nouveau/core/subdev/fb/nv30.c
+1
-1
drivers/gpu/drm/nouveau/core/subdev/fb/nv35.c
drivers/gpu/drm/nouveau/core/subdev/fb/nv35.c
+1
-1
drivers/gpu/drm/nouveau/core/subdev/fb/nv36.c
drivers/gpu/drm/nouveau/core/subdev/fb/nv36.c
+1
-1
drivers/gpu/drm/nouveau/core/subdev/fb/nv40.c
drivers/gpu/drm/nouveau/core/subdev/fb/nv40.c
+1
-1
drivers/gpu/drm/nouveau/core/subdev/fb/ramnv50.c
drivers/gpu/drm/nouveau/core/subdev/fb/ramnv50.c
+3
-3
drivers/gpu/drm/nouveau/core/subdev/fb/ramnvc0.c
drivers/gpu/drm/nouveau/core/subdev/fb/ramnvc0.c
+2
-2
drivers/gpu/drm/nouveau/core/subdev/instmem/nv04.c
drivers/gpu/drm/nouveau/core/subdev/instmem/nv04.c
+1
-1
drivers/gpu/drm/nouveau/core/subdev/ltc/base.c
drivers/gpu/drm/nouveau/core/subdev/ltc/base.c
+1
-1
drivers/gpu/drm/nouveau/core/subdev/ltc/gf100.c
drivers/gpu/drm/nouveau/core/subdev/ltc/gf100.c
+1
-1
drivers/gpu/drm/nouveau/core/subdev/vm/base.c
drivers/gpu/drm/nouveau/core/subdev/vm/base.c
+1
-1
drivers/gpu/drm/nouveau/nouveau_abi16.c
drivers/gpu/drm/nouveau/nouveau_abi16.c
+1
-1
未找到文件。
drivers/gpu/drm/nouveau/core/core/gpuobj.c
浏览文件 @
65270a65
...
...
@@ -115,7 +115,7 @@ nouveau_gpuobj_create_(struct nouveau_object *parent,
gpuobj
->
size
=
size
;
if
(
heap
)
{
ret
=
nouveau_mm_head
(
heap
,
1
,
size
,
size
,
ret
=
nouveau_mm_head
(
heap
,
0
,
1
,
size
,
size
,
max
(
align
,
(
u32
)
1
),
&
gpuobj
->
node
);
if
(
ret
)
return
ret
;
...
...
drivers/gpu/drm/nouveau/core/core/mm.c
浏览文件 @
65270a65
...
...
@@ -98,6 +98,7 @@ region_head(struct nouveau_mm *mm, struct nouveau_mm_node *a, u32 size)
b
->
offset
=
a
->
offset
;
b
->
length
=
size
;
b
->
heap
=
a
->
heap
;
b
->
type
=
a
->
type
;
a
->
offset
+=
size
;
a
->
length
-=
size
;
...
...
@@ -108,8 +109,8 @@ region_head(struct nouveau_mm *mm, struct nouveau_mm_node *a, u32 size)
}
int
nouveau_mm_head
(
struct
nouveau_mm
*
mm
,
u8
type
,
u32
size_max
,
u32
size_min
,
u32
align
,
struct
nouveau_mm_node
**
pnode
)
nouveau_mm_head
(
struct
nouveau_mm
*
mm
,
u8
heap
,
u8
type
,
u32
size_max
,
u32
size_min
,
u32
align
,
struct
nouveau_mm_node
**
pnode
)
{
struct
nouveau_mm_node
*
prev
,
*
this
,
*
next
;
u32
mask
=
align
-
1
;
...
...
@@ -119,6 +120,10 @@ nouveau_mm_head(struct nouveau_mm *mm, u8 type, u32 size_max, u32 size_min,
BUG_ON
(
type
==
NVKM_MM_TYPE_NONE
||
type
==
NVKM_MM_TYPE_HOLE
);
list_for_each_entry
(
this
,
&
mm
->
free
,
fl_entry
)
{
if
(
unlikely
(
heap
!=
NVKM_MM_HEAP_ANY
))
{
if
(
this
->
heap
!=
heap
)
continue
;
}
e
=
this
->
offset
+
this
->
length
;
s
=
this
->
offset
;
...
...
@@ -167,6 +172,7 @@ region_tail(struct nouveau_mm *mm, struct nouveau_mm_node *a, u32 size)
a
->
length
-=
size
;
b
->
offset
=
a
->
offset
+
a
->
length
;
b
->
length
=
size
;
b
->
heap
=
a
->
heap
;
b
->
type
=
a
->
type
;
list_add
(
&
b
->
nl_entry
,
&
a
->
nl_entry
);
...
...
@@ -176,8 +182,8 @@ region_tail(struct nouveau_mm *mm, struct nouveau_mm_node *a, u32 size)
}
int
nouveau_mm_tail
(
struct
nouveau_mm
*
mm
,
u8
type
,
u32
size_max
,
u32
size_min
,
u32
align
,
struct
nouveau_mm_node
**
pnode
)
nouveau_mm_tail
(
struct
nouveau_mm
*
mm
,
u8
heap
,
u8
type
,
u32
size_max
,
u32
size_min
,
u32
align
,
struct
nouveau_mm_node
**
pnode
)
{
struct
nouveau_mm_node
*
prev
,
*
this
,
*
next
;
u32
mask
=
align
-
1
;
...
...
@@ -188,6 +194,10 @@ nouveau_mm_tail(struct nouveau_mm *mm, u8 type, u32 size_max, u32 size_min,
u32
e
=
this
->
offset
+
this
->
length
;
u32
s
=
this
->
offset
;
u32
c
=
0
,
a
;
if
(
unlikely
(
heap
!=
NVKM_MM_HEAP_ANY
))
{
if
(
this
->
heap
!=
heap
)
continue
;
}
prev
=
node
(
this
,
prev
);
if
(
prev
&&
prev
->
type
!=
type
)
...
...
@@ -262,7 +272,7 @@ nouveau_mm_init(struct nouveau_mm *mm, u32 offset, u32 length, u32 block)
list_add_tail
(
&
node
->
nl_entry
,
&
mm
->
nodes
);
list_add_tail
(
&
node
->
fl_entry
,
&
mm
->
free
);
mm
->
heap_nodes
++
;
node
->
heap
=
++
mm
->
heap_nodes
;
return
0
;
}
...
...
drivers/gpu/drm/nouveau/core/include/core/mm.h
浏览文件 @
65270a65
...
...
@@ -6,6 +6,8 @@ struct nouveau_mm_node {
struct
list_head
fl_entry
;
struct
list_head
rl_entry
;
#define NVKM_MM_HEAP_ANY 0x00
u8
heap
;
#define NVKM_MM_TYPE_NONE 0x00
#define NVKM_MM_TYPE_HOLE 0xff
u8
type
;
...
...
@@ -29,10 +31,10 @@ nouveau_mm_initialised(struct nouveau_mm *mm)
int
nouveau_mm_init
(
struct
nouveau_mm
*
,
u32
offset
,
u32
length
,
u32
block
);
int
nouveau_mm_fini
(
struct
nouveau_mm
*
);
int
nouveau_mm_head
(
struct
nouveau_mm
*
,
u8
type
,
u32
size_max
,
u32
size_min
,
u32
align
,
struct
nouveau_mm_node
**
);
int
nouveau_mm_tail
(
struct
nouveau_mm
*
,
u8
type
,
u32
size_max
,
u32
size_min
,
u32
align
,
struct
nouveau_mm_node
**
);
int
nouveau_mm_head
(
struct
nouveau_mm
*
,
u8
heap
,
u8
type
,
u32
size_max
,
u32
size_min
,
u32
align
,
struct
nouveau_mm_node
**
);
int
nouveau_mm_tail
(
struct
nouveau_mm
*
,
u8
heap
,
u8
type
,
u32
size_max
,
u32
size_min
,
u32
align
,
struct
nouveau_mm_node
**
);
void
nouveau_mm_free
(
struct
nouveau_mm
*
,
struct
nouveau_mm_node
**
);
#endif
drivers/gpu/drm/nouveau/core/subdev/fb/nv20.c
浏览文件 @
65270a65
...
...
@@ -45,7 +45,7 @@ nv20_fb_tile_comp(struct nouveau_fb *pfb, int i, u32 size, u32 flags,
{
u32
tiles
=
DIV_ROUND_UP
(
size
,
0x40
);
u32
tags
=
round_up
(
tiles
/
pfb
->
ram
->
parts
,
0x40
);
if
(
!
nouveau_mm_head
(
&
pfb
->
tags
,
1
,
tags
,
tags
,
1
,
&
tile
->
tag
))
{
if
(
!
nouveau_mm_head
(
&
pfb
->
tags
,
0
,
1
,
tags
,
tags
,
1
,
&
tile
->
tag
))
{
if
(
!
(
flags
&
2
))
tile
->
zcomp
=
0x00000000
;
/* Z16 */
else
tile
->
zcomp
=
0x04000000
;
/* Z24S8 */
tile
->
zcomp
|=
tile
->
tag
->
offset
;
...
...
drivers/gpu/drm/nouveau/core/subdev/fb/nv25.c
浏览文件 @
65270a65
...
...
@@ -32,7 +32,7 @@ nv25_fb_tile_comp(struct nouveau_fb *pfb, int i, u32 size, u32 flags,
{
u32
tiles
=
DIV_ROUND_UP
(
size
,
0x40
);
u32
tags
=
round_up
(
tiles
/
pfb
->
ram
->
parts
,
0x40
);
if
(
!
nouveau_mm_head
(
&
pfb
->
tags
,
1
,
tags
,
tags
,
1
,
&
tile
->
tag
))
{
if
(
!
nouveau_mm_head
(
&
pfb
->
tags
,
0
,
1
,
tags
,
tags
,
1
,
&
tile
->
tag
))
{
if
(
!
(
flags
&
2
))
tile
->
zcomp
=
0x00100000
;
/* Z16 */
else
tile
->
zcomp
=
0x00200000
;
/* Z24S8 */
tile
->
zcomp
|=
tile
->
tag
->
offset
;
...
...
drivers/gpu/drm/nouveau/core/subdev/fb/nv30.c
浏览文件 @
65270a65
...
...
@@ -51,7 +51,7 @@ nv30_fb_tile_comp(struct nouveau_fb *pfb, int i, u32 size, u32 flags,
{
u32
tiles
=
DIV_ROUND_UP
(
size
,
0x40
);
u32
tags
=
round_up
(
tiles
/
pfb
->
ram
->
parts
,
0x40
);
if
(
!
nouveau_mm_head
(
&
pfb
->
tags
,
1
,
tags
,
tags
,
1
,
&
tile
->
tag
))
{
if
(
!
nouveau_mm_head
(
&
pfb
->
tags
,
0
,
1
,
tags
,
tags
,
1
,
&
tile
->
tag
))
{
if
(
flags
&
2
)
tile
->
zcomp
|=
0x01000000
;
/* Z16 */
else
tile
->
zcomp
|=
0x02000000
;
/* Z24S8 */
tile
->
zcomp
|=
((
tile
->
tag
->
offset
)
>>
6
);
...
...
drivers/gpu/drm/nouveau/core/subdev/fb/nv35.c
浏览文件 @
65270a65
...
...
@@ -32,7 +32,7 @@ nv35_fb_tile_comp(struct nouveau_fb *pfb, int i, u32 size, u32 flags,
{
u32
tiles
=
DIV_ROUND_UP
(
size
,
0x40
);
u32
tags
=
round_up
(
tiles
/
pfb
->
ram
->
parts
,
0x40
);
if
(
!
nouveau_mm_head
(
&
pfb
->
tags
,
1
,
tags
,
tags
,
1
,
&
tile
->
tag
))
{
if
(
!
nouveau_mm_head
(
&
pfb
->
tags
,
0
,
1
,
tags
,
tags
,
1
,
&
tile
->
tag
))
{
if
(
flags
&
2
)
tile
->
zcomp
|=
0x04000000
;
/* Z16 */
else
tile
->
zcomp
|=
0x08000000
;
/* Z24S8 */
tile
->
zcomp
|=
((
tile
->
tag
->
offset
)
>>
6
);
...
...
drivers/gpu/drm/nouveau/core/subdev/fb/nv36.c
浏览文件 @
65270a65
...
...
@@ -32,7 +32,7 @@ nv36_fb_tile_comp(struct nouveau_fb *pfb, int i, u32 size, u32 flags,
{
u32
tiles
=
DIV_ROUND_UP
(
size
,
0x40
);
u32
tags
=
round_up
(
tiles
/
pfb
->
ram
->
parts
,
0x40
);
if
(
!
nouveau_mm_head
(
&
pfb
->
tags
,
1
,
tags
,
tags
,
1
,
&
tile
->
tag
))
{
if
(
!
nouveau_mm_head
(
&
pfb
->
tags
,
0
,
1
,
tags
,
tags
,
1
,
&
tile
->
tag
))
{
if
(
flags
&
2
)
tile
->
zcomp
|=
0x10000000
;
/* Z16 */
else
tile
->
zcomp
|=
0x20000000
;
/* Z24S8 */
tile
->
zcomp
|=
((
tile
->
tag
->
offset
)
>>
6
);
...
...
drivers/gpu/drm/nouveau/core/subdev/fb/nv40.c
浏览文件 @
65270a65
...
...
@@ -33,7 +33,7 @@ nv40_fb_tile_comp(struct nouveau_fb *pfb, int i, u32 size, u32 flags,
u32
tiles
=
DIV_ROUND_UP
(
size
,
0x80
);
u32
tags
=
round_up
(
tiles
/
pfb
->
ram
->
parts
,
0x100
);
if
(
(
flags
&
2
)
&&
!
nouveau_mm_head
(
&
pfb
->
tags
,
1
,
tags
,
tags
,
1
,
&
tile
->
tag
))
{
!
nouveau_mm_head
(
&
pfb
->
tags
,
0
,
1
,
tags
,
tags
,
1
,
&
tile
->
tag
))
{
tile
->
zcomp
=
0x28000000
;
/* Z24S8_SPLIT_GRAD */
tile
->
zcomp
|=
((
tile
->
tag
->
offset
)
>>
8
);
tile
->
zcomp
|=
((
tile
->
tag
->
offset
+
tags
-
1
)
>>
8
)
<<
13
;
...
...
drivers/gpu/drm/nouveau/core/subdev/fb/ramnv50.c
浏览文件 @
65270a65
...
...
@@ -280,7 +280,7 @@ nv50_ram_get(struct nouveau_fb *pfb, u64 size, u32 align, u32 ncmin,
if
(
align
==
16
)
{
int
n
=
(
max
>>
4
)
*
comp
;
ret
=
nouveau_mm_head
(
tags
,
1
,
n
,
n
,
1
,
&
mem
->
tag
);
ret
=
nouveau_mm_head
(
tags
,
0
,
1
,
n
,
n
,
1
,
&
mem
->
tag
);
if
(
ret
)
mem
->
tag
=
NULL
;
}
...
...
@@ -296,9 +296,9 @@ nv50_ram_get(struct nouveau_fb *pfb, u64 size, u32 align, u32 ncmin,
type
=
nv50_fb_memtype
[
type
];
do
{
if
(
back
)
ret
=
nouveau_mm_tail
(
heap
,
type
,
max
,
min
,
align
,
&
r
);
ret
=
nouveau_mm_tail
(
heap
,
0
,
type
,
max
,
min
,
align
,
&
r
);
else
ret
=
nouveau_mm_head
(
heap
,
type
,
max
,
min
,
align
,
&
r
);
ret
=
nouveau_mm_head
(
heap
,
0
,
type
,
max
,
min
,
align
,
&
r
);
if
(
ret
)
{
mutex_unlock
(
&
pfb
->
base
.
mutex
);
pfb
->
ram
->
put
(
pfb
,
&
mem
);
...
...
drivers/gpu/drm/nouveau/core/subdev/fb/ramnvc0.c
浏览文件 @
65270a65
...
...
@@ -483,9 +483,9 @@ nvc0_ram_get(struct nouveau_fb *pfb, u64 size, u32 align, u32 ncmin,
do
{
if
(
back
)
ret
=
nouveau_mm_tail
(
mm
,
1
,
size
,
ncmin
,
align
,
&
r
);
ret
=
nouveau_mm_tail
(
mm
,
0
,
1
,
size
,
ncmin
,
align
,
&
r
);
else
ret
=
nouveau_mm_head
(
mm
,
1
,
size
,
ncmin
,
align
,
&
r
);
ret
=
nouveau_mm_head
(
mm
,
0
,
1
,
size
,
ncmin
,
align
,
&
r
);
if
(
ret
)
{
mutex_unlock
(
&
pfb
->
base
.
mutex
);
pfb
->
ram
->
put
(
pfb
,
&
mem
);
...
...
drivers/gpu/drm/nouveau/core/subdev/instmem/nv04.c
浏览文件 @
65270a65
...
...
@@ -69,7 +69,7 @@ nv04_instobj_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
if
(
ret
)
return
ret
;
ret
=
nouveau_mm_head
(
&
priv
->
heap
,
1
,
args
->
size
,
args
->
size
,
ret
=
nouveau_mm_head
(
&
priv
->
heap
,
0
,
1
,
args
->
size
,
args
->
size
,
args
->
align
,
&
node
->
mem
);
if
(
ret
)
return
ret
;
...
...
drivers/gpu/drm/nouveau/core/subdev/ltc/base.c
浏览文件 @
65270a65
...
...
@@ -31,7 +31,7 @@ nvkm_ltc_tags_alloc(struct nouveau_ltc *ltc, u32 n,
struct
nvkm_ltc_priv
*
priv
=
(
void
*
)
ltc
;
int
ret
;
ret
=
nouveau_mm_head
(
&
priv
->
tags
,
1
,
n
,
n
,
1
,
pnode
);
ret
=
nouveau_mm_head
(
&
priv
->
tags
,
0
,
1
,
n
,
n
,
1
,
pnode
);
if
(
ret
)
*
pnode
=
NULL
;
...
...
drivers/gpu/drm/nouveau/core/subdev/ltc/gf100.c
浏览文件 @
65270a65
...
...
@@ -168,7 +168,7 @@ gf100_ltc_init_tag_ram(struct nouveau_fb *pfb, struct nvkm_ltc_priv *priv)
tag_size
+=
tag_align
;
tag_size
=
(
tag_size
+
0xfff
)
>>
12
;
/* round up */
ret
=
nouveau_mm_tail
(
&
pfb
->
vram
,
1
,
tag_size
,
tag_size
,
1
,
ret
=
nouveau_mm_tail
(
&
pfb
->
vram
,
0
,
1
,
tag_size
,
tag_size
,
1
,
&
priv
->
tag_ram
);
if
(
ret
)
{
priv
->
num_tags
=
0
;
...
...
drivers/gpu/drm/nouveau/core/subdev/vm/base.c
浏览文件 @
65270a65
...
...
@@ -296,7 +296,7 @@ nouveau_vm_get(struct nouveau_vm *vm, u64 size, u32 page_shift,
int
ret
;
mutex_lock
(
&
nv_subdev
(
vmm
)
->
mutex
);
ret
=
nouveau_mm_head
(
&
vm
->
mm
,
page_shift
,
msize
,
msize
,
align
,
ret
=
nouveau_mm_head
(
&
vm
->
mm
,
0
,
page_shift
,
msize
,
msize
,
align
,
&
vma
->
node
);
if
(
unlikely
(
ret
!=
0
))
{
mutex_unlock
(
&
nv_subdev
(
vmm
)
->
mutex
);
...
...
drivers/gpu/drm/nouveau/nouveau_abi16.c
浏览文件 @
65270a65
...
...
@@ -448,7 +448,7 @@ nouveau_abi16_ioctl_notifierobj_alloc(ABI16_IOCTL_ARGS)
list_add
(
&
ntfy
->
head
,
&
chan
->
notifiers
);
ntfy
->
handle
=
info
->
handle
;
ret
=
nouveau_mm_head
(
&
chan
->
heap
,
1
,
info
->
size
,
info
->
size
,
1
,
ret
=
nouveau_mm_head
(
&
chan
->
heap
,
0
,
1
,
info
->
size
,
info
->
size
,
1
,
&
ntfy
->
node
);
if
(
ret
)
goto
done
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录