Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
e18c080f
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看板
提交
e18c080f
编写于
1月 31, 2013
作者:
B
Ben Skeggs
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/nouveau/fence/nv84-: put processes to sleep while waiting on fences
Signed-off-by:
N
Ben Skeggs
<
bskeggs@redhat.com
>
上级
a2fa2973
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
92 addition
and
5 deletion
+92
-5
drivers/gpu/drm/nouveau/nouveau_dma.h
drivers/gpu/drm/nouveau/nouveau_dma.h
+1
-1
drivers/gpu/drm/nouveau/nouveau_fence.c
drivers/gpu/drm/nouveau/nouveau_fence.c
+76
-0
drivers/gpu/drm/nouveau/nouveau_fence.h
drivers/gpu/drm/nouveau/nouveau_fence.h
+3
-0
drivers/gpu/drm/nouveau/nv84_fence.c
drivers/gpu/drm/nouveau/nv84_fence.c
+6
-2
drivers/gpu/drm/nouveau/nvc0_fence.c
drivers/gpu/drm/nouveau/nvc0_fence.c
+6
-2
未找到文件。
drivers/gpu/drm/nouveau/nouveau_dma.h
浏览文件 @
e18c080f
...
...
@@ -191,7 +191,7 @@ WIND_RING(struct nouveau_channel *chan)
#define NV84_SUBCHAN_SEMAPHORE_TRIGGER_WRITE_LONG 0x00000002
#define NV84_SUBCHAN_SEMAPHORE_TRIGGER_ACQUIRE_GEQUAL 0x00000004
#define NVC0_SUBCHAN_SEMAPHORE_TRIGGER_YIELD 0x00001000
#define NV84_SUBCHAN_
NOTIFY_INTR
0x00000020
#define NV84_SUBCHAN_
UEVENT
0x00000020
#define NV84_SUBCHAN_WRCACHE_FLUSH 0x00000024
#define NV10_SUBCHAN_REF_CNT 0x00000050
#define NVSW_SUBCHAN_PAGE_FLIP 0x00000054
...
...
drivers/gpu/drm/nouveau/nouveau_fence.c
浏览文件 @
e18c080f
...
...
@@ -33,6 +33,8 @@
#include "nouveau_dma.h"
#include "nouveau_fence.h"
#include <engine/fifo.h>
void
nouveau_fence_context_del
(
struct
nouveau_fence_chan
*
fctx
)
{
...
...
@@ -107,13 +109,87 @@ nouveau_fence_done(struct nouveau_fence *fence)
return
!
fence
->
channel
;
}
struct
nouveau_fence_uevent
{
struct
nouveau_eventh
handler
;
struct
nouveau_fence_priv
*
priv
;
};
static
int
nouveau_fence_wait_uevent_handler
(
struct
nouveau_eventh
*
event
,
int
index
)
{
struct
nouveau_fence_uevent
*
uevent
=
container_of
(
event
,
struct
nouveau_fence_uevent
,
handler
);
wake_up_all
(
&
uevent
->
priv
->
waiting
);
return
NVKM_EVENT_KEEP
;
}
static
int
nouveau_fence_wait_uevent
(
struct
nouveau_fence
*
fence
,
bool
intr
)
{
struct
nouveau_channel
*
chan
=
fence
->
channel
;
struct
nouveau_fifo
*
pfifo
=
nouveau_fifo
(
chan
->
drm
->
device
);
struct
nouveau_fence_priv
*
priv
=
chan
->
drm
->
fence
;
struct
nouveau_fence_uevent
uevent
=
{
.
handler
.
func
=
nouveau_fence_wait_uevent_handler
,
.
priv
=
priv
,
};
int
ret
=
0
;
nouveau_event_get
(
pfifo
->
uevent
,
0
,
&
uevent
.
handler
);
if
(
fence
->
timeout
)
{
unsigned
long
timeout
=
fence
->
timeout
-
jiffies
;
if
(
time_before
(
jiffies
,
fence
->
timeout
))
{
if
(
intr
)
{
ret
=
wait_event_interruptible_timeout
(
priv
->
waiting
,
nouveau_fence_done
(
fence
),
timeout
);
}
else
{
ret
=
wait_event_timeout
(
priv
->
waiting
,
nouveau_fence_done
(
fence
),
timeout
);
}
}
if
(
ret
>=
0
)
{
fence
->
timeout
=
jiffies
+
ret
;
if
(
time_after_eq
(
jiffies
,
fence
->
timeout
))
ret
=
-
EBUSY
;
}
}
else
{
if
(
intr
)
{
ret
=
wait_event_interruptible
(
priv
->
waiting
,
nouveau_fence_done
(
fence
));
}
else
{
wait_event
(
priv
->
waiting
,
nouveau_fence_done
(
fence
));
}
}
nouveau_event_put
(
pfifo
->
uevent
,
0
,
&
uevent
.
handler
);
if
(
unlikely
(
ret
<
0
))
return
ret
;
return
0
;
}
int
nouveau_fence_wait
(
struct
nouveau_fence
*
fence
,
bool
lazy
,
bool
intr
)
{
struct
nouveau_channel
*
chan
=
fence
->
channel
;
struct
nouveau_fence_priv
*
priv
=
chan
?
chan
->
drm
->
fence
:
NULL
;
unsigned
long
sleep_time
=
NSEC_PER_MSEC
/
1000
;
ktime_t
t
;
int
ret
=
0
;
while
(
priv
&&
priv
->
uevent
&&
lazy
&&
!
nouveau_fence_done
(
fence
))
{
ret
=
nouveau_fence_wait_uevent
(
fence
,
intr
);
if
(
ret
<
0
)
return
ret
;
}
while
(
!
nouveau_fence_done
(
fence
))
{
if
(
fence
->
timeout
&&
time_after_eq
(
jiffies
,
fence
->
timeout
))
{
ret
=
-
EBUSY
;
...
...
drivers/gpu/drm/nouveau/nouveau_fence.h
浏览文件 @
e18c080f
...
...
@@ -43,6 +43,9 @@ struct nouveau_fence_priv {
int
(
*
sync
)(
struct
nouveau_fence
*
,
struct
nouveau_channel
*
,
struct
nouveau_channel
*
);
u32
(
*
read
)(
struct
nouveau_channel
*
);
wait_queue_head_t
waiting
;
bool
uevent
;
};
#define nouveau_fence(drm) ((struct nouveau_fence_priv *)(drm)->fence)
...
...
drivers/gpu/drm/nouveau/nv84_fence.c
浏览文件 @
e18c080f
...
...
@@ -47,15 +47,16 @@ nv84_fence_emit(struct nouveau_fence *fence)
{
struct
nouveau_channel
*
chan
=
fence
->
channel
;
struct
nouveau_fifo_chan
*
fifo
=
(
void
*
)
chan
->
object
;
int
ret
=
RING_SPACE
(
chan
,
7
);
int
ret
=
RING_SPACE
(
chan
,
8
);
if
(
ret
==
0
)
{
BEGIN_NV04
(
chan
,
0
,
NV11_SUBCHAN_DMA_SEMAPHORE
,
1
);
OUT_RING
(
chan
,
NvSema
);
BEGIN_NV04
(
chan
,
0
,
NV84_SUBCHAN_SEMAPHORE_ADDRESS_HIGH
,
4
);
BEGIN_NV04
(
chan
,
0
,
NV84_SUBCHAN_SEMAPHORE_ADDRESS_HIGH
,
5
);
OUT_RING
(
chan
,
upper_32_bits
(
fifo
->
chid
*
16
));
OUT_RING
(
chan
,
lower_32_bits
(
fifo
->
chid
*
16
));
OUT_RING
(
chan
,
fence
->
sequence
);
OUT_RING
(
chan
,
NV84_SUBCHAN_SEMAPHORE_TRIGGER_WRITE_LONG
);
OUT_RING
(
chan
,
0x00000000
);
FIRE_RING
(
chan
);
}
return
ret
;
...
...
@@ -174,6 +175,9 @@ nv84_fence_create(struct nouveau_drm *drm)
priv
->
base
.
sync
=
nv84_fence_sync
;
priv
->
base
.
read
=
nv84_fence_read
;
init_waitqueue_head
(
&
priv
->
base
.
waiting
);
priv
->
base
.
uevent
=
true
;
ret
=
nouveau_gpuobj_new
(
drm
->
device
,
NULL
,
chan
*
16
,
0x1000
,
0
,
&
priv
->
mem
);
if
(
ret
)
...
...
drivers/gpu/drm/nouveau/nvc0_fence.c
浏览文件 @
e18c080f
...
...
@@ -62,13 +62,14 @@ nvc0_fence_emit(struct nouveau_fence *fence)
u64
addr
=
fctx
->
vma
.
offset
+
fifo
->
chid
*
16
;
int
ret
;
ret
=
RING_SPACE
(
chan
,
5
);
ret
=
RING_SPACE
(
chan
,
6
);
if
(
ret
==
0
)
{
BEGIN_NVC0
(
chan
,
0
,
NV84_SUBCHAN_SEMAPHORE_ADDRESS_HIGH
,
4
);
BEGIN_NVC0
(
chan
,
0
,
NV84_SUBCHAN_SEMAPHORE_ADDRESS_HIGH
,
5
);
OUT_RING
(
chan
,
upper_32_bits
(
addr
));
OUT_RING
(
chan
,
lower_32_bits
(
addr
));
OUT_RING
(
chan
,
fence
->
sequence
);
OUT_RING
(
chan
,
NV84_SUBCHAN_SEMAPHORE_TRIGGER_WRITE_LONG
);
OUT_RING
(
chan
,
0x00000000
);
FIRE_RING
(
chan
);
}
...
...
@@ -217,6 +218,9 @@ nvc0_fence_create(struct nouveau_drm *drm)
priv
->
base
.
sync
=
nvc0_fence_sync
;
priv
->
base
.
read
=
nvc0_fence_read
;
init_waitqueue_head
(
&
priv
->
base
.
waiting
);
priv
->
base
.
uevent
=
true
;
ret
=
nouveau_bo_new
(
drm
->
dev
,
16
*
(
pfifo
->
max
+
1
),
0
,
TTM_PL_FLAG_VRAM
,
0
,
0
,
NULL
,
&
priv
->
bo
);
if
(
ret
==
0
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录