Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
047d1d3c
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
161
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看板
提交
047d1d3c
编写于
5月 31, 2010
作者:
B
Ben Skeggs
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/nouveau: reduce usage of fence spinlock to when absolutely necessary
Signed-off-by:
N
Ben Skeggs
<
bskeggs@redhat.com
>
上级
ca6adb8a
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
8 addition
and
31 deletion
+8
-31
drivers/gpu/drm/nouveau/nouveau_channel.c
drivers/gpu/drm/nouveau/nouveau_channel.c
+0
-2
drivers/gpu/drm/nouveau/nouveau_drv.h
drivers/gpu/drm/nouveau/nouveau_drv.h
+1
-2
drivers/gpu/drm/nouveau/nouveau_fence.c
drivers/gpu/drm/nouveau/nouveau_fence.c
+6
-25
drivers/gpu/drm/nouveau/nv04_graph.c
drivers/gpu/drm/nouveau/nv04_graph.c
+1
-2
未找到文件。
drivers/gpu/drm/nouveau/nouveau_channel.c
浏览文件 @
047d1d3c
...
...
@@ -258,9 +258,7 @@ nouveau_channel_free(struct nouveau_channel *chan)
nouveau_debugfs_channel_fini
(
chan
);
/* Give outstanding push buffers a chance to complete */
spin_lock_irqsave
(
&
chan
->
fence
.
lock
,
flags
);
nouveau_fence_update
(
chan
);
spin_unlock_irqrestore
(
&
chan
->
fence
.
lock
,
flags
);
if
(
chan
->
fence
.
sequence
!=
chan
->
fence
.
sequence_ack
)
{
struct
nouveau_fence
*
fence
=
NULL
;
...
...
drivers/gpu/drm/nouveau/nouveau_drv.h
浏览文件 @
047d1d3c
...
...
@@ -188,7 +188,7 @@ struct nouveau_channel {
struct
list_head
pending
;
uint32_t
sequence
;
uint32_t
sequence_ack
;
uint32
_t
last_sequence_irq
;
atomic
_t
last_sequence_irq
;
}
fence
;
/* DMA push buffer */
...
...
@@ -1111,7 +1111,6 @@ extern int nouveau_fence_wait(void *obj, void *arg, bool lazy, bool intr);
extern
int
nouveau_fence_flush
(
void
*
obj
,
void
*
arg
);
extern
void
nouveau_fence_unref
(
void
**
obj
);
extern
void
*
nouveau_fence_ref
(
void
*
obj
);
extern
void
nouveau_fence_handler
(
struct
drm_device
*
dev
,
int
channel
);
/* nouveau_gem.c */
extern
int
nouveau_gem_new
(
struct
drm_device
*
,
struct
nouveau_channel
*
,
...
...
drivers/gpu/drm/nouveau/nouveau_fence.c
浏览文件 @
047d1d3c
...
...
@@ -67,12 +67,13 @@ nouveau_fence_update(struct nouveau_channel *chan)
if
(
USE_REFCNT
)
sequence
=
nvchan_rd32
(
chan
,
0x48
);
else
sequence
=
chan
->
fence
.
last_sequence_irq
;
sequence
=
atomic_read
(
&
chan
->
fence
.
last_sequence_irq
)
;
if
(
chan
->
fence
.
sequence_ack
==
sequence
)
return
;
chan
->
fence
.
sequence_ack
=
sequence
;
spin_lock
(
&
chan
->
fence
.
lock
);
list_for_each_safe
(
entry
,
tmp
,
&
chan
->
fence
.
pending
)
{
fence
=
list_entry
(
entry
,
struct
nouveau_fence
,
entry
);
...
...
@@ -84,6 +85,7 @@ nouveau_fence_update(struct nouveau_channel *chan)
if
(
sequence
==
chan
->
fence
.
sequence_ack
)
break
;
}
spin_unlock
(
&
chan
->
fence
.
lock
);
}
int
...
...
@@ -119,7 +121,6 @@ nouveau_fence_emit(struct nouveau_fence *fence)
{
struct
drm_nouveau_private
*
dev_priv
=
fence
->
channel
->
dev
->
dev_private
;
struct
nouveau_channel
*
chan
=
fence
->
channel
;
unsigned
long
flags
;
int
ret
;
ret
=
RING_SPACE
(
chan
,
2
);
...
...
@@ -127,9 +128,7 @@ nouveau_fence_emit(struct nouveau_fence *fence)
return
ret
;
if
(
unlikely
(
chan
->
fence
.
sequence
==
chan
->
fence
.
sequence_ack
-
1
))
{
spin_lock_irqsave
(
&
chan
->
fence
.
lock
,
flags
);
nouveau_fence_update
(
chan
);
spin_unlock_irqrestore
(
&
chan
->
fence
.
lock
,
flags
);
BUG_ON
(
chan
->
fence
.
sequence
==
chan
->
fence
.
sequence_ack
-
1
);
...
...
@@ -138,9 +137,9 @@ nouveau_fence_emit(struct nouveau_fence *fence)
fence
->
sequence
=
++
chan
->
fence
.
sequence
;
kref_get
(
&
fence
->
refcount
);
spin_lock
_irqsave
(
&
chan
->
fence
.
lock
,
flags
);
spin_lock
(
&
chan
->
fence
.
lock
);
list_add_tail
(
&
fence
->
entry
,
&
chan
->
fence
.
pending
);
spin_unlock
_irqrestore
(
&
chan
->
fence
.
lock
,
flags
);
spin_unlock
(
&
chan
->
fence
.
lock
);
BEGIN_RING
(
chan
,
NvSubSw
,
USE_REFCNT
?
0x0050
:
0x0150
,
1
);
OUT_RING
(
chan
,
fence
->
sequence
);
...
...
@@ -173,14 +172,11 @@ nouveau_fence_signalled(void *sync_obj, void *sync_arg)
{
struct
nouveau_fence
*
fence
=
nouveau_fence
(
sync_obj
);
struct
nouveau_channel
*
chan
=
fence
->
channel
;
unsigned
long
flags
;
if
(
fence
->
signalled
)
return
true
;
spin_lock_irqsave
(
&
chan
->
fence
.
lock
,
flags
);
nouveau_fence_update
(
chan
);
spin_unlock_irqrestore
(
&
chan
->
fence
.
lock
,
flags
);
return
fence
->
signalled
;
}
...
...
@@ -221,27 +217,12 @@ nouveau_fence_flush(void *sync_obj, void *sync_arg)
return
0
;
}
void
nouveau_fence_handler
(
struct
drm_device
*
dev
,
int
channel
)
{
struct
drm_nouveau_private
*
dev_priv
=
dev
->
dev_private
;
struct
nouveau_channel
*
chan
=
NULL
;
if
(
channel
>=
0
&&
channel
<
dev_priv
->
engine
.
fifo
.
channels
)
chan
=
dev_priv
->
fifos
[
channel
];
if
(
chan
)
{
spin_lock_irq
(
&
chan
->
fence
.
lock
);
nouveau_fence_update
(
chan
);
spin_unlock_irq
(
&
chan
->
fence
.
lock
);
}
}
int
nouveau_fence_init
(
struct
nouveau_channel
*
chan
)
{
INIT_LIST_HEAD
(
&
chan
->
fence
.
pending
);
spin_lock_init
(
&
chan
->
fence
.
lock
);
atomic_set
(
&
chan
->
fence
.
last_sequence_irq
,
0
);
return
0
;
}
...
...
drivers/gpu/drm/nouveau/nv04_graph.c
浏览文件 @
047d1d3c
...
...
@@ -527,8 +527,7 @@ static int
nv04_graph_mthd_set_ref
(
struct
nouveau_channel
*
chan
,
int
grclass
,
int
mthd
,
uint32_t
data
)
{
chan
->
fence
.
last_sequence_irq
=
data
;
nouveau_fence_handler
(
chan
->
dev
,
chan
->
id
);
atomic_set
(
&
chan
->
fence
.
last_sequence_irq
,
data
);
return
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录