require libnouveau_drm 0.0.109.1
[nouveau] / src / nv50_accel.h
1 #ifndef __NV50_ACCEL_H__
2 #define __NV50_ACCEL_H__
3
4 /* "Tesla scratch buffer" offsets */
5 #define PVP_OFFSET 0x00000000 /* Vertex program */
6 #define PFP_OFFSET 0x00001000 /* Fragment program */
7 #define TIC_OFFSET 0x00002000 /* Texture Image Control */
8 #define TSC_OFFSET 0x00003000 /* Texture Sampler Control */
9
10 /* Fragment programs */
11 #define PFP_S     0x0000 /* (src) */
12 #define PFP_C     0x0100 /* (src IN mask) */
13 #define PFP_CCA   0x0200 /* (src IN mask) component-alpha */
14 #define PFP_CCASA 0x0300 /* (src IN mask) component-alpha src-alpha */
15 #define PFP_S_A8  0x0400 /* (src) a8 rt */
16 #define PFP_C_A8  0x0500 /* (src IN mask) a8 rt - same for CA and CA_SA */
17 #define PFP_NV12  0x0600 /* NV12 YUV->RGB */
18
19 /* Constant buffer assignments */
20 #define CB_TSC 0
21 #define CB_TIC 1
22
23 static __inline__ void
24 VTX1s(NVPtr pNv, float sx, float sy, unsigned dx, unsigned dy)
25 {
26         struct nouveau_channel *chan = pNv->chan;
27         struct nouveau_grobj *tesla = pNv->Nv3D;
28
29         BEGIN_RING(chan, tesla, NV50TCL_VTX_ATTR_2F_X(8), 2);
30         OUT_RINGf (chan, sx);
31         OUT_RINGf (chan, sy);
32         BEGIN_RING(chan, tesla, NV50TCL_VTX_ATTR_2I(0), 1);
33         OUT_RING  (chan, (dy << 16) | dx);
34 }
35
36 static __inline__ void
37 VTX2s(NVPtr pNv, float s1x, float s1y, float s2x, float s2y,
38                  unsigned dx, unsigned dy)
39 {
40         struct nouveau_channel *chan = pNv->chan;
41         struct nouveau_grobj *tesla = pNv->Nv3D;
42
43         BEGIN_RING(chan, tesla, NV50TCL_VTX_ATTR_2F_X(8), 4);
44         OUT_RINGf (chan, s1x);
45         OUT_RINGf (chan, s1y);
46         OUT_RINGf (chan, s2x);
47         OUT_RINGf (chan, s2y);
48         BEGIN_RING(chan, tesla, NV50TCL_VTX_ATTR_2I(0), 1);
49         OUT_RING  (chan, (dy << 16) | dx);
50 }
51
52 #endif