iris: use consistent copyright formatting
[mesa.git] / src / gallium / drivers / iris / iris_query.c
1 /*
2 * Copyright © 2017 Intel Corporation
3 *
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:
10 *
11 * The above copyright notice and this permission notice shall be included
12 * in all copies or substantial portions of the Software.
13 *
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.
21 */
22
23 /**
24 * @file iris_query.c
25 *
26 * XXX: this file is EMPTY. it will eventually implement query objects!
27 */
28
29 #include <stdio.h>
30 #include <errno.h>
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"
43
44 struct iris_query {
45 enum pipe_query_type type;
46 };
47
48 static struct pipe_query *
49 iris_create_query(struct pipe_context *ctx,
50 unsigned query_type,
51 unsigned index)
52 {
53 struct iris_query *query = calloc(1, sizeof(struct iris_query));
54
55 query->type = query_type;
56
57 return (struct pipe_query *) query;
58 }
59
60 static void
61 iris_destroy_query(struct pipe_context *ctx, struct pipe_query *p_query)
62 {
63 struct iris_query *query = (void *) p_query;
64 free(query);
65 }
66
67 static boolean
68 iris_begin_query(struct pipe_context *ctx, struct pipe_query *query)
69 {
70 return true;
71 }
72
73 static bool
74 iris_end_query(struct pipe_context *ctx, struct pipe_query *query)
75 {
76 return true;
77 }
78
79 static boolean
80 iris_get_query_result(struct pipe_context *ctx,
81 struct pipe_query *query,
82 boolean wait,
83 union pipe_query_result *vresult)
84 {
85 uint64_t *result = (uint64_t*)vresult;
86
87 *result = 0;
88 return TRUE;
89 }
90
91 static void
92 iris_set_active_query_state(struct pipe_context *pipe, boolean enable)
93 {
94 }
95
96 void
97 iris_init_query_functions(struct pipe_context *ctx)
98 {
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;
105 }