1bf215546Sopenharmony_ci/*
2bf215546Sopenharmony_ci * Copyright 2009 VMware, Inc.
3bf215546Sopenharmony_ci * All Rights Reserved.
4bf215546Sopenharmony_ci *
5bf215546Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a
6bf215546Sopenharmony_ci * copy of this software and associated documentation files (the "Software"),
7bf215546Sopenharmony_ci * to deal in the Software without restriction, including without limitation
8bf215546Sopenharmony_ci * on the rights to use, copy, modify, merge, publish, distribute, sub
9bf215546Sopenharmony_ci * license, and/or sell copies of the Software, and to permit persons to whom
10bf215546Sopenharmony_ci * the Software is furnished to do so, subject to the following conditions:
11bf215546Sopenharmony_ci *
12bf215546Sopenharmony_ci * The above copyright notice and this permission notice (including the next
13bf215546Sopenharmony_ci * paragraph) shall be included in all copies or substantial portions of the
14bf215546Sopenharmony_ci * Software.
15bf215546Sopenharmony_ci *
16bf215546Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17bf215546Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18bf215546Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
19bf215546Sopenharmony_ci * VMWARE AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
20bf215546Sopenharmony_ci * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
21bf215546Sopenharmony_ci * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
22bf215546Sopenharmony_ci * USE OR OTHER DEALINGS IN THE SOFTWARE.
23bf215546Sopenharmony_ci */
24bf215546Sopenharmony_ci
25bf215546Sopenharmony_ci/*
26bf215546Sopenharmony_ci * This file holds structs decelerations and function prototypes for one of
27bf215546Sopenharmony_ci * the rbug extensions. Implementation of the functions is in the same folder
28bf215546Sopenharmony_ci * in the c file matching this file's name.
29bf215546Sopenharmony_ci *
30bf215546Sopenharmony_ci * The structs what is returned from the demarshal functions. The functions
31bf215546Sopenharmony_ci * starting rbug_send_* encodes a call to the write format and sends that to
32bf215546Sopenharmony_ci * the supplied connection, while functions starting with rbug_demarshal_*
33bf215546Sopenharmony_ci * demarshal data from the wire protocol.
34bf215546Sopenharmony_ci *
35bf215546Sopenharmony_ci * Structs and functions ending with _reply are replies to requests.
36bf215546Sopenharmony_ci */
37bf215546Sopenharmony_ci
38bf215546Sopenharmony_ci#ifndef _RBUG_PROTO_CONTEXT_H_
39bf215546Sopenharmony_ci#define _RBUG_PROTO_CONTEXT_H_
40bf215546Sopenharmony_ci
41bf215546Sopenharmony_ci#include "rbug_proto.h"
42bf215546Sopenharmony_ci#include "rbug_core.h"
43bf215546Sopenharmony_ci
44bf215546Sopenharmony_citypedef enum
45bf215546Sopenharmony_ci{
46bf215546Sopenharmony_ci	RBUG_BLOCK_BEFORE = 1,
47bf215546Sopenharmony_ci	RBUG_BLOCK_AFTER = 2,
48bf215546Sopenharmony_ci	RBUG_BLOCK_RULE = 4,
49bf215546Sopenharmony_ci	RBUG_BLOCK_MASK = 7
50bf215546Sopenharmony_ci} rbug_block_t;
51bf215546Sopenharmony_ci
52bf215546Sopenharmony_cistruct rbug_proto_context_list
53bf215546Sopenharmony_ci{
54bf215546Sopenharmony_ci	struct rbug_header header;
55bf215546Sopenharmony_ci};
56bf215546Sopenharmony_ci
57bf215546Sopenharmony_cistruct rbug_proto_context_info
58bf215546Sopenharmony_ci{
59bf215546Sopenharmony_ci	struct rbug_header header;
60bf215546Sopenharmony_ci	rbug_context_t context;
61bf215546Sopenharmony_ci};
62bf215546Sopenharmony_ci
63bf215546Sopenharmony_cistruct rbug_proto_context_draw_block
64bf215546Sopenharmony_ci{
65bf215546Sopenharmony_ci	struct rbug_header header;
66bf215546Sopenharmony_ci	rbug_context_t context;
67bf215546Sopenharmony_ci	rbug_block_t block;
68bf215546Sopenharmony_ci};
69bf215546Sopenharmony_ci
70bf215546Sopenharmony_cistruct rbug_proto_context_draw_step
71bf215546Sopenharmony_ci{
72bf215546Sopenharmony_ci	struct rbug_header header;
73bf215546Sopenharmony_ci	rbug_context_t context;
74bf215546Sopenharmony_ci	rbug_block_t step;
75bf215546Sopenharmony_ci};
76bf215546Sopenharmony_ci
77bf215546Sopenharmony_cistruct rbug_proto_context_draw_unblock
78bf215546Sopenharmony_ci{
79bf215546Sopenharmony_ci	struct rbug_header header;
80bf215546Sopenharmony_ci	rbug_context_t context;
81bf215546Sopenharmony_ci	rbug_block_t unblock;
82bf215546Sopenharmony_ci};
83bf215546Sopenharmony_ci
84bf215546Sopenharmony_cistruct rbug_proto_context_draw_rule
85bf215546Sopenharmony_ci{
86bf215546Sopenharmony_ci	struct rbug_header header;
87bf215546Sopenharmony_ci	rbug_context_t context;
88bf215546Sopenharmony_ci	rbug_shader_t vertex;
89bf215546Sopenharmony_ci	rbug_shader_t fragment;
90bf215546Sopenharmony_ci	rbug_texture_t texture;
91bf215546Sopenharmony_ci	rbug_texture_t surface;
92bf215546Sopenharmony_ci	rbug_block_t block;
93bf215546Sopenharmony_ci};
94bf215546Sopenharmony_ci
95bf215546Sopenharmony_cistruct rbug_proto_context_flush
96bf215546Sopenharmony_ci{
97bf215546Sopenharmony_ci	struct rbug_header header;
98bf215546Sopenharmony_ci	rbug_context_t context;
99bf215546Sopenharmony_ci};
100bf215546Sopenharmony_ci
101bf215546Sopenharmony_cistruct rbug_proto_context_list_reply
102bf215546Sopenharmony_ci{
103bf215546Sopenharmony_ci	struct rbug_header header;
104bf215546Sopenharmony_ci	uint32_t serial;
105bf215546Sopenharmony_ci	rbug_context_t *contexts;
106bf215546Sopenharmony_ci	uint32_t contexts_len;
107bf215546Sopenharmony_ci};
108bf215546Sopenharmony_ci
109bf215546Sopenharmony_cistruct rbug_proto_context_info_reply
110bf215546Sopenharmony_ci{
111bf215546Sopenharmony_ci	struct rbug_header header;
112bf215546Sopenharmony_ci	uint32_t serial;
113bf215546Sopenharmony_ci	rbug_shader_t vertex;
114bf215546Sopenharmony_ci	rbug_shader_t fragment;
115bf215546Sopenharmony_ci	rbug_texture_t *texs;
116bf215546Sopenharmony_ci	uint32_t texs_len;
117bf215546Sopenharmony_ci	rbug_texture_t *cbufs;
118bf215546Sopenharmony_ci	uint32_t cbufs_len;
119bf215546Sopenharmony_ci	rbug_texture_t zsbuf;
120bf215546Sopenharmony_ci	rbug_block_t blocker;
121bf215546Sopenharmony_ci	rbug_block_t blocked;
122bf215546Sopenharmony_ci};
123bf215546Sopenharmony_ci
124bf215546Sopenharmony_cistruct rbug_proto_context_draw_blocked
125bf215546Sopenharmony_ci{
126bf215546Sopenharmony_ci	struct rbug_header header;
127bf215546Sopenharmony_ci	rbug_context_t context;
128bf215546Sopenharmony_ci	rbug_block_t block;
129bf215546Sopenharmony_ci};
130bf215546Sopenharmony_ci
131bf215546Sopenharmony_ciint rbug_send_context_list(struct rbug_connection *__con,
132bf215546Sopenharmony_ci                           uint32_t *__serial);
133bf215546Sopenharmony_ci
134bf215546Sopenharmony_ciint rbug_send_context_info(struct rbug_connection *__con,
135bf215546Sopenharmony_ci                           rbug_context_t context,
136bf215546Sopenharmony_ci                           uint32_t *__serial);
137bf215546Sopenharmony_ci
138bf215546Sopenharmony_ciint rbug_send_context_draw_block(struct rbug_connection *__con,
139bf215546Sopenharmony_ci                                 rbug_context_t context,
140bf215546Sopenharmony_ci                                 rbug_block_t block,
141bf215546Sopenharmony_ci                                 uint32_t *__serial);
142bf215546Sopenharmony_ci
143bf215546Sopenharmony_ciint rbug_send_context_draw_step(struct rbug_connection *__con,
144bf215546Sopenharmony_ci                                rbug_context_t context,
145bf215546Sopenharmony_ci                                rbug_block_t step,
146bf215546Sopenharmony_ci                                uint32_t *__serial);
147bf215546Sopenharmony_ci
148bf215546Sopenharmony_ciint rbug_send_context_draw_unblock(struct rbug_connection *__con,
149bf215546Sopenharmony_ci                                   rbug_context_t context,
150bf215546Sopenharmony_ci                                   rbug_block_t unblock,
151bf215546Sopenharmony_ci                                   uint32_t *__serial);
152bf215546Sopenharmony_ci
153bf215546Sopenharmony_ciint rbug_send_context_draw_rule(struct rbug_connection *__con,
154bf215546Sopenharmony_ci                                rbug_context_t context,
155bf215546Sopenharmony_ci                                rbug_shader_t vertex,
156bf215546Sopenharmony_ci                                rbug_shader_t fragment,
157bf215546Sopenharmony_ci                                rbug_texture_t texture,
158bf215546Sopenharmony_ci                                rbug_texture_t surface,
159bf215546Sopenharmony_ci                                rbug_block_t block,
160bf215546Sopenharmony_ci                                uint32_t *__serial);
161bf215546Sopenharmony_ci
162bf215546Sopenharmony_ciint rbug_send_context_flush(struct rbug_connection *__con,
163bf215546Sopenharmony_ci                            rbug_context_t context,
164bf215546Sopenharmony_ci                            uint32_t *__serial);
165bf215546Sopenharmony_ci
166bf215546Sopenharmony_ciint rbug_send_context_list_reply(struct rbug_connection *__con,
167bf215546Sopenharmony_ci                                 uint32_t serial,
168bf215546Sopenharmony_ci                                 rbug_context_t *contexts,
169bf215546Sopenharmony_ci                                 uint32_t contexts_len,
170bf215546Sopenharmony_ci                                 uint32_t *__serial);
171bf215546Sopenharmony_ci
172bf215546Sopenharmony_ciint rbug_send_context_info_reply(struct rbug_connection *__con,
173bf215546Sopenharmony_ci                                 uint32_t serial,
174bf215546Sopenharmony_ci                                 rbug_shader_t vertex,
175bf215546Sopenharmony_ci                                 rbug_shader_t fragment,
176bf215546Sopenharmony_ci                                 rbug_texture_t *texs,
177bf215546Sopenharmony_ci                                 uint32_t texs_len,
178bf215546Sopenharmony_ci                                 rbug_texture_t *cbufs,
179bf215546Sopenharmony_ci                                 uint32_t cbufs_len,
180bf215546Sopenharmony_ci                                 rbug_texture_t zsbuf,
181bf215546Sopenharmony_ci                                 rbug_block_t blocker,
182bf215546Sopenharmony_ci                                 rbug_block_t blocked,
183bf215546Sopenharmony_ci                                 uint32_t *__serial);
184bf215546Sopenharmony_ci
185bf215546Sopenharmony_ciint rbug_send_context_draw_blocked(struct rbug_connection *__con,
186bf215546Sopenharmony_ci                                   rbug_context_t context,
187bf215546Sopenharmony_ci                                   rbug_block_t block,
188bf215546Sopenharmony_ci                                   uint32_t *__serial);
189bf215546Sopenharmony_ci
190bf215546Sopenharmony_cistruct rbug_proto_context_list * rbug_demarshal_context_list(struct rbug_proto_header *header);
191bf215546Sopenharmony_ci
192bf215546Sopenharmony_cistruct rbug_proto_context_info * rbug_demarshal_context_info(struct rbug_proto_header *header);
193bf215546Sopenharmony_ci
194bf215546Sopenharmony_cistruct rbug_proto_context_draw_block * rbug_demarshal_context_draw_block(struct rbug_proto_header *header);
195bf215546Sopenharmony_ci
196bf215546Sopenharmony_cistruct rbug_proto_context_draw_step * rbug_demarshal_context_draw_step(struct rbug_proto_header *header);
197bf215546Sopenharmony_ci
198bf215546Sopenharmony_cistruct rbug_proto_context_draw_unblock * rbug_demarshal_context_draw_unblock(struct rbug_proto_header *header);
199bf215546Sopenharmony_ci
200bf215546Sopenharmony_cistruct rbug_proto_context_draw_rule * rbug_demarshal_context_draw_rule(struct rbug_proto_header *header);
201bf215546Sopenharmony_ci
202bf215546Sopenharmony_cistruct rbug_proto_context_flush * rbug_demarshal_context_flush(struct rbug_proto_header *header);
203bf215546Sopenharmony_ci
204bf215546Sopenharmony_cistruct rbug_proto_context_list_reply * rbug_demarshal_context_list_reply(struct rbug_proto_header *header);
205bf215546Sopenharmony_ci
206bf215546Sopenharmony_cistruct rbug_proto_context_info_reply * rbug_demarshal_context_info_reply(struct rbug_proto_header *header);
207bf215546Sopenharmony_ci
208bf215546Sopenharmony_cistruct rbug_proto_context_draw_blocked * rbug_demarshal_context_draw_blocked(struct rbug_proto_header *header);
209bf215546Sopenharmony_ci
210bf215546Sopenharmony_ci#endif
211