drm/nvc0-/gr: generate grctx template at init time, not first context ctor
[deliverable/linux.git] / drivers / gpu / drm / nouveau / nouveau_software.h
1 #ifndef __NOUVEAU_SOFTWARE_H__
2 #define __NOUVEAU_SOFTWARE_H__
3
4 #include "nouveau_fence.h"
5
6 struct nouveau_software_priv {
7 struct nouveau_exec_engine base;
8 struct list_head vblank;
9 spinlock_t peephole_lock;
10 };
11
12 struct nouveau_software_chan {
13 int (*flip)(void *data);
14 void *flip_data;
15
16 struct {
17 struct list_head list;
18 u32 channel;
19 u32 ctxdma;
20 u32 offset;
21 u32 value;
22 u32 head;
23 } vblank;
24 };
25
26 static inline void
27 nouveau_software_context_new(struct nouveau_channel *chan,
28 struct nouveau_software_chan *pch)
29 {
30 pch->flip = nouveau_flip_complete;
31 pch->flip_data = chan;
32 }
33
34 static inline void
35 nouveau_software_create(struct nouveau_software_priv *psw)
36 {
37 INIT_LIST_HEAD(&psw->vblank);
38 spin_lock_init(&psw->peephole_lock);
39 }
40
41 static inline u16
42 nouveau_software_class(struct drm_device *dev)
43 {
44 struct drm_nouveau_private *dev_priv = dev->dev_private;
45 if (dev_priv->card_type <= NV_04)
46 return 0x006e;
47 if (dev_priv->card_type <= NV_40)
48 return 0x016e;
49 if (dev_priv->card_type <= NV_50)
50 return 0x506e;
51 if (dev_priv->card_type <= NV_E0)
52 return 0x906e;
53 return 0x0000;
54 }
55
56 int nv04_software_create(struct drm_device *);
57 int nv50_software_create(struct drm_device *);
58 int nvc0_software_create(struct drm_device *);
59
60 #endif
This page took 0.088992 seconds and 5 git commands to generate.