Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
875ac34a
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看板
提交
875ac34a
编写于
4月 30, 2012
作者:
B
Ben Skeggs
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/nouveau/fence: make ttm interfaces wrap ours, not the other way around
Signed-off-by:
N
Ben Skeggs
<
bskeggs@redhat.com
>
上级
35bcf5d5
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
68 addition
and
71 deletion
+68
-71
drivers/gpu/drm/nouveau/nouveau_bo.c
drivers/gpu/drm/nouveau/nouveau_bo.c
+51
-21
drivers/gpu/drm/nouveau/nouveau_drv.h
drivers/gpu/drm/nouveau/nouveau_drv.h
+4
-27
drivers/gpu/drm/nouveau/nouveau_fence.c
drivers/gpu/drm/nouveau/nouveau_fence.c
+13
-23
未找到文件。
drivers/gpu/drm/nouveau/nouveau_bo.c
浏览文件 @
875ac34a
...
...
@@ -1068,22 +1068,6 @@ nouveau_ttm_fault_reserve_notify(struct ttm_buffer_object *bo)
return
nouveau_bo_validate
(
nvbo
,
false
,
true
,
false
);
}
void
nouveau_bo_fence
(
struct
nouveau_bo
*
nvbo
,
struct
nouveau_fence
*
fence
)
{
struct
nouveau_fence
*
old_fence
;
if
(
likely
(
fence
))
nouveau_fence_ref
(
fence
);
spin_lock
(
&
nvbo
->
bo
.
bdev
->
fence_lock
);
old_fence
=
nvbo
->
bo
.
sync_obj
;
nvbo
->
bo
.
sync_obj
=
fence
;
spin_unlock
(
&
nvbo
->
bo
.
bdev
->
fence_lock
);
nouveau_fence_unref
(
&
old_fence
);
}
static
int
nouveau_ttm_tt_populate
(
struct
ttm_tt
*
ttm
)
{
...
...
@@ -1181,6 +1165,52 @@ nouveau_ttm_tt_unpopulate(struct ttm_tt *ttm)
ttm_pool_unpopulate
(
ttm
);
}
void
nouveau_bo_fence
(
struct
nouveau_bo
*
nvbo
,
struct
nouveau_fence
*
fence
)
{
struct
nouveau_fence
*
old_fence
=
NULL
;
if
(
likely
(
fence
))
nouveau_fence_ref
(
fence
);
spin_lock
(
&
nvbo
->
bo
.
bdev
->
fence_lock
);
old_fence
=
nvbo
->
bo
.
sync_obj
;
nvbo
->
bo
.
sync_obj
=
fence
;
spin_unlock
(
&
nvbo
->
bo
.
bdev
->
fence_lock
);
nouveau_fence_unref
(
&
old_fence
);
}
static
void
nouveau_bo_fence_unref
(
void
**
sync_obj
)
{
nouveau_fence_unref
((
struct
nouveau_fence
**
)
sync_obj
);
}
static
void
*
nouveau_bo_fence_ref
(
void
*
sync_obj
)
{
return
nouveau_fence_ref
(
sync_obj
);
}
static
bool
nouveau_bo_fence_signalled
(
void
*
sync_obj
,
void
*
sync_arg
)
{
return
nouveau_fence_signalled
(
sync_obj
);
}
static
int
nouveau_bo_fence_wait
(
void
*
sync_obj
,
void
*
sync_arg
,
bool
lazy
,
bool
intr
)
{
return
nouveau_fence_wait
(
sync_obj
,
lazy
,
intr
);
}
static
int
nouveau_bo_fence_flush
(
void
*
sync_obj
,
void
*
sync_arg
)
{
return
0
;
}
struct
ttm_bo_driver
nouveau_bo_driver
=
{
.
ttm_tt_create
=
&
nouveau_ttm_tt_create
,
.
ttm_tt_populate
=
&
nouveau_ttm_tt_populate
,
...
...
@@ -1191,11 +1221,11 @@ struct ttm_bo_driver nouveau_bo_driver = {
.
move_notify
=
nouveau_bo_move_ntfy
,
.
move
=
nouveau_bo_move
,
.
verify_access
=
nouveau_bo_verify_access
,
.
sync_obj_signaled
=
__nouveau
_fence_signalled
,
.
sync_obj_wait
=
__nouveau
_fence_wait
,
.
sync_obj_flush
=
__nouveau
_fence_flush
,
.
sync_obj_unref
=
__nouveau
_fence_unref
,
.
sync_obj_ref
=
__nouveau
_fence_ref
,
.
sync_obj_signaled
=
nouveau_bo
_fence_signalled
,
.
sync_obj_wait
=
nouveau_bo
_fence_wait
,
.
sync_obj_flush
=
nouveau_bo
_fence_flush
,
.
sync_obj_unref
=
nouveau_bo
_fence_unref
,
.
sync_obj_ref
=
nouveau_bo
_fence_ref
,
.
fault_reserve_notify
=
&
nouveau_ttm_fault_reserve_notify
,
.
io_mem_reserve
=
&
nouveau_ttm_io_mem_reserve
,
.
io_mem_free
=
&
nouveau_ttm_io_mem_free
,
...
...
drivers/gpu/drm/nouveau/nouveau_drv.h
浏览文件 @
875ac34a
...
...
@@ -1458,34 +1458,11 @@ extern void nouveau_fence_work(struct nouveau_fence *fence,
void
*
priv
);
struct
nouveau_channel
*
nouveau_fence_channel
(
struct
nouveau_fence
*
);
extern
bool
__nouveau_fence_signalled
(
void
*
obj
,
void
*
arg
);
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
);
static
inline
bool
nouveau_fence_signalled
(
struct
nouveau_fence
*
obj
)
{
return
__nouveau_fence_signalled
(
obj
,
NULL
);
}
static
inline
int
nouveau_fence_wait
(
struct
nouveau_fence
*
obj
,
bool
lazy
,
bool
intr
)
{
return
__nouveau_fence_wait
(
obj
,
NULL
,
lazy
,
intr
);
}
extern
bool
nouveau_fence_signalled
(
struct
nouveau_fence
*
);
extern
int
nouveau_fence_wait
(
struct
nouveau_fence
*
,
bool
lazy
,
bool
intr
);
extern
void
nouveau_fence_unref
(
struct
nouveau_fence
**
);
extern
struct
nouveau_fence
*
nouveau_fence_ref
(
struct
nouveau_fence
*
);
extern
int
nouveau_fence_sync
(
struct
nouveau_fence
*
,
struct
nouveau_channel
*
);
static
inline
int
nouveau_fence_flush
(
struct
nouveau_fence
*
obj
)
{
return
__nouveau_fence_flush
(
obj
,
NULL
);
}
static
inline
void
nouveau_fence_unref
(
struct
nouveau_fence
**
obj
)
{
__nouveau_fence_unref
((
void
**
)
obj
);
}
static
inline
struct
nouveau_fence
*
nouveau_fence_ref
(
struct
nouveau_fence
*
obj
)
{
return
__nouveau_fence_ref
(
obj
);
}
/* nouveau_gem.c */
extern
int
nouveau_gem_new
(
struct
drm_device
*
,
int
size
,
int
align
,
...
...
drivers/gpu/drm/nouveau/nouveau_fence.c
浏览文件 @
875ac34a
...
...
@@ -199,28 +199,23 @@ nouveau_fence_work(struct nouveau_fence *fence,
}
void
__nouveau_fence_unref
(
void
**
sync_obj
)
nouveau_fence_unref
(
struct
nouveau_fence
**
pfence
)
{
struct
nouveau_fence
*
fence
=
nouveau_fence
(
*
sync_obj
);
if
(
fence
)
kref_put
(
&
fence
->
refcount
,
nouveau_fence_del
);
*
sync_obj
=
NULL
;
if
(
*
pfence
)
kref_put
(
&
(
*
pfence
)
->
refcount
,
nouveau_fence_del
);
*
pfence
=
NULL
;
}
void
*
__nouveau_fence_ref
(
void
*
sync_obj
)
struct
nouveau_fence
*
nouveau_fence_ref
(
struct
nouveau_fence
*
fence
)
{
struct
nouveau_fence
*
fence
=
nouveau_fence
(
sync_obj
);
kref_get
(
&
fence
->
refcount
);
return
sync_obj
;
return
fence
;
}
bool
__nouveau_fence_signalled
(
void
*
sync_obj
,
void
*
sync_arg
)
nouveau_fence_signalled
(
struct
nouveau_fence
*
fence
)
{
struct
nouveau_fence
*
fence
=
nouveau_fence
(
sync_obj
);
struct
nouveau_channel
*
chan
=
fence
->
channel
;
if
(
fence
->
signalled
)
...
...
@@ -231,25 +226,20 @@ __nouveau_fence_signalled(void *sync_obj, void *sync_arg)
}
int
__nouveau_fence_wait
(
void
*
sync_obj
,
void
*
sync_arg
,
bool
lazy
,
bool
intr
)
nouveau_fence_wait
(
struct
nouveau_fence
*
fence
,
bool
lazy
,
bool
intr
)
{
struct
nouveau_fence
*
fence
=
nouveau_fence
(
sync_obj
);
unsigned
long
timeout
=
fence
->
timeout
;
unsigned
long
sleep_time
=
NSEC_PER_MSEC
/
1000
;
ktime_t
t
;
int
ret
=
0
;
while
(
1
)
{
if
(
__nouveau_fence_signalled
(
sync_obj
,
sync_arg
))
break
;
if
(
time_after_eq
(
jiffies
,
timeout
))
{
while
(
!
nouveau_fence_signalled
(
fence
))
{
if
(
time_after_eq
(
jiffies
,
fence
->
timeout
))
{
ret
=
-
EBUSY
;
break
;
}
__set_current_state
(
intr
?
TASK_INTERRUPTIBLE
:
TASK_UNINTERRUPTIBLE
);
__set_current_state
(
intr
?
TASK_INTERRUPTIBLE
:
TASK_UNINTERRUPTIBLE
);
if
(
lazy
)
{
t
=
ktime_set
(
0
,
sleep_time
);
schedule_hrtimeout
(
&
t
,
HRTIMER_MODE_REL
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录