Merge branch 'mesa_7_5_branch'
[mesa.git] / src / gallium / auxiliary / rbug / rbug_context.h
1 /*
2 * Copyright 2009 VMware, Inc.
3 * All Rights Reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * on the rights to use, copy, modify, merge, publish, distribute, sub
9 * license, and/or sell copies of the Software, and to permit persons to whom
10 * the Software is furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice (including the next
13 * paragraph) shall be included in all copies or substantial portions of the
14 * Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
19 * VMWARE AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
20 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
21 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
22 * USE OR OTHER DEALINGS IN THE SOFTWARE.
23 */
24
25 /*
26 * This file holds structs decelerations and function prototypes for one of
27 * the rbug extensions. Implementation of the functions is in the same folder
28 * in the c file matching this file's name.
29 *
30 * The structs what is returned from the demarshal functions. The functions
31 * starting rbug_send_* encodes a call to the write format and sends that to
32 * the supplied connection, while functions starting with rbug_demarshal_*
33 * demarshal data from the wire protocol.
34 *
35 * Structs and functions ending with _reply are replies to requests.
36 */
37
38 #ifndef _RBUG_PROTO_CONTEXT_H_
39 #define _RBUG_PROTO_CONTEXT_H_
40
41 #include "rbug/rbug_proto.h"
42 #include "rbug/rbug_texture.h"
43
44 typedef uint64_t rbug_context_t;
45
46 struct rbug_proto_context_list
47 {
48 struct rbug_header header;
49 };
50
51 struct rbug_proto_context_info
52 {
53 struct rbug_header header;
54 rbug_context_t context;
55 };
56
57 struct rbug_proto_context_block_draw
58 {
59 struct rbug_header header;
60 rbug_context_t context;
61 };
62
63 struct rbug_proto_context_unblock_draw
64 {
65 struct rbug_header header;
66 rbug_context_t context;
67 };
68
69 struct rbug_proto_context_list_reply
70 {
71 struct rbug_header header;
72 uint32_t serial;
73 rbug_context_t *contexts;
74 uint32_t contexts_len;
75 };
76
77 struct rbug_proto_context_info_reply
78 {
79 struct rbug_header header;
80 uint32_t serial;
81 rbug_texture_t *cbufs;
82 uint32_t cbufs_len;
83 rbug_texture_t zdbuf;
84 uint8_t blocked;
85 };
86
87 int rbug_send_context_list(struct rbug_connection *__con,
88 uint32_t *__serial);
89
90 int rbug_send_context_info(struct rbug_connection *__con,
91 rbug_context_t context,
92 uint32_t *__serial);
93
94 int rbug_send_context_block_draw(struct rbug_connection *__con,
95 rbug_context_t context,
96 uint32_t *__serial);
97
98 int rbug_send_context_unblock_draw(struct rbug_connection *__con,
99 rbug_context_t context,
100 uint32_t *__serial);
101
102 int rbug_send_context_list_reply(struct rbug_connection *__con,
103 uint32_t serial,
104 rbug_context_t *contexts,
105 uint32_t contexts_len,
106 uint32_t *__serial);
107
108 int rbug_send_context_info_reply(struct rbug_connection *__con,
109 uint32_t serial,
110 rbug_texture_t *cbufs,
111 uint32_t cbufs_len,
112 rbug_texture_t zdbuf,
113 uint8_t blocked,
114 uint32_t *__serial);
115
116 struct rbug_proto_context_list * rbug_demarshal_context_list(struct rbug_proto_header *header);
117
118 struct rbug_proto_context_info * rbug_demarshal_context_info(struct rbug_proto_header *header);
119
120 struct rbug_proto_context_block_draw * rbug_demarshal_context_block_draw(struct rbug_proto_header *header);
121
122 struct rbug_proto_context_unblock_draw * rbug_demarshal_context_unblock_draw(struct rbug_proto_header *header);
123
124 struct rbug_proto_context_list_reply * rbug_demarshal_context_list_reply(struct rbug_proto_header *header);
125
126 struct rbug_proto_context_info_reply * rbug_demarshal_context_info_reply(struct rbug_proto_header *header);
127
128 #endif