1 #ifndef NOUVEAU_WINSYS_H
2 #define NOUVEAU_WINSYS_H
7 #include "pipe/p_defines.h"
11 #ifndef NV04_PFIFO_MAX_PACKET_LEN
12 #define NV04_PFIFO_MAX_PACKET_LEN 2047
15 #define NOUVEAU_MIN_BUFFER_MAP_ALIGN 64
16 #define NOUVEAU_MIN_BUFFER_MAP_ALIGN_MASK (NOUVEAU_MIN_BUFFER_MAP_ALIGN - 1)
18 static INLINE
uint32_t
19 PUSH_AVAIL(struct nouveau_pushbuf
*push
)
21 return push
->end
- push
->cur
;
25 PUSH_SPACE(struct nouveau_pushbuf
*push
, uint32_t size
)
27 if (PUSH_AVAIL(push
) < size
)
28 return nouveau_pushbuf_space(push
, size
, 0, 0) == 0;
33 PUSH_DATA(struct nouveau_pushbuf
*push
, uint32_t data
)
39 PUSH_DATAp(struct nouveau_pushbuf
*push
, const void *data
, uint32_t size
)
41 memcpy(push
->cur
, data
, size
* 4);
46 PUSH_DATAf(struct nouveau_pushbuf
*push
, float f
)
48 union { float f
; uint32_t i
; } u
;
54 PUSH_KICK(struct nouveau_pushbuf
*push
)
56 nouveau_pushbuf_kick(push
, push
->channel
);
60 #define NOUVEAU_RESOURCE_FLAG_LINEAR (PIPE_RESOURCE_FLAG_DRV_PRIV << 0)
61 #define NOUVEAU_RESOURCE_FLAG_DRV_PRIV (PIPE_RESOURCE_FLAG_DRV_PRIV << 1)
63 static INLINE
uint32_t
64 nouveau_screen_transfer_flags(unsigned pipe
)
68 if (!(pipe
& PIPE_TRANSFER_UNSYNCHRONIZED
)) {
69 if (pipe
& PIPE_TRANSFER_READ
)
70 flags
|= NOUVEAU_BO_RD
;
71 if (pipe
& PIPE_TRANSFER_WRITE
)
72 flags
|= NOUVEAU_BO_WR
;
73 if (pipe
& PIPE_TRANSFER_DONTBLOCK
)
74 flags
|= NOUVEAU_BO_NOBLOCK
;
80 extern struct pipe_screen
*
81 nv30_screen_create(struct nouveau_device
*);
83 extern struct pipe_screen
*
84 nv50_screen_create(struct nouveau_device
*);
86 extern struct pipe_screen
*
87 nvc0_screen_create(struct nouveau_device
*);