2 * Copyright 2010 Jerome Glisse <glisse@freedesktop.org>
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * on the rights to use, copy, modify, merge, publish, distribute, sub
8 * license, and/or sell copies of the Software, and to permit persons to whom
9 * the Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
19 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
20 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
21 * USE OR OTHER DEALINGS IN THE SOFTWARE.
23 #include "r600_pipe.h"
25 #include "util/u_memory.h"
26 #include "r600_hw_context_priv.h"
28 static bool r600_is_timer_query(unsigned type
)
30 return type
== PIPE_QUERY_TIME_ELAPSED
||
31 type
== PIPE_QUERY_TIMESTAMP
||
32 type
== PIPE_QUERY_TIMESTAMP_DISJOINT
;
35 static struct r600_resource
*r600_new_query_buffer(struct r600_context
*ctx
, unsigned type
)
37 unsigned j
, i
, num_results
, buf_size
= 4096;
39 /* Queries are normally read by the CPU after
40 * being written by the gpu, hence staging is probably a good
43 struct r600_resource
*buf
= (struct r600_resource
*)
44 pipe_buffer_create(&ctx
->screen
->screen
, PIPE_BIND_CUSTOM
,
45 PIPE_USAGE_STAGING
, buf_size
);
48 case PIPE_QUERY_OCCLUSION_COUNTER
:
49 case PIPE_QUERY_OCCLUSION_PREDICATE
:
50 results
= ctx
->ws
->buffer_map(buf
->buf
, ctx
->cs
, PIPE_TRANSFER_WRITE
);
51 memset(results
, 0, buf_size
);
53 /* Set top bits for unused backends. */
54 num_results
= buf_size
/ (16 * ctx
->max_db
);
55 for (j
= 0; j
< num_results
; j
++) {
56 for (i
= 0; i
< ctx
->max_db
; i
++) {
57 if (!(ctx
->backend_mask
& (1<<i
))) {
58 results
[(i
* 4)+1] = 0x80000000;
59 results
[(i
* 4)+3] = 0x80000000;
62 results
+= 4 * ctx
->max_db
;
64 ctx
->ws
->buffer_unmap(buf
->buf
);
66 case PIPE_QUERY_TIME_ELAPSED
:
68 case PIPE_QUERY_PRIMITIVES_EMITTED
:
69 case PIPE_QUERY_PRIMITIVES_GENERATED
:
70 case PIPE_QUERY_SO_STATISTICS
:
71 case PIPE_QUERY_SO_OVERFLOW_PREDICATE
:
72 results
= ctx
->ws
->buffer_map(buf
->buf
, ctx
->cs
, PIPE_TRANSFER_WRITE
);
73 memset(results
, 0, buf_size
);
74 ctx
->ws
->buffer_unmap(buf
->buf
);
82 static void r600_emit_query_begin(struct r600_context
*ctx
, struct r600_query
*query
)
84 struct radeon_winsys_cs
*cs
= ctx
->cs
;
87 r600_need_cs_space(ctx
, query
->num_cs_dw
* 2, TRUE
);
89 /* Get a new query buffer if needed. */
90 if (query
->buffer
.results_end
+ query
->result_size
> query
->buffer
.buf
->b
.b
.b
.width0
) {
91 struct r600_query_buffer
*qbuf
= MALLOC_STRUCT(r600_query_buffer
);
92 *qbuf
= query
->buffer
;
93 query
->buffer
.buf
= r600_new_query_buffer(ctx
, query
->type
);
94 query
->buffer
.results_end
= 0;
95 query
->buffer
.previous
= qbuf
;
98 /* emit begin query */
99 va
= r600_resource_va(&ctx
->screen
->screen
, (void*)query
->buffer
.buf
);
100 va
+= query
->buffer
.results_end
;
102 switch (query
->type
) {
103 case PIPE_QUERY_OCCLUSION_COUNTER
:
104 case PIPE_QUERY_OCCLUSION_PREDICATE
:
105 cs
->buf
[cs
->cdw
++] = PKT3(PKT3_EVENT_WRITE
, 2, 0);
106 cs
->buf
[cs
->cdw
++] = EVENT_TYPE(EVENT_TYPE_ZPASS_DONE
) | EVENT_INDEX(1);
107 cs
->buf
[cs
->cdw
++] = va
;
108 cs
->buf
[cs
->cdw
++] = (va
>> 32UL) & 0xFF;
110 case PIPE_QUERY_PRIMITIVES_EMITTED
:
111 case PIPE_QUERY_PRIMITIVES_GENERATED
:
112 case PIPE_QUERY_SO_STATISTICS
:
113 case PIPE_QUERY_SO_OVERFLOW_PREDICATE
:
114 cs
->buf
[cs
->cdw
++] = PKT3(PKT3_EVENT_WRITE
, 2, 0);
115 cs
->buf
[cs
->cdw
++] = EVENT_TYPE(EVENT_TYPE_SAMPLE_STREAMOUTSTATS
) | EVENT_INDEX(3);
116 cs
->buf
[cs
->cdw
++] = va
;
117 cs
->buf
[cs
->cdw
++] = (va
>> 32UL) & 0xFF;
119 case PIPE_QUERY_TIME_ELAPSED
:
120 cs
->buf
[cs
->cdw
++] = PKT3(PKT3_EVENT_WRITE_EOP
, 4, 0);
121 cs
->buf
[cs
->cdw
++] = EVENT_TYPE(EVENT_TYPE_CACHE_FLUSH_AND_INV_TS_EVENT
) | EVENT_INDEX(5);
122 cs
->buf
[cs
->cdw
++] = va
;
123 cs
->buf
[cs
->cdw
++] = (3 << 29) | ((va
>> 32UL) & 0xFF);
124 cs
->buf
[cs
->cdw
++] = 0;
125 cs
->buf
[cs
->cdw
++] = 0;
130 cs
->buf
[cs
->cdw
++] = PKT3(PKT3_NOP
, 0, 0);
131 cs
->buf
[cs
->cdw
++] = r600_context_bo_reloc(ctx
, query
->buffer
.buf
, RADEON_USAGE_WRITE
);
133 if (r600_is_timer_query(query
->type
)) {
134 ctx
->num_cs_dw_timer_queries_suspend
+= query
->num_cs_dw
;
136 ctx
->num_cs_dw_nontimer_queries_suspend
+= query
->num_cs_dw
;
140 static void r600_emit_query_end(struct r600_context
*ctx
, struct r600_query
*query
)
142 struct radeon_winsys_cs
*cs
= ctx
->cs
;
145 va
= r600_resource_va(&ctx
->screen
->screen
, (void*)query
->buffer
.buf
);
147 switch (query
->type
) {
148 case PIPE_QUERY_OCCLUSION_COUNTER
:
149 case PIPE_QUERY_OCCLUSION_PREDICATE
:
150 va
+= query
->buffer
.results_end
+ 8;
151 cs
->buf
[cs
->cdw
++] = PKT3(PKT3_EVENT_WRITE
, 2, 0);
152 cs
->buf
[cs
->cdw
++] = EVENT_TYPE(EVENT_TYPE_ZPASS_DONE
) | EVENT_INDEX(1);
153 cs
->buf
[cs
->cdw
++] = va
;
154 cs
->buf
[cs
->cdw
++] = (va
>> 32UL) & 0xFF;
156 case PIPE_QUERY_PRIMITIVES_EMITTED
:
157 case PIPE_QUERY_PRIMITIVES_GENERATED
:
158 case PIPE_QUERY_SO_STATISTICS
:
159 case PIPE_QUERY_SO_OVERFLOW_PREDICATE
:
160 cs
->buf
[cs
->cdw
++] = PKT3(PKT3_EVENT_WRITE
, 2, 0);
161 cs
->buf
[cs
->cdw
++] = EVENT_TYPE(EVENT_TYPE_SAMPLE_STREAMOUTSTATS
) | EVENT_INDEX(3);
162 cs
->buf
[cs
->cdw
++] = query
->buffer
.results_end
+ query
->result_size
/2;
163 cs
->buf
[cs
->cdw
++] = 0;
165 case PIPE_QUERY_TIME_ELAPSED
:
166 va
+= query
->buffer
.results_end
+ query
->result_size
/2;
167 cs
->buf
[cs
->cdw
++] = PKT3(PKT3_EVENT_WRITE_EOP
, 4, 0);
168 cs
->buf
[cs
->cdw
++] = EVENT_TYPE(EVENT_TYPE_CACHE_FLUSH_AND_INV_TS_EVENT
) | EVENT_INDEX(5);
169 cs
->buf
[cs
->cdw
++] = va
;
170 cs
->buf
[cs
->cdw
++] = (3 << 29) | ((va
>> 32UL) & 0xFF);
171 cs
->buf
[cs
->cdw
++] = 0;
172 cs
->buf
[cs
->cdw
++] = 0;
177 cs
->buf
[cs
->cdw
++] = PKT3(PKT3_NOP
, 0, 0);
178 cs
->buf
[cs
->cdw
++] = r600_context_bo_reloc(ctx
, query
->buffer
.buf
, RADEON_USAGE_WRITE
);
180 query
->buffer
.results_end
+= query
->result_size
;
182 if (r600_is_timer_query(query
->type
)) {
183 ctx
->num_cs_dw_timer_queries_suspend
-= query
->num_cs_dw
;
185 ctx
->num_cs_dw_nontimer_queries_suspend
-= query
->num_cs_dw
;
189 static void r600_emit_query_predication(struct r600_context
*ctx
, struct r600_query
*query
,
190 int operation
, bool flag_wait
)
192 struct radeon_winsys_cs
*cs
= ctx
->cs
;
194 if (operation
== PREDICATION_OP_CLEAR
) {
195 r600_need_cs_space(ctx
, 3, FALSE
);
197 cs
->buf
[cs
->cdw
++] = PKT3(PKT3_SET_PREDICATION
, 1, 0);
198 cs
->buf
[cs
->cdw
++] = 0;
199 cs
->buf
[cs
->cdw
++] = PRED_OP(PREDICATION_OP_CLEAR
);
201 struct r600_query_buffer
*qbuf
;
205 /* Find how many results there are. */
207 for (qbuf
= &query
->buffer
; qbuf
; qbuf
= qbuf
->previous
) {
208 count
+= qbuf
->results_end
/ query
->result_size
;
211 r600_need_cs_space(ctx
, 5 * count
, TRUE
);
213 op
= PRED_OP(operation
) | PREDICATION_DRAW_VISIBLE
|
214 (flag_wait
? PREDICATION_HINT_WAIT
: PREDICATION_HINT_NOWAIT_DRAW
);
216 /* emit predicate packets for all data blocks */
217 for (qbuf
= &query
->buffer
; qbuf
; qbuf
= qbuf
->previous
) {
218 unsigned results_base
= 0;
219 uint64_t va
= r600_resource_va(&ctx
->screen
->screen
, &qbuf
->buf
->b
.b
.b
);
221 while (results_base
< qbuf
->results_end
) {
222 cs
->buf
[cs
->cdw
++] = PKT3(PKT3_SET_PREDICATION
, 1, 0);
223 cs
->buf
[cs
->cdw
++] = (va
+ results_base
) & 0xFFFFFFFFUL
;
224 cs
->buf
[cs
->cdw
++] = op
| (((va
+ results_base
) >> 32UL) & 0xFF);
225 cs
->buf
[cs
->cdw
++] = PKT3(PKT3_NOP
, 0, 0);
226 cs
->buf
[cs
->cdw
++] = r600_context_bo_reloc(ctx
, qbuf
->buf
, RADEON_USAGE_READ
);
227 results_base
+= query
->result_size
;
229 /* set CONTINUE bit for all packets except the first */
230 op
|= PREDICATION_CONTINUE
;
236 static struct pipe_query
*r600_create_query(struct pipe_context
*ctx
, unsigned query_type
)
238 struct r600_context
*rctx
= (struct r600_context
*)ctx
;
240 struct r600_query
*query
;
242 query
= CALLOC_STRUCT(r600_query
);
246 query
->type
= query_type
;
248 switch (query_type
) {
249 case PIPE_QUERY_OCCLUSION_COUNTER
:
250 case PIPE_QUERY_OCCLUSION_PREDICATE
:
251 query
->result_size
= 16 * rctx
->max_db
;
252 query
->num_cs_dw
= 6;
254 case PIPE_QUERY_TIME_ELAPSED
:
255 query
->result_size
= 16;
256 query
->num_cs_dw
= 8;
258 case PIPE_QUERY_PRIMITIVES_EMITTED
:
259 case PIPE_QUERY_PRIMITIVES_GENERATED
:
260 case PIPE_QUERY_SO_STATISTICS
:
261 case PIPE_QUERY_SO_OVERFLOW_PREDICATE
:
262 /* NumPrimitivesWritten, PrimitiveStorageNeeded. */
263 query
->result_size
= 32;
264 query
->num_cs_dw
= 6;
272 query
->buffer
.buf
= r600_new_query_buffer(rctx
, query_type
);
273 if (!query
->buffer
.buf
) {
277 return (struct pipe_query
*)query
;
280 static void r600_destroy_query(struct pipe_context
*ctx
, struct pipe_query
*query
)
282 struct r600_query
*rquery
= (struct r600_query
*)query
;
283 struct r600_query_buffer
*prev
= rquery
->buffer
.previous
;
285 /* Release all query buffers. */
287 struct r600_query_buffer
*qbuf
= prev
;
288 prev
= prev
->previous
;
289 pipe_resource_reference((struct pipe_resource
**)&qbuf
->buf
, NULL
);
293 pipe_resource_reference((struct pipe_resource
**)&rquery
->buffer
.buf
, NULL
);
297 static void r600_update_occlusion_query_state(struct r600_context
*rctx
,
298 unsigned type
, int diff
)
300 if (type
== PIPE_QUERY_OCCLUSION_COUNTER
||
301 type
== PIPE_QUERY_OCCLUSION_PREDICATE
) {
304 rctx
->num_occlusion_queries
+= diff
;
305 assert(rctx
->num_occlusion_queries
>= 0);
307 enable
= rctx
->num_occlusion_queries
!= 0;
309 if (rctx
->atom_db_misc_state
.occlusion_query_enabled
!= enable
) {
310 rctx
->atom_db_misc_state
.occlusion_query_enabled
= enable
;
311 r600_atom_dirty(rctx
, &rctx
->atom_db_misc_state
.atom
);
316 static void r600_begin_query(struct pipe_context
*ctx
, struct pipe_query
*query
)
318 struct r600_context
*rctx
= (struct r600_context
*)ctx
;
319 struct r600_query
*rquery
= (struct r600_query
*)query
;
320 /* Discard the old query buffers. */
321 struct r600_query_buffer
*prev
= rquery
->buffer
.previous
;
324 struct r600_query_buffer
*qbuf
= prev
;
325 prev
= prev
->previous
;
326 pipe_resource_reference((struct pipe_resource
**)&qbuf
->buf
, NULL
);
330 /* Obtain a new buffer if the current one can't be mapped without a stall. */
331 if (rctx
->ws
->cs_is_buffer_referenced(rctx
->cs
, rquery
->buffer
.buf
->cs_buf
) ||
332 rctx
->ws
->buffer_is_busy(rquery
->buffer
.buf
->buf
, RADEON_USAGE_READWRITE
)) {
333 pipe_resource_reference((struct pipe_resource
**)&rquery
->buffer
.buf
, NULL
);
334 rquery
->buffer
.buf
= r600_new_query_buffer(rctx
, rquery
->type
);
337 rquery
->buffer
.results_end
= 0;
338 rquery
->buffer
.previous
= NULL
;
340 r600_update_occlusion_query_state(rctx
, rquery
->type
, 1);
342 r600_emit_query_begin(rctx
, rquery
);
344 if (r600_is_timer_query(rquery
->type
)) {
345 LIST_ADDTAIL(&rquery
->list
, &rctx
->active_timer_queries
);
347 LIST_ADDTAIL(&rquery
->list
, &rctx
->active_nontimer_queries
);
351 static void r600_end_query(struct pipe_context
*ctx
, struct pipe_query
*query
)
353 struct r600_context
*rctx
= (struct r600_context
*)ctx
;
354 struct r600_query
*rquery
= (struct r600_query
*)query
;
356 r600_emit_query_end(rctx
, rquery
);
357 LIST_DELINIT(&rquery
->list
);
359 r600_update_occlusion_query_state(rctx
, rquery
->type
, -1);
362 static unsigned r600_query_read_result(char *map
, unsigned start_index
, unsigned end_index
,
363 bool test_status_bit
)
365 uint32_t *current_result
= (uint32_t*)map
;
368 start
= (uint64_t)current_result
[start_index
] |
369 (uint64_t)current_result
[start_index
+1] << 32;
370 end
= (uint64_t)current_result
[end_index
] |
371 (uint64_t)current_result
[end_index
+1] << 32;
373 if (!test_status_bit
||
374 ((start
& 0x8000000000000000UL
) && (end
& 0x8000000000000000UL
))) {
380 static boolean
r600_get_query_buffer_result(struct r600_context
*ctx
,
381 struct r600_query
*query
,
382 struct r600_query_buffer
*qbuf
,
384 union r600_query_result
*result
)
386 unsigned results_base
= 0;
389 map
= ctx
->ws
->buffer_map(qbuf
->buf
->buf
, ctx
->cs
,
391 (wait
? 0 : PIPE_TRANSFER_DONTBLOCK
));
395 /* count all results across all data blocks */
396 switch (query
->type
) {
397 case PIPE_QUERY_OCCLUSION_COUNTER
:
398 while (results_base
!= qbuf
->results_end
) {
400 r600_query_read_result(map
+ results_base
, 0, 2, true);
404 case PIPE_QUERY_OCCLUSION_PREDICATE
:
405 while (results_base
!= qbuf
->results_end
) {
406 result
->b
= result
->b
||
407 r600_query_read_result(map
+ results_base
, 0, 2, true) != 0;
411 case PIPE_QUERY_TIME_ELAPSED
:
412 while (results_base
!= qbuf
->results_end
) {
414 r600_query_read_result(map
+ results_base
, 0, 2, false);
415 results_base
+= query
->result_size
;
418 case PIPE_QUERY_PRIMITIVES_EMITTED
:
419 /* SAMPLE_STREAMOUTSTATS stores this structure:
421 * u64 NumPrimitivesWritten;
422 * u64 PrimitiveStorageNeeded;
424 * We only need NumPrimitivesWritten here. */
425 while (results_base
!= qbuf
->results_end
) {
427 r600_query_read_result(map
+ results_base
, 2, 6, true);
428 results_base
+= query
->result_size
;
431 case PIPE_QUERY_PRIMITIVES_GENERATED
:
432 /* Here we read PrimitiveStorageNeeded. */
433 while (results_base
!= qbuf
->results_end
) {
435 r600_query_read_result(map
+ results_base
, 0, 4, true);
436 results_base
+= query
->result_size
;
439 case PIPE_QUERY_SO_STATISTICS
:
440 while (results_base
!= qbuf
->results_end
) {
441 result
->so
.num_primitives_written
+=
442 r600_query_read_result(map
+ results_base
, 2, 6, true);
443 result
->so
.primitives_storage_needed
+=
444 r600_query_read_result(map
+ results_base
, 0, 4, true);
445 results_base
+= query
->result_size
;
448 case PIPE_QUERY_SO_OVERFLOW_PREDICATE
:
449 while (results_base
!= qbuf
->results_end
) {
450 result
->b
= result
->b
||
451 r600_query_read_result(map
+ results_base
, 2, 6, true) !=
452 r600_query_read_result(map
+ results_base
, 0, 4, true);
453 results_base
+= query
->result_size
;
460 ctx
->ws
->buffer_unmap(qbuf
->buf
->buf
);
464 static boolean
r600_get_query_result(struct pipe_context
*ctx
,
465 struct pipe_query
*query
,
466 boolean wait
, void *vresult
)
468 struct r600_context
*rctx
= (struct r600_context
*)ctx
;
469 struct r600_query
*rquery
= (struct r600_query
*)query
;
470 boolean
*result_b
= (boolean
*)vresult
;
471 uint64_t *result_u64
= (uint64_t*)vresult
;
472 union r600_query_result result
;
473 struct pipe_query_data_so_statistics
*result_so
=
474 (struct pipe_query_data_so_statistics
*)vresult
;
475 struct r600_query_buffer
*qbuf
;
477 memset(&result
, 0, sizeof(result
));
479 for (qbuf
= &rquery
->buffer
; qbuf
; qbuf
= qbuf
->previous
) {
480 if (!r600_get_query_buffer_result(rctx
, rquery
, qbuf
, wait
, &result
)) {
485 switch (rquery
->type
) {
486 case PIPE_QUERY_OCCLUSION_COUNTER
:
487 case PIPE_QUERY_PRIMITIVES_EMITTED
:
488 case PIPE_QUERY_PRIMITIVES_GENERATED
:
489 *result_u64
= result
.u64
;
491 case PIPE_QUERY_OCCLUSION_PREDICATE
:
492 case PIPE_QUERY_SO_OVERFLOW_PREDICATE
:
493 *result_b
= result
.b
;
495 case PIPE_QUERY_TIME_ELAPSED
:
496 *result_u64
= (1000000 * result
.u64
) / rctx
->screen
->info
.r600_clock_crystal_freq
;
498 case PIPE_QUERY_SO_STATISTICS
:
499 *result_so
= result
.so
;
507 static void r600_render_condition(struct pipe_context
*ctx
,
508 struct pipe_query
*query
,
511 struct r600_context
*rctx
= (struct r600_context
*)ctx
;
512 struct r600_query
*rquery
= (struct r600_query
*)query
;
513 bool wait_flag
= false;
515 rctx
->current_render_cond
= query
;
516 rctx
->current_render_cond_mode
= mode
;
519 if (rctx
->predicate_drawing
) {
520 rctx
->predicate_drawing
= false;
521 r600_emit_query_predication(rctx
, NULL
, PREDICATION_OP_CLEAR
, false);
526 if (mode
== PIPE_RENDER_COND_WAIT
||
527 mode
== PIPE_RENDER_COND_BY_REGION_WAIT
) {
531 rctx
->predicate_drawing
= true;
533 switch (rquery
->type
) {
534 case PIPE_QUERY_OCCLUSION_COUNTER
:
535 case PIPE_QUERY_OCCLUSION_PREDICATE
:
536 r600_emit_query_predication(rctx
, rquery
, PREDICATION_OP_ZPASS
, wait_flag
);
538 case PIPE_QUERY_PRIMITIVES_EMITTED
:
539 case PIPE_QUERY_PRIMITIVES_GENERATED
:
540 case PIPE_QUERY_SO_STATISTICS
:
541 case PIPE_QUERY_SO_OVERFLOW_PREDICATE
:
542 r600_emit_query_predication(rctx
, rquery
, PREDICATION_OP_PRIMCOUNT
, wait_flag
);
549 void r600_suspend_nontimer_queries(struct r600_context
*ctx
)
551 struct r600_query
*query
;
553 LIST_FOR_EACH_ENTRY(query
, &ctx
->active_nontimer_queries
, list
) {
554 r600_emit_query_end(ctx
, query
);
556 assert(ctx
->num_cs_dw_nontimer_queries_suspend
== 0);
559 void r600_resume_nontimer_queries(struct r600_context
*ctx
)
561 struct r600_query
*query
;
563 assert(ctx
->num_cs_dw_nontimer_queries_suspend
== 0);
565 LIST_FOR_EACH_ENTRY(query
, &ctx
->active_nontimer_queries
, list
) {
566 r600_emit_query_begin(ctx
, query
);
570 void r600_suspend_timer_queries(struct r600_context
*ctx
)
572 struct r600_query
*query
;
574 LIST_FOR_EACH_ENTRY(query
, &ctx
->active_timer_queries
, list
) {
575 r600_emit_query_end(ctx
, query
);
578 assert(ctx
->num_cs_dw_timer_queries_suspend
== 0);
581 void r600_resume_timer_queries(struct r600_context
*ctx
)
583 struct r600_query
*query
;
585 assert(ctx
->num_cs_dw_timer_queries_suspend
== 0);
587 LIST_FOR_EACH_ENTRY(query
, &ctx
->active_timer_queries
, list
) {
588 r600_emit_query_begin(ctx
, query
);
592 void r600_init_query_functions(struct r600_context
*rctx
)
594 rctx
->context
.create_query
= r600_create_query
;
595 rctx
->context
.destroy_query
= r600_destroy_query
;
596 rctx
->context
.begin_query
= r600_begin_query
;
597 rctx
->context
.end_query
= r600_end_query
;
598 rctx
->context
.get_query_result
= r600_get_query_result
;
600 if (rctx
->screen
->info
.r600_num_backends
> 0)
601 rctx
->context
.render_condition
= r600_render_condition
;