2 * Copyright © 2017 Intel Corporation
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.
25 #include "pipe/p_defines.h"
26 #include "pipe/p_state.h"
27 #include "pipe/p_context.h"
28 #include "pipe/p_screen.h"
29 #include "util/u_inlines.h"
30 #include "util/u_format.h"
31 #include "util/u_upload_mgr.h"
32 #include "util/ralloc.h"
33 #include "iris_context.h"
34 #include "iris_resource.h"
35 #include "iris_screen.h"
36 #include "intel/compiler/brw_compiler.h"
39 enum pipe_query_type type
;
42 static struct pipe_query
*
43 iris_create_query(struct pipe_context
*ctx
,
47 struct iris_query
*query
= calloc(1, sizeof(struct iris_query
));
49 query
->type
= query_type
;
51 return (struct pipe_query
*) query
;
55 iris_destroy_query(struct pipe_context
*ctx
, struct pipe_query
*p_query
)
57 struct iris_query
*query
= (void *) p_query
;
62 iris_begin_query(struct pipe_context
*ctx
, struct pipe_query
*query
)
68 iris_end_query(struct pipe_context
*ctx
, struct pipe_query
*query
)
74 iris_get_query_result(struct pipe_context
*ctx
,
75 struct pipe_query
*query
,
77 union pipe_query_result
*vresult
)
79 uint64_t *result
= (uint64_t*)vresult
;
86 iris_set_active_query_state(struct pipe_context
*pipe
, boolean enable
)
91 iris_init_query_functions(struct pipe_context
*ctx
)
93 ctx
->create_query
= iris_create_query
;
94 ctx
->destroy_query
= iris_destroy_query
;
95 ctx
->begin_query
= iris_begin_query
;
96 ctx
->end_query
= iris_end_query
;
97 ctx
->get_query_result
= iris_get_query_result
;
98 ctx
->set_active_query_state
= iris_set_active_query_state
;