Lines Matching refs:q
60 nv50_query_allocate(struct nv50_context *nv50, struct nv50_query *q, int size) in nv50_query_allocate() argument
65 if (q->bo) { in nv50_query_allocate()
66 nouveau_bo_ref(NULL, &q->bo); in nv50_query_allocate()
67 if (q->mm) { in nv50_query_allocate()
68 if (q->ready) in nv50_query_allocate()
69 nouveau_mm_free(q->mm); in nv50_query_allocate()
72 q->mm); in nv50_query_allocate()
76 q->mm = nouveau_mm_allocate(screen->base.mm_GART, size, &q->bo, &q->base); in nv50_query_allocate()
77 if (!q->bo) in nv50_query_allocate()
79 q->offset = q->base; in nv50_query_allocate()
81 ret = nouveau_bo_map(q->bo, 0, screen->base.client); in nv50_query_allocate()
83 nv50_query_allocate(nv50, q, 0); in nv50_query_allocate()
86 q->data = (uint32_t *)((uint8_t *)q->bo->map + q->base); in nv50_query_allocate()
102 struct nv50_query *q; in nv50_query_create() local
104 q = CALLOC_STRUCT(nv50_query); in nv50_query_create()
105 if (!q) in nv50_query_create()
108 if (!nv50_query_allocate(nv50, q, NV50_QUERY_ALLOC_SPACE)) { in nv50_query_create()
109 FREE(q); in nv50_query_create()
113 q->is64bit = (type == PIPE_QUERY_PRIMITIVES_GENERATED || in nv50_query_create()
116 q->type = type; in nv50_query_create()
118 if (q->type == PIPE_QUERY_OCCLUSION_COUNTER) { in nv50_query_create()
119 q->offset -= 16; in nv50_query_create()
120 q->data -= 16 / sizeof(*q->data); /* we advance before query_begin ! */ in nv50_query_create()
123 return (struct pipe_query *)q; in nv50_query_create()
127 nv50_query_get(struct nouveau_pushbuf *push, struct nv50_query *q, in nv50_query_get() argument
130 offset += q->offset; in nv50_query_get()
133 PUSH_REFN (push, q->bo, NOUVEAU_BO_GART | NOUVEAU_BO_WR); in nv50_query_get()
135 PUSH_DATAh(push, q->bo->offset + offset); in nv50_query_get()
136 PUSH_DATA (push, q->bo->offset + offset); in nv50_query_get()
137 PUSH_DATA (push, q->sequence); in nv50_query_get()
146 struct nv50_query *q = nv50_query(pq); in nv50_query_begin() local
152 if (q->type == PIPE_QUERY_OCCLUSION_COUNTER) { in nv50_query_begin()
153 q->offset += 16; in nv50_query_begin()
154 q->data += 16 / sizeof(*q->data); in nv50_query_begin()
155 if (q->offset - q->base == NV50_QUERY_ALLOC_SPACE) in nv50_query_begin()
156 nv50_query_allocate(nv50, q, NV50_QUERY_ALLOC_SPACE); in nv50_query_begin()
161 q->data[1] = 1; /* initial render condition = TRUE */ in nv50_query_begin()
163 if (!q->is64bit) in nv50_query_begin()
164 q->data[0] = q->sequence++; /* the previously used one */ in nv50_query_begin()
166 switch (q->type) { in nv50_query_begin()
175 nv50_query_get(push, q, 0x10, 0x06805002); in nv50_query_begin()
178 nv50_query_get(push, q, 0x10, 0x05805002); in nv50_query_begin()
181 nv50_query_get(push, q, 0x20, 0x05805002); in nv50_query_begin()
182 nv50_query_get(push, q, 0x30, 0x06805002); in nv50_query_begin()
186 nv50_query_get(push, q, 0x10, 0x00005002); in nv50_query_begin()
191 q->ready = FALSE; in nv50_query_begin()
199 struct nv50_query *q = nv50_query(pq); in nv50_query_end() local
201 switch (q->type) { in nv50_query_end()
203 nv50_query_get(push, q, 0, 0x0100f002); in nv50_query_end()
209 nv50_query_get(push, q, 0, 0x06805002); in nv50_query_end()
212 nv50_query_get(push, q, 0, 0x05805002); in nv50_query_end()
215 nv50_query_get(push, q, 0x00, 0x05805002); in nv50_query_end()
216 nv50_query_get(push, q, 0x10, 0x06805002); in nv50_query_end()
219 q->sequence++; in nv50_query_end()
223 nv50_query_get(push, q, 0, 0x00005002); in nv50_query_end()
226 q->sequence++; in nv50_query_end()
227 nv50_query_get(push, q, 0, 0x1000f010); in nv50_query_end()
230 nv50_query_get(push, q, 0, 0x0d005002 | (q->index << 5)); in nv50_query_end()
236 q->ready = q->flushed = FALSE; in nv50_query_end()
240 nv50_query_ready(struct nv50_query *q) in nv50_query_ready() argument
242 return q->ready || (!q->is64bit && (q->data[0] == q->sequence)); in nv50_query_ready()
250 struct nv50_query *q = nv50_query(pq); in nv50_query_result() local
254 uint64_t *data64 = (uint64_t *)q->data; in nv50_query_result()
256 if (!q->ready) /* update ? */ in nv50_query_result()
257 q->ready = nv50_query_ready(q); in nv50_query_result()
258 if (!q->ready) { in nv50_query_result()
261 if (!q->flushed) { in nv50_query_result()
262 q->flushed = TRUE; in nv50_query_result()
267 if (nouveau_bo_wait(q->bo, NOUVEAU_BO_RD, nv50->screen->base.client)) in nv50_query_result()
270 q->ready = TRUE; in nv50_query_result()
272 switch (q->type) { in nv50_query_result()
277 res64[0] = q->data[1]; in nv50_query_result()
298 res32[0] = q->data[1]; in nv50_query_result()
310 struct nv50_query *q = nv50_query(pq); in nv84_query_fifo_wait() local
311 unsigned offset = q->offset; in nv84_query_fifo_wait()
314 PUSH_REFN (push, q->bo, NOUVEAU_BO_GART | NOUVEAU_BO_RD); in nv84_query_fifo_wait()
316 PUSH_DATAh(push, q->bo->offset + offset); in nv84_query_fifo_wait()
317 PUSH_DATA (push, q->bo->offset + offset); in nv84_query_fifo_wait()
318 PUSH_DATA (push, q->sequence); in nv84_query_fifo_wait()
328 struct nv50_query *q; in nv50_render_condition() local
337 q = nv50_query(pq); in nv50_render_condition()
346 PUSH_DATAh(push, q->bo->offset + q->offset); in nv50_render_condition()
347 PUSH_DATA (push, q->bo->offset + q->offset); in nv50_render_condition()
355 struct nv50_query *q = nv50_query(pq); in nv50_query_pushbuf_submit() local
361 nouveau_pushbuf_data(push, q->bo, q->offset + result_offset, 4 | in nv50_query_pushbuf_submit()