radeon/llvm: show LLVM disassembly when available
[mesa.git] / src / gallium / drivers / radeonsi / r600.h
1 /*
2 * Copyright 2010 Jerome Glisse <glisse@freedesktop.org>
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 * 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:
10 *
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
13 * Software.
14 *
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.
22 *
23 * Authors:
24 * Jerome Glisse
25 */
26 #ifndef R600_H
27 #define R600_H
28
29 #include "../../winsys/radeon/drm/radeon_winsys.h"
30 #include "util/u_double_list.h"
31 #include "util/u_transfer.h"
32
33 #include "radeonsi_resource.h"
34
35 struct winsys_handle;
36
37 /* R600/R700 STATES */
38 struct r600_query {
39 union {
40 uint64_t u64;
41 boolean b;
42 struct pipe_query_data_so_statistics so;
43 } result;
44 /* The kind of query */
45 unsigned type;
46 /* Offset of the first result for current query */
47 unsigned results_start;
48 /* Offset of the next free result after current query data */
49 unsigned results_end;
50 /* Size of the result in memory for both begin_query and end_query,
51 * this can be one or two numbers, or it could even be a size of a structure. */
52 unsigned result_size;
53 /* The buffer where query results are stored. It's used as a ring,
54 * data blocks for current query are stored sequentially from
55 * results_start to results_end, with wrapping on the buffer end */
56 struct r600_resource *buffer;
57 /* The number of dwords for begin_query or end_query. */
58 unsigned num_cs_dw;
59 /* linked list of queries */
60 struct list_head list;
61 };
62
63 struct r600_context;
64 struct r600_screen;
65
66 void si_get_backend_mask(struct r600_context *ctx);
67 void si_context_flush(struct r600_context *ctx, unsigned flags);
68 void si_begin_new_cs(struct r600_context *ctx);
69
70 struct r600_query *r600_context_query_create(struct r600_context *ctx, unsigned query_type);
71 void r600_context_query_destroy(struct r600_context *ctx, struct r600_query *query);
72 boolean r600_context_query_result(struct r600_context *ctx,
73 struct r600_query *query,
74 boolean wait, void *vresult);
75 void r600_query_begin(struct r600_context *ctx, struct r600_query *query);
76 void r600_query_end(struct r600_context *ctx, struct r600_query *query);
77 void r600_context_queries_suspend(struct r600_context *ctx);
78 void r600_context_queries_resume(struct r600_context *ctx);
79 void r600_query_predication(struct r600_context *ctx, struct r600_query *query, int operation,
80 int flag_wait);
81 void si_context_emit_fence(struct r600_context *ctx, struct r600_resource *fence,
82 unsigned offset, unsigned value);
83
84 bool si_is_timer_query(unsigned type);
85 bool si_query_needs_begin(unsigned type);
86 void si_need_cs_space(struct r600_context *ctx, unsigned num_dw, boolean count_draw_in);
87
88 int si_context_init(struct r600_context *ctx);
89
90 #endif