1 #ifndef __NVC0_SCREEN_H__
2 #define __NVC0_SCREEN_H__
5 #include "nouveau/nouveau_screen.h"
7 #include "nvc0_winsys.h"
8 #include "nvc0_stateobj.h"
10 #define NVC0_TIC_MAX_ENTRIES 2048
11 #define NVC0_TSC_MAX_ENTRIES 2048
17 struct nouveau_screen base
;
18 struct nouveau_winsys
*nvws
;
20 struct nvc0_context
*cur_ctx
;
22 struct nouveau_bo
*text
;
23 struct nouveau_bo
*uniforms
;
24 struct nouveau_bo
*tls
;
25 struct nouveau_bo
*txc
; /* TIC (offset 0) and TSC (65536) */
26 struct nouveau_bo
*mp_stack_bo
;
30 struct nouveau_resource
*text_heap
;
35 uint32_t lock
[NVC0_TIC_MAX_ENTRIES
/ 32];
41 uint32_t lock
[NVC0_TSC_MAX_ENTRIES
/ 32];
46 struct nvc0_fence
*head
;
47 struct nvc0_fence
*tail
;
48 struct nvc0_fence
*current
;
50 uint32_t sequence_ack
;
51 struct nouveau_bo
*bo
;
55 static INLINE
struct nvc0_screen
*
56 nvc0_screen(struct pipe_screen
*screen
)
58 return (struct nvc0_screen
*)screen
;
61 void nvc0_screen_make_buffers_resident(struct nvc0_screen
*);
63 int nvc0_screen_tic_alloc(struct nvc0_screen
*, void *);
64 int nvc0_screen_tsc_alloc(struct nvc0_screen
*, void *);
67 nvc0_screen_fence_new(struct nvc0_screen
*, struct nvc0_fence
**, boolean emit
);
76 extern const struct nvc0_format nvc0_format_table
[];
79 nvc0_screen_tic_unlock(struct nvc0_screen
*screen
, struct nvc0_tic_entry
*tic
)
82 screen
->tic
.lock
[tic
->id
/ 32] &= ~(1 << (tic
->id
% 32));
86 nvc0_screen_tsc_unlock(struct nvc0_screen
*screen
, struct nvc0_tsc_entry
*tsc
)
89 screen
->tsc
.lock
[tsc
->id
/ 32] &= ~(1 << (tsc
->id
% 32));
93 nvc0_screen_tic_free(struct nvc0_screen
*screen
, struct nvc0_tic_entry
*tic
)
96 screen
->tic
.entries
[tic
->id
] = NULL
;
97 screen
->tic
.lock
[tic
->id
/ 32] &= ~(1 << (tic
->id
% 32));
102 nvc0_screen_tsc_free(struct nvc0_screen
*screen
, struct nvc0_tsc_entry
*tsc
)
105 screen
->tsc
.entries
[tsc
->id
] = NULL
;
106 screen
->tsc
.lock
[tsc
->id
/ 32] &= ~(1 << (tsc
->id
% 32));