blob: 709e5ac680ec8356ea5b5c4b4ba61bf5ae9c4480 [file] [log] [blame]
Ben Skeggs20abd162012-04-30 11:33:43 -05001#ifndef __NOUVEAU_SOFTWARE_H__
2#define __NOUVEAU_SOFTWARE_H__
3
4struct nouveau_software_priv {
5 struct nouveau_exec_engine base;
6 struct list_head vblank;
Ben Skeggs0ade74b2012-05-08 11:22:27 +10007 spinlock_t peephole_lock;
Ben Skeggs20abd162012-04-30 11:33:43 -05008};
9
10struct nouveau_software_chan {
11 struct list_head flip;
12 struct {
13 struct list_head list;
Ben Skeggs0ade74b2012-05-08 11:22:27 +100014 u32 channel;
15 u32 ctxdma;
Ben Skeggs20abd162012-04-30 11:33:43 -050016 u32 offset;
17 u32 value;
18 u32 head;
19 } vblank;
20};
21
22static inline void
Ben Skeggs20abd162012-04-30 11:33:43 -050023nouveau_software_context_new(struct nouveau_software_chan *pch)
24{
25 INIT_LIST_HEAD(&pch->flip);
Marcin Slusarz71585542012-07-25 20:42:05 +020026 INIT_LIST_HEAD(&pch->vblank.list);
Ben Skeggs20abd162012-04-30 11:33:43 -050027}
28
29static inline void
30nouveau_software_create(struct nouveau_software_priv *psw)
31{
32 INIT_LIST_HEAD(&psw->vblank);
Ben Skeggs0ade74b2012-05-08 11:22:27 +100033 spin_lock_init(&psw->peephole_lock);
Ben Skeggs20abd162012-04-30 11:33:43 -050034}
35
36static inline u16
37nouveau_software_class(struct drm_device *dev)
38{
39 struct drm_nouveau_private *dev_priv = dev->dev_private;
40 if (dev_priv->card_type <= NV_04)
41 return 0x006e;
42 if (dev_priv->card_type <= NV_40)
43 return 0x016e;
44 if (dev_priv->card_type <= NV_50)
45 return 0x506e;
46 if (dev_priv->card_type <= NV_E0)
47 return 0x906e;
48 return 0x0000;
49}
50
51int nv04_software_create(struct drm_device *);
52int nv50_software_create(struct drm_device *);
53int nvc0_software_create(struct drm_device *);
Ben Skeggs35bcf5d2012-04-30 11:34:10 -050054u64 nvc0_software_crtc(struct nouveau_channel *, int crtc);
Ben Skeggs20abd162012-04-30 11:33:43 -050055
56#endif