Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
5de8037a
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看板
提交
5de8037a
编写于
13年前
作者:
B
Ben Skeggs
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/nvc0: enable per-client address spaces
Signed-off-by:
N
Ben Skeggs
<
bskeggs@redhat.com
>
上级
ad9ac437
无相关合并请求
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
55 addition
and
40 deletion
+55
-40
drivers/gpu/drm/nouveau/nouveau_object.c
drivers/gpu/drm/nouveau/nouveau_object.c
+46
-28
drivers/gpu/drm/nouveau/nouveau_state.c
drivers/gpu/drm/nouveau/nouveau_state.c
+6
-1
drivers/gpu/drm/nouveau/nvc0_instmem.c
drivers/gpu/drm/nouveau/nvc0_instmem.c
+3
-11
未找到文件。
drivers/gpu/drm/nouveau/nouveau_object.c
浏览文件 @
5de8037a
...
...
@@ -690,46 +690,64 @@ nouveau_gpuobj_channel_init_pramin(struct nouveau_channel *chan)
return
0
;
}
int
nouveau_gpuobj_channel_init
(
struct
nouveau_channel
*
chan
,
uint32_t
vram_h
,
uint32_t
tt_h
)
static
int
nvc0_gpuobj_channel_init
(
struct
nouveau_channel
*
chan
,
struct
nouveau_vm
*
vm
)
{
struct
drm_device
*
dev
=
chan
->
dev
;
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
struct
nouveau_fpriv
*
fpriv
=
nouveau_fpriv
(
chan
->
file_priv
);
struct
nouveau_vm
*
vm
=
fpriv
?
fpriv
->
vm
:
dev_priv
->
chan_vm
;
struct
nouveau_gpuobj
*
vram
=
NULL
,
*
tt
=
NULL
;
struct
nouveau_gpuobj
*
pgd
=
NULL
;
struct
nouveau_vm_pgd
*
vpgd
;
int
ret
,
i
;
NV_DEBUG
(
dev
,
"ch%d vram=0x%08x tt=0x%08x
\n
"
,
chan
->
id
,
vram_h
,
tt_h
);
if
(
dev_priv
->
card_type
==
NV_C0
)
{
struct
nouveau_vm_pgd
*
vpgd
;
ret
=
nouveau_gpuobj_new
(
dev
,
NULL
,
4096
,
0x1000
,
0
,
&
chan
->
ramin
);
if
(
ret
)
return
ret
;
ret
=
nouveau_gpuobj_new
(
dev
,
NULL
,
4096
,
0x1000
,
0
,
&
chan
->
ramin
);
/* create page directory for this vm if none currently exists,
* will be destroyed automagically when last reference to the
* vm is removed
*/
if
(
list_empty
(
&
vm
->
pgd_list
))
{
ret
=
nouveau_gpuobj_new
(
dev
,
NULL
,
65536
,
0x1000
,
0
,
&
pgd
);
if
(
ret
)
return
ret
;
}
nouveau_vm_ref
(
vm
,
&
chan
->
vm
,
pgd
);
nouveau_gpuobj_ref
(
NULL
,
&
pgd
);
nouveau_vm_ref
(
vm
,
&
chan
->
vm
,
NULL
);
/* point channel at vm's page directory */
vpgd
=
list_first_entry
(
&
vm
->
pgd_list
,
struct
nouveau_vm_pgd
,
head
);
nv_wo32
(
chan
->
ramin
,
0x0200
,
lower_32_bits
(
vpgd
->
obj
->
vinst
));
nv_wo32
(
chan
->
ramin
,
0x0204
,
upper_32_bits
(
vpgd
->
obj
->
vinst
));
nv_wo32
(
chan
->
ramin
,
0x0208
,
0xffffffff
);
nv_wo32
(
chan
->
ramin
,
0x020c
,
0x000000ff
);
vpgd
=
list_first_entry
(
&
vm
->
pgd_list
,
struct
nouveau_vm_pgd
,
head
);
nv_wo32
(
chan
->
ramin
,
0x0200
,
lower_32_bits
(
vpgd
->
obj
->
vinst
));
nv_wo32
(
chan
->
ramin
,
0x0204
,
upper_32_bits
(
vpgd
->
obj
->
vinst
));
nv_wo32
(
chan
->
ramin
,
0x0208
,
0xffffffff
);
nv_wo32
(
chan
->
ramin
,
0x020c
,
0x000000ff
);
/* map display semaphore buffers into channel's vm */
for
(
i
=
0
;
i
<
2
;
i
++
)
{
struct
nv50_display_crtc
*
dispc
=
&
nv50_display
(
dev
)
->
crtc
[
i
];
for
(
i
=
0
;
i
<
2
;
i
++
)
{
struct
nv50_display_crtc
*
dispc
=
&
nv50_display
(
dev
)
->
crtc
[
i
];
ret
=
nouveau_bo_vma_add
(
dispc
->
sem
.
bo
,
chan
->
vm
,
&
chan
->
dispc_vma
[
i
]);
if
(
ret
)
return
ret
;
}
ret
=
nouveau_bo_vma_add
(
dispc
->
sem
.
bo
,
chan
->
vm
,
&
chan
->
dispc_vma
[
i
]);
if
(
ret
)
return
ret
;
}
return
0
;
}
return
0
;
}
int
nouveau_gpuobj_channel_init
(
struct
nouveau_channel
*
chan
,
uint32_t
vram_h
,
uint32_t
tt_h
)
{
struct
drm_device
*
dev
=
chan
->
dev
;
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
struct
nouveau_fpriv
*
fpriv
=
nouveau_fpriv
(
chan
->
file_priv
);
struct
nouveau_vm
*
vm
=
fpriv
?
fpriv
->
vm
:
dev_priv
->
chan_vm
;
struct
nouveau_gpuobj
*
vram
=
NULL
,
*
tt
=
NULL
;
int
ret
,
i
;
NV_DEBUG
(
dev
,
"ch%d vram=0x%08x tt=0x%08x
\n
"
,
chan
->
id
,
vram_h
,
tt_h
);
if
(
dev_priv
->
card_type
==
NV_C0
)
return
nvc0_gpuobj_channel_init
(
chan
,
vm
);
/* Allocate a chunk of memory for per-channel object storage */
ret
=
nouveau_gpuobj_channel_init_pramin
(
chan
);
...
...
This diff is collapsed.
Click to expand it.
drivers/gpu/drm/nouveau/nouveau_state.c
浏览文件 @
5de8037a
...
...
@@ -787,7 +787,12 @@ nouveau_open(struct drm_device *dev, struct drm_file *file_priv)
}
}
else
if
(
dev_priv
->
card_type
>=
NV_C0
)
{
nouveau_vm_ref
(
dev_priv
->
chan_vm
,
&
fpriv
->
vm
,
NULL
);
ret
=
nouveau_vm_new
(
dev
,
0
,
(
1ULL
<<
40
),
0x0008000000ULL
,
&
fpriv
->
vm
);
if
(
ret
)
{
kfree
(
fpriv
);
return
ret
;
}
}
file_priv
->
driver_priv
=
fpriv
;
...
...
This diff is collapsed.
Click to expand it.
drivers/gpu/drm/nouveau/nvc0_instmem.c
浏览文件 @
5de8037a
...
...
@@ -32,7 +32,6 @@ struct nvc0_instmem_priv {
struct
nouveau_channel
*
bar1
;
struct
nouveau_gpuobj
*
bar3_pgd
;
struct
nouveau_channel
*
bar3
;
struct
nouveau_gpuobj
*
chan_pgd
;
};
int
...
...
@@ -181,17 +180,11 @@ nvc0_instmem_init(struct drm_device *dev)
goto
error
;
/* channel vm */
ret
=
nouveau_vm_new
(
dev
,
0
,
(
1ULL
<<
40
),
0x0008000000ULL
,
&
vm
);
ret
=
nouveau_vm_new
(
dev
,
0
,
(
1ULL
<<
40
),
0x0008000000ULL
,
&
dev_priv
->
chan_vm
);
if
(
ret
)
goto
error
;
ret
=
nouveau_gpuobj_new
(
dev
,
NULL
,
0x8000
,
4096
,
0
,
&
priv
->
chan_pgd
);
if
(
ret
)
goto
error
;
nouveau_vm_ref
(
vm
,
&
dev_priv
->
chan_vm
,
priv
->
chan_pgd
);
nouveau_vm_ref
(
NULL
,
&
vm
,
NULL
);
nvc0_instmem_resume
(
dev
);
return
0
;
error:
...
...
@@ -211,8 +204,7 @@ nvc0_instmem_takedown(struct drm_device *dev)
nv_wr32
(
dev
,
0x1704
,
0x00000000
);
nv_wr32
(
dev
,
0x1714
,
0x00000000
);
nouveau_vm_ref
(
NULL
,
&
dev_priv
->
chan_vm
,
priv
->
chan_pgd
);
nouveau_gpuobj_ref
(
NULL
,
&
priv
->
chan_pgd
);
nouveau_vm_ref
(
NULL
,
&
dev_priv
->
chan_vm
,
NULL
);
nvc0_channel_del
(
&
priv
->
bar1
);
nouveau_vm_ref
(
NULL
,
&
dev_priv
->
bar1_vm
,
priv
->
bar1_pgd
);
...
...
This diff is collapsed.
Click to expand it.
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录
反馈
建议
客服
返回
顶部