Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
3ee6f5b5
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 1 年 前同步成功
通知
158
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3ee6f5b5
编写于
8月 10, 2014
作者:
B
Ben Skeggs
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/nouveau: store a pointer to vm in nouveau_cli
Signed-off-by:
N
Ben Skeggs
<
bskeggs@redhat.com
>
上级
b12f0ae9
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
24 addition
and
19 deletion
+24
-19
drivers/gpu/drm/nouveau/nouveau_bo.c
drivers/gpu/drm/nouveau/nouveau_bo.c
+6
-6
drivers/gpu/drm/nouveau/nouveau_drm.c
drivers/gpu/drm/nouveau/nouveau_drm.c
+6
-2
drivers/gpu/drm/nouveau/nouveau_drm.h
drivers/gpu/drm/nouveau/nouveau_drm.h
+1
-0
drivers/gpu/drm/nouveau/nouveau_gem.c
drivers/gpu/drm/nouveau/nouveau_gem.c
+7
-7
drivers/gpu/drm/nouveau/nv84_fence.c
drivers/gpu/drm/nouveau/nv84_fence.c
+4
-4
未找到文件。
drivers/gpu/drm/nouveau/nouveau_bo.c
浏览文件 @
3ee6f5b5
...
...
@@ -196,8 +196,8 @@ nouveau_bo_new(struct drm_device *dev, int size, int align,
int
lpg_shift
=
12
;
int
max_size
;
if
(
drm
->
client
.
base
.
vm
)
lpg_shift
=
drm
->
client
.
base
.
vm
->
vmm
->
lpg_shift
;
if
(
drm
->
client
.
vm
)
lpg_shift
=
drm
->
client
.
vm
->
vmm
->
lpg_shift
;
max_size
=
INT_MAX
&
~
((
1
<<
lpg_shift
)
-
1
);
if
(
size
<=
0
||
size
>
max_size
)
{
...
...
@@ -219,9 +219,9 @@ nouveau_bo_new(struct drm_device *dev, int size, int align,
nvbo
->
bo
.
bdev
=
&
drm
->
ttm
.
bdev
;
nvbo
->
page_shift
=
12
;
if
(
drm
->
client
.
base
.
vm
)
{
if
(
drm
->
client
.
vm
)
{
if
(
!
(
flags
&
TTM_PL_FLAG_TT
)
&&
size
>
256
*
1024
)
nvbo
->
page_shift
=
drm
->
client
.
base
.
vm
->
vmm
->
lpg_shift
;
nvbo
->
page_shift
=
drm
->
client
.
vm
->
vmm
->
lpg_shift
;
}
nouveau_bo_fixup_align
(
nvbo
,
flags
,
&
align
,
&
size
);
...
...
@@ -929,12 +929,12 @@ nouveau_bo_move_prep(struct nouveau_drm *drm, struct ttm_buffer_object *bo,
u64
size
=
(
u64
)
mem
->
num_pages
<<
PAGE_SHIFT
;
int
ret
;
ret
=
nouveau_vm_get
(
nv_client
(
drm
)
->
vm
,
size
,
old_node
->
page_shift
,
ret
=
nouveau_vm_get
(
drm
->
client
.
vm
,
size
,
old_node
->
page_shift
,
NV_MEM_ACCESS_RW
,
&
old_node
->
vma
[
0
]);
if
(
ret
)
return
ret
;
ret
=
nouveau_vm_get
(
nv_client
(
drm
)
->
vm
,
size
,
new_node
->
page_shift
,
ret
=
nouveau_vm_get
(
drm
->
client
.
vm
,
size
,
new_node
->
page_shift
,
NV_MEM_ACCESS_RW
,
&
old_node
->
vma
[
1
]);
if
(
ret
)
{
nouveau_vm_put
(
&
old_node
->
vma
[
0
]);
...
...
drivers/gpu/drm/nouveau/nouveau_drm.c
浏览文件 @
3ee6f5b5
...
...
@@ -415,9 +415,11 @@ nouveau_drm_load(struct drm_device *dev, unsigned long flags)
if
(
device
->
card_type
>=
NV_50
)
{
ret
=
nouveau_vm_new
(
nv_device
(
drm
->
device
),
0
,
(
1ULL
<<
40
),
0x1000
,
&
drm
->
client
.
base
.
vm
);
0x1000
,
&
drm
->
client
.
vm
);
if
(
ret
)
goto
fail_device
;
drm
->
client
.
base
.
vm
=
drm
->
client
.
vm
;
}
ret
=
nouveau_ttm_init
(
drm
);
...
...
@@ -725,11 +727,13 @@ nouveau_drm_open(struct drm_device *dev, struct drm_file *fpriv)
if
(
nv_device
(
drm
->
device
)
->
card_type
>=
NV_50
)
{
ret
=
nouveau_vm_new
(
nv_device
(
drm
->
device
),
0
,
(
1ULL
<<
40
),
0x1000
,
&
cli
->
base
.
vm
);
0x1000
,
&
cli
->
vm
);
if
(
ret
)
{
nouveau_cli_destroy
(
cli
);
goto
out_suspend
;
}
cli
->
base
.
vm
=
cli
->
vm
;
}
fpriv
->
driver_priv
=
cli
;
...
...
drivers/gpu/drm/nouveau/nouveau_drm.h
浏览文件 @
3ee6f5b5
...
...
@@ -65,6 +65,7 @@ enum nouveau_drm_handle {
struct
nouveau_cli
{
struct
nouveau_client
base
;
struct
nouveau_vm
*
vm
;
/*XXX*/
struct
list_head
head
;
struct
mutex
mutex
;
void
*
abi16
;
...
...
drivers/gpu/drm/nouveau/nouveau_gem.c
浏览文件 @
3ee6f5b5
...
...
@@ -58,14 +58,14 @@ nouveau_gem_object_open(struct drm_gem_object *gem, struct drm_file *file_priv)
struct
nouveau_vma
*
vma
;
int
ret
;
if
(
!
cli
->
base
.
vm
)
if
(
!
cli
->
vm
)
return
0
;
ret
=
ttm_bo_reserve
(
&
nvbo
->
bo
,
false
,
false
,
false
,
NULL
);
if
(
ret
)
return
ret
;
vma
=
nouveau_bo_vma_find
(
nvbo
,
cli
->
base
.
vm
);
vma
=
nouveau_bo_vma_find
(
nvbo
,
cli
->
vm
);
if
(
!
vma
)
{
vma
=
kzalloc
(
sizeof
(
*
vma
),
GFP_KERNEL
);
if
(
!
vma
)
{
...
...
@@ -73,7 +73,7 @@ nouveau_gem_object_open(struct drm_gem_object *gem, struct drm_file *file_priv)
goto
out
;
}
ret
=
nouveau_bo_vma_add
(
nvbo
,
cli
->
base
.
vm
,
vma
);
ret
=
nouveau_bo_vma_add
(
nvbo
,
cli
->
vm
,
vma
);
if
(
ret
)
{
kfree
(
vma
);
goto
out
;
...
...
@@ -129,14 +129,14 @@ nouveau_gem_object_close(struct drm_gem_object *gem, struct drm_file *file_priv)
struct
nouveau_vma
*
vma
;
int
ret
;
if
(
!
cli
->
base
.
vm
)
if
(
!
cli
->
vm
)
return
;
ret
=
ttm_bo_reserve
(
&
nvbo
->
bo
,
false
,
false
,
false
,
NULL
);
if
(
ret
)
return
;
vma
=
nouveau_bo_vma_find
(
nvbo
,
cli
->
base
.
vm
);
vma
=
nouveau_bo_vma_find
(
nvbo
,
cli
->
vm
);
if
(
vma
)
{
if
(
--
vma
->
refcount
==
0
)
nouveau_gem_object_unmap
(
nvbo
,
vma
);
...
...
@@ -202,8 +202,8 @@ nouveau_gem_info(struct drm_file *file_priv, struct drm_gem_object *gem,
rep
->
domain
=
NOUVEAU_GEM_DOMAIN_VRAM
;
rep
->
offset
=
nvbo
->
bo
.
offset
;
if
(
cli
->
base
.
vm
)
{
vma
=
nouveau_bo_vma_find
(
nvbo
,
cli
->
base
.
vm
);
if
(
cli
->
vm
)
{
vma
=
nouveau_bo_vma_find
(
nvbo
,
cli
->
vm
);
if
(
!
vma
)
return
-
EINVAL
;
...
...
drivers/gpu/drm/nouveau/nv84_fence.c
浏览文件 @
3ee6f5b5
...
...
@@ -140,7 +140,7 @@ int
nv84_fence_context_new
(
struct
nouveau_channel
*
chan
)
{
struct
nouveau_fifo_chan
*
fifo
=
(
void
*
)
chan
->
object
;
struct
nouveau_cli
ent
*
client
=
nouveau_client
(
fifo
)
;
struct
nouveau_cli
*
cli
=
chan
->
cli
;
struct
nv84_fence_priv
*
priv
=
chan
->
drm
->
fence
;
struct
nv84_fence_chan
*
fctx
;
int
ret
,
i
;
...
...
@@ -156,16 +156,16 @@ nv84_fence_context_new(struct nouveau_channel *chan)
fctx
->
base
.
emit32
=
nv84_fence_emit32
;
fctx
->
base
.
sync32
=
nv84_fence_sync32
;
ret
=
nouveau_bo_vma_add
(
priv
->
bo
,
cli
ent
->
vm
,
&
fctx
->
vma
);
ret
=
nouveau_bo_vma_add
(
priv
->
bo
,
cli
->
vm
,
&
fctx
->
vma
);
if
(
ret
==
0
)
{
ret
=
nouveau_bo_vma_add
(
priv
->
bo_gart
,
cli
ent
->
vm
,
ret
=
nouveau_bo_vma_add
(
priv
->
bo_gart
,
cli
->
vm
,
&
fctx
->
vma_gart
);
}
/* map display semaphore buffers into channel's vm */
for
(
i
=
0
;
!
ret
&&
i
<
chan
->
drm
->
dev
->
mode_config
.
num_crtc
;
i
++
)
{
struct
nouveau_bo
*
bo
=
nv50_display_crtc_sema
(
chan
->
drm
->
dev
,
i
);
ret
=
nouveau_bo_vma_add
(
bo
,
cli
ent
->
vm
,
&
fctx
->
dispc_vma
[
i
]);
ret
=
nouveau_bo_vma_add
(
bo
,
cli
->
vm
,
&
fctx
->
dispc_vma
[
i
]);
}
nouveau_bo_wr32
(
priv
->
bo
,
fifo
->
chid
*
16
/
4
,
0x00000000
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录