Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
48aca13f
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看板
提交
48aca13f
编写于
3月 18, 2012
作者:
B
Ben Skeggs
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/nouveau: remove m2mf creation on userspace channels
Signed-off-by:
N
Ben Skeggs
<
bskeggs@redhat.com
>
上级
d5316e25
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
93 addition
and
81 deletion
+93
-81
drivers/gpu/drm/nouveau/nouveau_channel.c
drivers/gpu/drm/nouveau/nouveau_channel.c
+14
-5
drivers/gpu/drm/nouveau/nouveau_dma.c
drivers/gpu/drm/nouveau/nouveau_dma.c
+1
-60
drivers/gpu/drm/nouveau/nouveau_drv.h
drivers/gpu/drm/nouveau/nouveau_drv.h
+1
-2
drivers/gpu/drm/nouveau/nouveau_state.c
drivers/gpu/drm/nouveau/nouveau_state.c
+77
-14
未找到文件。
drivers/gpu/drm/nouveau/nouveau_channel.c
浏览文件 @
48aca13f
...
...
@@ -122,7 +122,7 @@ nouveau_channel_alloc(struct drm_device *dev, struct nouveau_channel **chan_ret,
struct
nouveau_fpriv
*
fpriv
=
nouveau_fpriv
(
file_priv
);
struct
nouveau_channel
*
chan
;
unsigned
long
flags
;
int
ret
;
int
ret
,
i
;
/* allocate and lock channel structure */
chan
=
kzalloc
(
sizeof
(
*
chan
),
GFP_KERNEL
);
...
...
@@ -184,7 +184,7 @@ nouveau_channel_alloc(struct drm_device *dev, struct nouveau_channel **chan_ret,
return
ret
;
}
nouveau_dma_
pre_
init
(
chan
);
nouveau_dma_init
(
chan
);
chan
->
user_put
=
0x40
;
chan
->
user_get
=
0x44
;
if
(
dev_priv
->
card_type
>=
NV_50
)
...
...
@@ -202,9 +202,18 @@ nouveau_channel_alloc(struct drm_device *dev, struct nouveau_channel **chan_ret,
pfifo
->
reassign
(
dev
,
true
);
ret
=
nouveau_dma_init
(
chan
);
if
(
!
ret
)
ret
=
nouveau_fence_channel_init
(
chan
);
/* Insert NOPs for NOUVEAU_DMA_SKIPS */
ret
=
RING_SPACE
(
chan
,
NOUVEAU_DMA_SKIPS
);
if
(
ret
)
{
nouveau_channel_put
(
&
chan
);
return
ret
;
}
for
(
i
=
0
;
i
<
NOUVEAU_DMA_SKIPS
;
i
++
)
OUT_RING
(
chan
,
0x00000000
);
FIRE_RING
(
chan
);
ret
=
nouveau_fence_channel_init
(
chan
);
if
(
ret
)
{
nouveau_channel_put
(
&
chan
);
return
ret
;
...
...
drivers/gpu/drm/nouveau/nouveau_dma.c
浏览文件 @
48aca13f
...
...
@@ -31,7 +31,7 @@
#include "nouveau_ramht.h"
void
nouveau_dma_
pre_
init
(
struct
nouveau_channel
*
chan
)
nouveau_dma_init
(
struct
nouveau_channel
*
chan
)
{
struct
drm_nouveau_private
*
dev_priv
=
chan
->
dev
->
dev_private
;
struct
nouveau_bo
*
pushbuf
=
chan
->
pushbuf_bo
;
...
...
@@ -54,65 +54,6 @@ nouveau_dma_pre_init(struct nouveau_channel *chan)
chan
->
dma
.
free
=
chan
->
dma
.
max
-
chan
->
dma
.
cur
;
}
int
nouveau_dma_init
(
struct
nouveau_channel
*
chan
)
{
struct
drm_device
*
dev
=
chan
->
dev
;
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
int
ret
,
i
;
if
(
dev_priv
->
card_type
>=
NV_C0
)
{
ret
=
nouveau_gpuobj_gr_new
(
chan
,
0x9039
,
0x9039
);
if
(
ret
)
return
ret
;
ret
=
RING_SPACE
(
chan
,
2
);
if
(
ret
)
return
ret
;
BEGIN_NVC0
(
chan
,
2
,
NvSubM2MF
,
0x0000
,
1
);
OUT_RING
(
chan
,
0x00009039
);
FIRE_RING
(
chan
);
return
0
;
}
/* Create NV_MEMORY_TO_MEMORY_FORMAT for buffer moves */
ret
=
nouveau_gpuobj_gr_new
(
chan
,
NvM2MF
,
dev_priv
->
card_type
<
NV_50
?
0x0039
:
0x5039
);
if
(
ret
)
return
ret
;
/* NV_MEMORY_TO_MEMORY_FORMAT requires a notifier object */
ret
=
nouveau_notifier_alloc
(
chan
,
NvNotify0
,
32
,
0xfe0
,
0x1000
,
&
chan
->
m2mf_ntfy
);
if
(
ret
)
return
ret
;
/* Insert NOPS for NOUVEAU_DMA_SKIPS */
ret
=
RING_SPACE
(
chan
,
NOUVEAU_DMA_SKIPS
);
if
(
ret
)
return
ret
;
for
(
i
=
0
;
i
<
NOUVEAU_DMA_SKIPS
;
i
++
)
OUT_RING
(
chan
,
0
);
/* Initialise NV_MEMORY_TO_MEMORY_FORMAT */
ret
=
RING_SPACE
(
chan
,
6
);
if
(
ret
)
return
ret
;
BEGIN_RING
(
chan
,
NvSubM2MF
,
NV_MEMORY_TO_MEMORY_FORMAT_NAME
,
1
);
OUT_RING
(
chan
,
NvM2MF
);
BEGIN_RING
(
chan
,
NvSubM2MF
,
NV_MEMORY_TO_MEMORY_FORMAT_DMA_NOTIFY
,
3
);
OUT_RING
(
chan
,
NvNotify0
);
OUT_RING
(
chan
,
chan
->
vram_handle
);
OUT_RING
(
chan
,
chan
->
gart_handle
);
/* Sit back and pray the channel works.. */
FIRE_RING
(
chan
);
return
0
;
}
void
OUT_RINGp
(
struct
nouveau_channel
*
chan
,
const
void
*
data
,
unsigned
nr_dwords
)
{
...
...
drivers/gpu/drm/nouveau/nouveau_drv.h
浏览文件 @
48aca13f
...
...
@@ -1089,8 +1089,7 @@ nouveau_debugfs_channel_fini(struct nouveau_channel *chan)
#endif
/* nouveau_dma.c */
extern
void
nouveau_dma_pre_init
(
struct
nouveau_channel
*
);
extern
int
nouveau_dma_init
(
struct
nouveau_channel
*
);
extern
void
nouveau_dma_init
(
struct
nouveau_channel
*
);
extern
int
nouveau_dma_wait
(
struct
nouveau_channel
*
,
int
slots
,
int
size
);
/* nouveau_acpi.c */
...
...
drivers/gpu/drm/nouveau/nouveau_state.c
浏览文件 @
48aca13f
...
...
@@ -552,6 +552,75 @@ static bool nouveau_switcheroo_can_switch(struct pci_dev *pdev)
return
can_switch
;
}
static
void
nouveau_card_channel_fini
(
struct
drm_device
*
dev
)
{
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
if
(
dev_priv
->
channel
)
nouveau_channel_put_unlocked
(
&
dev_priv
->
channel
);
}
static
int
nouveau_card_channel_init
(
struct
drm_device
*
dev
)
{
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
struct
nouveau_channel
*
chan
;
int
ret
,
oclass
;
ret
=
nouveau_channel_alloc
(
dev
,
&
chan
,
NULL
,
NvDmaFB
,
NvDmaTT
);
dev_priv
->
channel
=
chan
;
if
(
ret
)
return
ret
;
mutex_unlock
(
&
dev_priv
->
channel
->
mutex
);
if
(
dev_priv
->
card_type
<=
NV_50
)
{
if
(
dev_priv
->
card_type
<
NV_50
)
oclass
=
0x0039
;
else
oclass
=
0x5039
;
ret
=
nouveau_gpuobj_gr_new
(
chan
,
NvM2MF
,
oclass
);
if
(
ret
)
goto
error
;
ret
=
nouveau_notifier_alloc
(
chan
,
NvNotify0
,
32
,
0xfe0
,
0x1000
,
&
chan
->
m2mf_ntfy
);
if
(
ret
)
goto
error
;
ret
=
RING_SPACE
(
chan
,
6
);
if
(
ret
)
goto
error
;
BEGIN_RING
(
chan
,
NvSubM2MF
,
NV_MEMORY_TO_MEMORY_FORMAT_NAME
,
1
);
OUT_RING
(
chan
,
NvM2MF
);
BEGIN_RING
(
chan
,
NvSubM2MF
,
NV_MEMORY_TO_MEMORY_FORMAT_DMA_NOTIFY
,
3
);
OUT_RING
(
chan
,
NvNotify0
);
OUT_RING
(
chan
,
chan
->
vram_handle
);
OUT_RING
(
chan
,
chan
->
gart_handle
);
}
else
if
(
dev_priv
->
card_type
<=
NV_C0
)
{
ret
=
nouveau_gpuobj_gr_new
(
chan
,
0x9039
,
0x9039
);
if
(
ret
)
goto
error
;
ret
=
RING_SPACE
(
chan
,
2
);
if
(
ret
)
goto
error
;
BEGIN_NVC0
(
chan
,
2
,
NvSubM2MF
,
0x0000
,
1
);
OUT_RING
(
chan
,
0x00009039
);
}
FIRE_RING
(
chan
);
error:
if
(
ret
)
nouveau_card_channel_fini
(
dev
);
return
ret
;
}
int
nouveau_card_init
(
struct
drm_device
*
dev
)
{
...
...
@@ -738,17 +807,14 @@ nouveau_card_init(struct drm_device *dev)
nouveau_backlight_init
(
dev
);
nouveau_pm_init
(
dev
);
if
(
dev_priv
->
eng
[
NVOBJ_ENGINE_GR
])
{
ret
=
nouveau_fence_init
(
dev
);
if
(
ret
)
goto
out_pm
;
ret
=
nouveau_fence_init
(
dev
);
if
(
ret
)
goto
out_pm
;
ret
=
nouveau_channel_alloc
(
dev
,
&
dev_priv
->
channel
,
NULL
,
NvDmaFB
,
NvDmaTT
);
if
(
!
dev_priv
->
noaccel
)
{
ret
=
nouveau_card_channel_init
(
dev
);
if
(
ret
)
goto
out_fence
;
mutex_unlock
(
&
dev_priv
->
channel
->
mutex
);
}
if
(
dev
->
mode_config
.
num_crtc
)
{
...
...
@@ -762,7 +828,7 @@ nouveau_card_init(struct drm_device *dev)
return
0
;
out_chan:
nouveau_c
hannel_put_unlocked
(
&
dev_priv
->
channel
);
nouveau_c
ard_channel_fini
(
dev
);
out_fence:
nouveau_fence_fini
(
dev
);
out_pm:
...
...
@@ -820,11 +886,8 @@ static void nouveau_card_takedown(struct drm_device *dev)
nouveau_display_fini
(
dev
);
}
if
(
dev_priv
->
channel
)
{
nouveau_channel_put_unlocked
(
&
dev_priv
->
channel
);
nouveau_fence_fini
(
dev
);
}
nouveau_card_channel_fini
(
dev
);
nouveau_fence_fini
(
dev
);
nouveau_pm_fini
(
dev
);
nouveau_backlight_exit
(
dev
);
nouveau_display_destroy
(
dev
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录