aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_fence.h
diff options
context:
space:
mode:
authorMaarten Lankhorst <maarten.lankhorst@ubuntu.com>2014-01-09 05:03:11 -0500
committerMaarten Lankhorst <maarten.lankhorst@canonical.com>2014-09-02 10:41:50 -0400
commit29ba89b2371d466ca68973525816cf10debc2655 (patch)
tree0433045bea840aed27057bedf422c02018b66d4e /drivers/gpu/drm/nouveau/nouveau_fence.h
parent2298e804e96eb3635c39519c8287befd92460303 (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.h22
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
4struct nouveau_drm; 7struct nouveau_drm;
8struct nouveau_bo;
5 9
6struct nouveau_fence { 10struct 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
18int nouveau_fence_new(struct nouveau_channel *, bool sysmem, 21int nouveau_fence_new(struct nouveau_channel *, bool sysmem,
@@ -25,9 +28,10 @@ int nouveau_fence_emit(struct nouveau_fence *, struct nouveau_channel *);
25bool nouveau_fence_done(struct nouveau_fence *); 28bool nouveau_fence_done(struct nouveau_fence *);
26void nouveau_fence_work(struct nouveau_fence *, void (*)(void *), void *); 29void nouveau_fence_work(struct nouveau_fence *, void (*)(void *), void *);
27int nouveau_fence_wait(struct nouveau_fence *, bool lazy, bool intr); 30int nouveau_fence_wait(struct nouveau_fence *, bool lazy, bool intr);
28int nouveau_fence_sync(struct nouveau_fence *, struct nouveau_channel *); 31int nouveau_fence_sync(struct nouveau_bo *, struct nouveau_channel *);
29 32
30struct nouveau_fence_chan { 33struct 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
45struct nouveau_fence_priv { 53struct 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
58void nouveau_fence_context_new(struct nouveau_fence_chan *); 66void nouveau_fence_context_new(struct nouveau_channel *, struct nouveau_fence_chan *);
59void nouveau_fence_context_del(struct nouveau_fence_chan *); 67void nouveau_fence_context_del(struct nouveau_fence_chan *);
60 68
61int nv04_fence_create(struct nouveau_drm *); 69int nv04_fence_create(struct nouveau_drm *);