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 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included
12 * in all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
26 * XXX: this file is EMPTY. it will eventually implement query objects!
31 #include "pipe/p_defines.h"
32 #include "pipe/p_state.h"
33 #include "pipe/p_context.h"
34 #include "pipe/p_screen.h"
35 #include "util/u_inlines.h"
36 #include "util/u_format.h"
37 #include "util/u_upload_mgr.h"
38 #include "util/ralloc.h"
39 #include "iris_context.h"
40 #include "iris_resource.h"
41 #include "iris_screen.h"
42 #include "intel/compiler/brw_compiler.h"
45 enum pipe_query_type type
;
48 static struct pipe_query
*
49 iris_create_query(struct pipe_context
*ctx
,
53 struct iris_query
*query
= calloc(1, sizeof(struct iris_query
));
55 query
->type
= query_type
;
57 return (struct pipe_query
*) query
;
61 iris_destroy_query(struct pipe_context
*ctx
, struct pipe_query
*p_query
)
63 struct iris_query
*query
= (void *) p_query
;
68 iris_begin_query(struct pipe_context
*ctx
, struct pipe_query
*query
)
74 iris_end_query(struct pipe_context
*ctx
, struct pipe_query
*query
)
80 iris_get_query_result(struct pipe_context
*ctx
,
81 struct pipe_query
*query
,
83 union pipe_query_result
*vresult
)
85 uint64_t *result
= (uint64_t*)vresult
;
92 iris_set_active_query_state(struct pipe_context
*pipe
, boolean enable
)
97 iris_init_query_functions(struct pipe_context
*ctx
)
99 ctx
->create_query
= iris_create_query
;
100 ctx
->destroy_query
= iris_destroy_query
;
101 ctx
->begin_query
= iris_begin_query
;
102 ctx
->end_query
= iris_end_query
;
103 ctx
->get_query_result
= iris_get_query_result
;
104 ctx
->set_active_query_state
= iris_set_active_query_state
;