Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
867920f8
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 1 年 前同步成功
通知
158
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
867920f8
编写于
8月 10, 2014
作者:
B
Ben Skeggs
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/nouveau/fifo: implement nvif event source
Signed-off-by:
N
Ben Skeggs
<
bskeggs@redhat.com
>
上级
6c6ae061
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
89 addition
and
50 deletion
+89
-50
drivers/gpu/drm/nouveau/core/engine/fifo/base.c
drivers/gpu/drm/nouveau/core/engine/fifo/base.c
+44
-0
drivers/gpu/drm/nouveau/core/engine/fifo/nv04.c
drivers/gpu/drm/nouveau/core/engine/fifo/nv04.c
+2
-1
drivers/gpu/drm/nouveau/core/engine/fifo/nv10.c
drivers/gpu/drm/nouveau/core/engine/fifo/nv10.c
+1
-0
drivers/gpu/drm/nouveau/core/engine/fifo/nv17.c
drivers/gpu/drm/nouveau/core/engine/fifo/nv17.c
+1
-0
drivers/gpu/drm/nouveau/core/engine/fifo/nv40.c
drivers/gpu/drm/nouveau/core/engine/fifo/nv40.c
+1
-0
drivers/gpu/drm/nouveau/core/engine/fifo/nv50.c
drivers/gpu/drm/nouveau/core/engine/fifo/nv50.c
+2
-0
drivers/gpu/drm/nouveau/core/engine/fifo/nv84.c
drivers/gpu/drm/nouveau/core/engine/fifo/nv84.c
+3
-13
drivers/gpu/drm/nouveau/core/engine/fifo/nvc0.c
drivers/gpu/drm/nouveau/core/engine/fifo/nvc0.c
+3
-14
drivers/gpu/drm/nouveau/core/engine/fifo/nve0.c
drivers/gpu/drm/nouveau/core/engine/fifo/nve0.c
+3
-14
drivers/gpu/drm/nouveau/core/include/engine/fifo.h
drivers/gpu/drm/nouveau/core/include/engine/fifo.h
+5
-0
drivers/gpu/drm/nouveau/nouveau_fence.c
drivers/gpu/drm/nouveau/nouveau_fence.c
+15
-8
drivers/gpu/drm/nouveau/nvif/class.h
drivers/gpu/drm/nouveau/nvif/class.h
+1
-0
drivers/gpu/drm/nouveau/nvif/event.h
drivers/gpu/drm/nouveau/nvif/event.h
+8
-0
未找到文件。
drivers/gpu/drm/nouveau/core/engine/fifo/base.c
浏览文件 @
867920f8
...
...
@@ -28,6 +28,7 @@
#include <core/event.h>
#include <nvif/unpack.h>
#include <nvif/class.h>
#include <nvif/event.h>
#include <engine/dmaobj.h>
#include <engine/fifo.h>
...
...
@@ -168,6 +169,49 @@ _nouveau_fifo_channel_wr32(struct nouveau_object *object, u64 addr, u32 data)
iowrite32_native
(
data
,
chan
->
user
+
addr
);
}
int
nouveau_fifo_uevent_ctor
(
void
*
data
,
u32
size
,
struct
nvkm_notify
*
notify
)
{
union
{
struct
nvif_notify_uevent_req
none
;
}
*
req
=
data
;
int
ret
;
if
(
nvif_unvers
(
req
->
none
))
{
notify
->
size
=
sizeof
(
struct
nvif_notify_uevent_rep
);
notify
->
types
=
1
;
notify
->
index
=
0
;
}
return
ret
;
}
void
nouveau_fifo_uevent
(
struct
nouveau_fifo
*
fifo
)
{
struct
nvif_notify_uevent_rep
rep
=
{
};
nvkm_event_send
(
&
fifo
->
uevent
,
1
,
0
,
&
rep
,
sizeof
(
rep
));
}
int
_nouveau_fifo_channel_ntfy
(
struct
nouveau_object
*
object
,
u32
type
,
struct
nvkm_event
**
event
)
{
struct
nouveau_fifo
*
fifo
=
(
void
*
)
object
->
engine
;
switch
(
type
)
{
case
G82_CHANNEL_DMA_V0_NTFY_UEVENT
:
if
(
nv_mclass
(
object
)
>=
G82_CHANNEL_DMA
)
{
*
event
=
&
fifo
->
uevent
;
return
0
;
}
break
;
default:
break
;
}
return
-
EINVAL
;
}
static
int
nouveau_fifo_chid
(
struct
nouveau_fifo
*
priv
,
struct
nouveau_object
*
object
)
{
...
...
drivers/gpu/drm/nouveau/core/engine/fifo/nv04.c
浏览文件 @
867920f8
...
...
@@ -255,6 +255,7 @@ nv04_fifo_ofuncs = {
.
map
=
_nouveau_fifo_channel_map
,
.
rd32
=
_nouveau_fifo_channel_rd32
,
.
wr32
=
_nouveau_fifo_channel_wr32
,
.
ntfy
=
_nouveau_fifo_channel_ntfy
};
static
struct
nouveau_oclass
...
...
@@ -550,7 +551,7 @@ nv04_fifo_intr(struct nouveau_subdev *subdev)
}
if
(
status
&
0x40000000
)
{
n
vkm_event_send
(
&
priv
->
base
.
uevent
,
1
,
0
,
NULL
,
0
);
n
ouveau_fifo_uevent
(
&
priv
->
base
);
nv_wr32
(
priv
,
0x002100
,
0x40000000
);
status
&=
~
0x40000000
;
}
...
...
drivers/gpu/drm/nouveau/core/engine/fifo/nv10.c
浏览文件 @
867920f8
...
...
@@ -113,6 +113,7 @@ nv10_fifo_ofuncs = {
.
map
=
_nouveau_fifo_channel_map
,
.
rd32
=
_nouveau_fifo_channel_rd32
,
.
wr32
=
_nouveau_fifo_channel_wr32
,
.
ntfy
=
_nouveau_fifo_channel_ntfy
};
static
struct
nouveau_oclass
...
...
drivers/gpu/drm/nouveau/core/engine/fifo/nv17.c
浏览文件 @
867920f8
...
...
@@ -120,6 +120,7 @@ nv17_fifo_ofuncs = {
.
map
=
_nouveau_fifo_channel_map
,
.
rd32
=
_nouveau_fifo_channel_rd32
,
.
wr32
=
_nouveau_fifo_channel_wr32
,
.
ntfy
=
_nouveau_fifo_channel_ntfy
};
static
struct
nouveau_oclass
...
...
drivers/gpu/drm/nouveau/core/engine/fifo/nv40.c
浏览文件 @
867920f8
...
...
@@ -239,6 +239,7 @@ nv40_fifo_ofuncs = {
.
map
=
_nouveau_fifo_channel_map
,
.
rd32
=
_nouveau_fifo_channel_rd32
,
.
wr32
=
_nouveau_fifo_channel_wr32
,
.
ntfy
=
_nouveau_fifo_channel_ntfy
};
static
struct
nouveau_oclass
...
...
drivers/gpu/drm/nouveau/core/engine/fifo/nv50.c
浏览文件 @
867920f8
...
...
@@ -366,6 +366,7 @@ nv50_fifo_ofuncs_dma = {
.
map
=
_nouveau_fifo_channel_map
,
.
rd32
=
_nouveau_fifo_channel_rd32
,
.
wr32
=
_nouveau_fifo_channel_wr32
,
.
ntfy
=
_nouveau_fifo_channel_ntfy
};
static
struct
nouveau_ofuncs
...
...
@@ -377,6 +378,7 @@ nv50_fifo_ofuncs_ind = {
.
map
=
_nouveau_fifo_channel_map
,
.
rd32
=
_nouveau_fifo_channel_rd32
,
.
wr32
=
_nouveau_fifo_channel_wr32
,
.
ntfy
=
_nouveau_fifo_channel_ntfy
};
static
struct
nouveau_oclass
...
...
drivers/gpu/drm/nouveau/core/engine/fifo/nv84.c
浏览文件 @
867920f8
...
...
@@ -327,6 +327,7 @@ nv84_fifo_ofuncs_dma = {
.
map
=
_nouveau_fifo_channel_map
,
.
rd32
=
_nouveau_fifo_channel_rd32
,
.
wr32
=
_nouveau_fifo_channel_wr32
,
.
ntfy
=
_nouveau_fifo_channel_ntfy
};
static
struct
nouveau_ofuncs
...
...
@@ -338,6 +339,7 @@ nv84_fifo_ofuncs_ind = {
.
map
=
_nouveau_fifo_channel_map
,
.
rd32
=
_nouveau_fifo_channel_rd32
,
.
wr32
=
_nouveau_fifo_channel_wr32
,
.
ntfy
=
_nouveau_fifo_channel_ntfy
};
static
struct
nouveau_oclass
...
...
@@ -424,21 +426,9 @@ nv84_fifo_uevent_fini(struct nvkm_event *event, int type, int index)
nv_mask
(
fifo
,
0x002140
,
0x40000000
,
0x00000000
);
}
static
int
nv84_fifo_uevent_ctor
(
void
*
data
,
u32
size
,
struct
nvkm_notify
*
notify
)
{
if
(
size
==
0
)
{
notify
->
size
=
0
;
notify
->
types
=
1
;
notify
->
index
=
0
;
return
0
;
}
return
-
ENOSYS
;
}
static
const
struct
nvkm_event_func
nv84_fifo_uevent_func
=
{
.
ctor
=
n
v84
_fifo_uevent_ctor
,
.
ctor
=
n
ouveau
_fifo_uevent_ctor
,
.
init
=
nv84_fifo_uevent_init
,
.
fini
=
nv84_fifo_uevent_fini
,
};
...
...
drivers/gpu/drm/nouveau/core/engine/fifo/nvc0.c
浏览文件 @
867920f8
...
...
@@ -305,6 +305,7 @@ nvc0_fifo_ofuncs = {
.
map
=
_nouveau_fifo_channel_map
,
.
rd32
=
_nouveau_fifo_channel_rd32
,
.
wr32
=
_nouveau_fifo_channel_wr32
,
.
ntfy
=
_nouveau_fifo_channel_ntfy
};
static
struct
nouveau_oclass
...
...
@@ -742,7 +743,7 @@ nvc0_fifo_intr_engine_unit(struct nvc0_fifo_priv *priv, int engn)
for
(
unkn
=
0
;
unkn
<
8
;
unkn
++
)
{
u32
ints
=
(
intr
>>
(
unkn
*
0x04
))
&
inte
;
if
(
ints
&
0x1
)
{
n
vkm_event_send
(
&
priv
->
base
.
uevent
,
1
,
0
,
NULL
,
0
);
n
ouveau_fifo_uevent
(
&
priv
->
base
);
ints
&=
~
1
;
}
if
(
ints
)
{
...
...
@@ -852,21 +853,9 @@ nvc0_fifo_uevent_fini(struct nvkm_event *event, int type, int index)
nv_mask
(
fifo
,
0x002140
,
0x80000000
,
0x00000000
);
}
static
int
nvc0_fifo_uevent_ctor
(
void
*
data
,
u32
size
,
struct
nvkm_notify
*
notify
)
{
if
(
size
==
0
)
{
notify
->
size
=
0
;
notify
->
types
=
1
;
notify
->
index
=
0
;
return
0
;
}
return
-
ENOSYS
;
}
static
const
struct
nvkm_event_func
nvc0_fifo_uevent_func
=
{
.
ctor
=
n
vc0
_fifo_uevent_ctor
,
.
ctor
=
n
ouveau
_fifo_uevent_ctor
,
.
init
=
nvc0_fifo_uevent_init
,
.
fini
=
nvc0_fifo_uevent_fini
,
};
...
...
drivers/gpu/drm/nouveau/core/engine/fifo/nve0.c
浏览文件 @
867920f8
...
...
@@ -339,6 +339,7 @@ nve0_fifo_ofuncs = {
.
map
=
_nouveau_fifo_channel_map
,
.
rd32
=
_nouveau_fifo_channel_rd32
,
.
wr32
=
_nouveau_fifo_channel_wr32
,
.
ntfy
=
_nouveau_fifo_channel_ntfy
};
static
struct
nouveau_oclass
...
...
@@ -871,7 +872,7 @@ nve0_fifo_intr_runlist(struct nve0_fifo_priv *priv)
static
void
nve0_fifo_intr_engine
(
struct
nve0_fifo_priv
*
priv
)
{
n
vkm_event_send
(
&
priv
->
base
.
uevent
,
1
,
0
,
NULL
,
0
);
n
ouveau_fifo_uevent
(
&
priv
->
base
);
}
static
void
...
...
@@ -977,21 +978,9 @@ nve0_fifo_uevent_fini(struct nvkm_event *event, int type, int index)
nv_mask
(
fifo
,
0x002140
,
0x80000000
,
0x00000000
);
}
static
int
nve0_fifo_uevent_ctor
(
void
*
data
,
u32
size
,
struct
nvkm_notify
*
notify
)
{
if
(
size
==
0
)
{
notify
->
size
=
0
;
notify
->
types
=
1
;
notify
->
index
=
0
;
return
0
;
}
return
-
ENOSYS
;
}
static
const
struct
nvkm_event_func
nve0_fifo_uevent_func
=
{
.
ctor
=
n
ve0
_fifo_uevent_ctor
,
.
ctor
=
n
ouveau
_fifo_uevent_ctor
,
.
init
=
nve0_fifo_uevent_init
,
.
fini
=
nve0_fifo_uevent_fini
,
};
...
...
drivers/gpu/drm/nouveau/core/include/engine/fifo.h
浏览文件 @
867920f8
...
...
@@ -4,6 +4,7 @@
#include <core/namedb.h>
#include <core/gpuobj.h>
#include <core/engine.h>
#include <core/event.h>
struct
nouveau_fifo_chan
{
struct
nouveau_namedb
base
;
...
...
@@ -44,6 +45,7 @@ void _nouveau_fifo_channel_dtor(struct nouveau_object *);
int
_nouveau_fifo_channel_map
(
struct
nouveau_object
*
,
u64
*
,
u32
*
);
u32
_nouveau_fifo_channel_rd32
(
struct
nouveau_object
*
,
u64
);
void
_nouveau_fifo_channel_wr32
(
struct
nouveau_object
*
,
u64
,
u32
);
int
_nouveau_fifo_channel_ntfy
(
struct
nouveau_object
*
,
u32
,
struct
nvkm_event
**
);
struct
nouveau_fifo_base
{
struct
nouveau_gpuobj
base
;
...
...
@@ -114,6 +116,9 @@ extern struct nouveau_oclass *nve0_fifo_oclass;
extern
struct
nouveau_oclass
*
gk20a_fifo_oclass
;
extern
struct
nouveau_oclass
*
nv108_fifo_oclass
;
int
nouveau_fifo_uevent_ctor
(
void
*
,
u32
,
struct
nvkm_notify
*
);
void
nouveau_fifo_uevent
(
struct
nouveau_fifo
*
);
void
nv04_fifo_intr
(
struct
nouveau_subdev
*
);
int
nv04_fifo_context_attach
(
struct
nouveau_object
*
,
struct
nouveau_object
*
);
...
...
drivers/gpu/drm/nouveau/nouveau_fence.c
浏览文件 @
867920f8
...
...
@@ -29,6 +29,9 @@
#include <linux/ktime.h>
#include <linux/hrtimer.h>
#include <nvif/notify.h>
#include <nvif/event.h>
#include "nouveau_drm.h"
#include "nouveau_dma.h"
#include "nouveau_fence.h"
...
...
@@ -165,16 +168,16 @@ nouveau_fence_done(struct nouveau_fence *fence)
struct
nouveau_fence_wait
{
struct
nouveau_fence_priv
*
priv
;
struct
nv
km
_notify
notify
;
struct
nv
if
_notify
notify
;
};
static
int
nouveau_fence_wait_uevent_handler
(
struct
nv
km
_notify
*
notify
)
nouveau_fence_wait_uevent_handler
(
struct
nv
if
_notify
*
notify
)
{
struct
nouveau_fence_wait
*
wait
=
container_of
(
notify
,
typeof
(
*
wait
),
notify
);
wake_up_all
(
&
wait
->
priv
->
waiting
);
return
NV
KM
_NOTIFY_KEEP
;
return
NV
IF
_NOTIFY_KEEP
;
}
static
int
...
...
@@ -182,18 +185,22 @@ nouveau_fence_wait_uevent(struct nouveau_fence *fence, bool intr)
{
struct
nouveau_channel
*
chan
=
fence
->
channel
;
struct
nouveau_fifo
*
pfifo
=
nvkm_fifo
(
chan
->
device
);
struct
nouveau_fence_priv
*
priv
=
chan
->
drm
->
fence
;
struct
nouveau_fence_wait
wait
=
{
.
priv
=
priv
};
int
ret
=
0
;
ret
=
nv
km_notify_init
(
&
pfifo
->
uevent
,
ret
=
nv
if_notify_init
(
chan
->
object
,
NULL
,
nouveau_fence_wait_uevent_handler
,
false
,
NULL
,
0
,
0
,
&
wait
.
notify
);
G82_CHANNEL_DMA_V0_NTFY_UEVENT
,
&
(
struct
nvif_notify_uevent_req
)
{
},
sizeof
(
struct
nvif_notify_uevent_req
),
sizeof
(
struct
nvif_notify_uevent_rep
),
&
wait
.
notify
);
if
(
ret
)
return
ret
;
nv
km
_notify_get
(
&
wait
.
notify
);
nv
if
_notify_get
(
&
wait
.
notify
);
if
(
fence
->
timeout
)
{
unsigned
long
timeout
=
fence
->
timeout
-
jiffies
;
...
...
@@ -225,7 +232,7 @@ nouveau_fence_wait_uevent(struct nouveau_fence *fence, bool intr)
}
}
nv
km
_notify_fini
(
&
wait
.
notify
);
nv
if
_notify_fini
(
&
wait
.
notify
);
if
(
unlikely
(
ret
<
0
))
return
ret
;
...
...
drivers/gpu/drm/nouveau/nvif/class.h
浏览文件 @
867920f8
...
...
@@ -258,6 +258,7 @@ struct nv03_channel_dma_v0 {
__u64
offset
;
};
#define G82_CHANNEL_DMA_V0_NTFY_UEVENT 0x00
/*******************************************************************************
* GPFIFO channels
...
...
drivers/gpu/drm/nouveau/nvif/event.h
浏览文件 @
867920f8
...
...
@@ -51,4 +51,12 @@ struct nvif_notify_conn_rep_v0 {
__u8
pad02
[
6
];
};
struct
nvif_notify_uevent_req
{
/* nvif_notify_req ... */
};
struct
nvif_notify_uevent_rep
{
/* nvif_notify_rep ... */
};
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录