diff options
author | Maarten Lankhorst <maarten.lankhorst@ubuntu.com> | 2014-01-09 05:03:11 -0500 |
---|---|---|
committer | Maarten Lankhorst <maarten.lankhorst@canonical.com> | 2014-09-02 10:41:50 -0400 |
commit | 29ba89b2371d466ca68973525816cf10debc2655 (patch) | |
tree | 0433045bea840aed27057bedf422c02018b66d4e /drivers/gpu/drm/nouveau/nouveau_fence.h | |
parent | 2298e804e96eb3635c39519c8287befd92460303 (diff) |
drm/nouveau: rework to new fence interface
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Acked-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_fence.h')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_fence.h | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_fence.h b/drivers/gpu/drm/nouveau/nouveau_fence.h index c57bb61da58c..44efd8c7426c 100644 --- a/drivers/gpu/drm/nouveau/nouveau_fence.h +++ b/drivers/gpu/drm/nouveau/nouveau_fence.h | |||
@@ -1,18 +1,21 @@ | |||
1 | #ifndef __NOUVEAU_FENCE_H__ | 1 | #ifndef __NOUVEAU_FENCE_H__ |
2 | #define __NOUVEAU_FENCE_H__ | 2 | #define __NOUVEAU_FENCE_H__ |
3 | 3 | ||
4 | #include <linux/fence.h> | ||
5 | #include <nvif/notify.h> | ||
6 | |||
4 | struct nouveau_drm; | 7 | struct nouveau_drm; |
8 | struct nouveau_bo; | ||
5 | 9 | ||
6 | struct nouveau_fence { | 10 | struct nouveau_fence { |
11 | struct fence base; | ||
12 | |||
7 | struct list_head head; | 13 | struct list_head head; |
8 | struct list_head work; | ||
9 | struct kref kref; | ||
10 | 14 | ||
11 | bool sysmem; | 15 | bool sysmem; |
12 | 16 | ||
13 | struct nouveau_channel *channel; | 17 | struct nouveau_channel *channel; |
14 | unsigned long timeout; | 18 | unsigned long timeout; |
15 | u32 sequence; | ||
16 | }; | 19 | }; |
17 | 20 | ||
18 | int nouveau_fence_new(struct nouveau_channel *, bool sysmem, | 21 | int nouveau_fence_new(struct nouveau_channel *, bool sysmem, |
@@ -25,9 +28,10 @@ int nouveau_fence_emit(struct nouveau_fence *, struct nouveau_channel *); | |||
25 | bool nouveau_fence_done(struct nouveau_fence *); | 28 | bool nouveau_fence_done(struct nouveau_fence *); |
26 | void nouveau_fence_work(struct nouveau_fence *, void (*)(void *), void *); | 29 | void nouveau_fence_work(struct nouveau_fence *, void (*)(void *), void *); |
27 | int nouveau_fence_wait(struct nouveau_fence *, bool lazy, bool intr); | 30 | int nouveau_fence_wait(struct nouveau_fence *, bool lazy, bool intr); |
28 | int nouveau_fence_sync(struct nouveau_fence *, struct nouveau_channel *); | 31 | int nouveau_fence_sync(struct nouveau_bo *, struct nouveau_channel *); |
29 | 32 | ||
30 | struct nouveau_fence_chan { | 33 | struct nouveau_fence_chan { |
34 | spinlock_t lock; | ||
31 | struct list_head pending; | 35 | struct list_head pending; |
32 | struct list_head flip; | 36 | struct list_head flip; |
33 | 37 | ||
@@ -38,8 +42,12 @@ struct nouveau_fence_chan { | |||
38 | int (*emit32)(struct nouveau_channel *, u64, u32); | 42 | int (*emit32)(struct nouveau_channel *, u64, u32); |
39 | int (*sync32)(struct nouveau_channel *, u64, u32); | 43 | int (*sync32)(struct nouveau_channel *, u64, u32); |
40 | 44 | ||
41 | spinlock_t lock; | ||
42 | u32 sequence; | 45 | u32 sequence; |
46 | u32 context; | ||
47 | char name[24]; | ||
48 | |||
49 | struct nvif_notify notify; | ||
50 | int notify_ref; | ||
43 | }; | 51 | }; |
44 | 52 | ||
45 | struct nouveau_fence_priv { | 53 | struct nouveau_fence_priv { |
@@ -49,13 +57,13 @@ struct nouveau_fence_priv { | |||
49 | int (*context_new)(struct nouveau_channel *); | 57 | int (*context_new)(struct nouveau_channel *); |
50 | void (*context_del)(struct nouveau_channel *); | 58 | void (*context_del)(struct nouveau_channel *); |
51 | 59 | ||
52 | wait_queue_head_t waiting; | 60 | u32 contexts, context_base; |
53 | bool uevent; | 61 | bool uevent; |
54 | }; | 62 | }; |
55 | 63 | ||
56 | #define nouveau_fence(drm) ((struct nouveau_fence_priv *)(drm)->fence) | 64 | #define nouveau_fence(drm) ((struct nouveau_fence_priv *)(drm)->fence) |
57 | 65 | ||
58 | void nouveau_fence_context_new(struct nouveau_fence_chan *); | 66 | void nouveau_fence_context_new(struct nouveau_channel *, struct nouveau_fence_chan *); |
59 | void nouveau_fence_context_del(struct nouveau_fence_chan *); | 67 | void nouveau_fence_context_del(struct nouveau_fence_chan *); |
60 | 68 | ||
61 | int nv04_fence_create(struct nouveau_drm *); | 69 | int nv04_fence_create(struct nouveau_drm *); |