Subversion Repositories Kolibri OS

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
5564 serge 1
 
2
#define __NV50_WINSYS_H__
3
4
 
5
#include 
6
7
 
8
9
 
10
#include "nouveau_buffer.h"
11
12
 
13
 
14
#define NV04_PFIFO_MAX_PACKET_LEN 2047
15
#endif
16
17
 
18
 
19
nv50_add_bufctx_resident_bo(struct nouveau_bufctx *bufctx, int bin,
20
                            unsigned flags, struct nouveau_bo *bo)
21
{
22
   nouveau_bufctx_refn(bufctx, bin, bo, flags)->priv = NULL;
23
}
24
25
 
26
nv50_add_bufctx_resident(struct nouveau_bufctx *bufctx, int bin,
27
                         struct nv04_resource *res, unsigned flags)
28
{
29
   struct nouveau_bufref *ref =
30
      nouveau_bufctx_refn(bufctx, bin, res->bo, flags | res->domain);
31
   ref->priv = res;
32
   ref->priv_data = flags;
33
}
34
35
 
36
   nv50_add_bufctx_resident_bo(ctx, NV50_BIND_##bin, fl, bo);
37
38
 
39
   nv50_add_bufctx_resident(bctx, NV50_BIND_##bin, res, NOUVEAU_BO_##acc)
40
41
 
42
PUSH_REFN(struct nouveau_pushbuf *push, struct nouveau_bo *bo, uint32_t flags)
43
{
44
   struct nouveau_pushbuf_refn ref = { bo, flags };
45
   nouveau_pushbuf_refn(push, &ref, 1);
46
}
47
48
 
49
 
50
#define NV50_3D(n) SUBC_3D(NV50_3D_##n)
51
#define NVA0_3D(n) SUBC_3D(NVA0_3D_##n)
52
53
 
54
#define NV50_2D(n) SUBC_2D(NV50_2D_##n)
55
56
 
57
#define NV50_M2MF(n) SUBC_M2MF(NV50_M2MF_##n)
58
59
 
60
#define NV50_COMPUTE(n) SUBC_COMPUTE(NV50_COMPUTE_##n)
61
62
 
63
 
64
NV50_FIFO_PKHDR(int subc, int mthd, unsigned size)
65
{
66
   return 0x00000000 | (size << 18) | (subc << 13) | mthd;
67
}
68
69
 
70
NV50_FIFO_PKHDR_NI(int subc, int mthd, unsigned size)
71
{
72
   return 0x40000000 | (size << 18) | (subc << 13) | mthd;
73
}
74
75
 
76
NV50_FIFO_PKHDR_L(int subc, int mthd)
77
{
78
   return 0x00030000 | (subc << 13) | mthd;
79
}
80
81
 
82
 
83
nouveau_bo_memtype(const struct nouveau_bo *bo)
84
{
85
   return bo->config.nv50.memtype;
86
}
87
88
 
89
 
90
PUSH_DATAh(struct nouveau_pushbuf *push, uint64_t data)
91
{
92
   *push->cur++ = (uint32_t)(data >> 32);
93
}
94
95
 
96
BEGIN_NV04(struct nouveau_pushbuf *push, int subc, int mthd, unsigned size)
97
{
98
#ifndef NV50_PUSH_EXPLICIT_SPACE_CHECKING
99
   PUSH_SPACE(push, size + 1);
100
#endif
101
   PUSH_DATA (push, NV50_FIFO_PKHDR(subc, mthd, size));
102
}
103
104
 
105
BEGIN_NI04(struct nouveau_pushbuf *push, int subc, int mthd, unsigned size)
106
{
107
#ifndef NV50_PUSH_EXPLICIT_SPACE_CHECKING
108
   PUSH_SPACE(push, size + 1);
109
#endif
110
   PUSH_DATA (push, NV50_FIFO_PKHDR_NI(subc, mthd, size));
111
}
112
113
 
114
static INLINE void
115
BEGIN_NL50(struct nouveau_pushbuf *push, int subc, int mthd, uint32_t size)
116
{
117
#ifndef NV50_PUSH_EXPLICIT_SPACE_CHECKING
118
   PUSH_SPACE(push, 2);
119
#endif
120
   PUSH_DATA (push, NV50_FIFO_PKHDR_L(subc, mthd));
121
   PUSH_DATA (push, size);
122
}
123
124
 
125