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_TEXTURE_H_
39bf215546Sopenharmony_ci#define _RBUG_PROTO_TEXTURE_H_
40bf215546Sopenharmony_ci
41bf215546Sopenharmony_ci#include "rbug_proto.h"
42bf215546Sopenharmony_ci#include "rbug_core.h"
43bf215546Sopenharmony_ci
44bf215546Sopenharmony_cistruct rbug_proto_texture_list
45bf215546Sopenharmony_ci{
46bf215546Sopenharmony_ci	struct rbug_header header;
47bf215546Sopenharmony_ci};
48bf215546Sopenharmony_ci
49bf215546Sopenharmony_cistruct rbug_proto_texture_info
50bf215546Sopenharmony_ci{
51bf215546Sopenharmony_ci	struct rbug_header header;
52bf215546Sopenharmony_ci	rbug_texture_t texture;
53bf215546Sopenharmony_ci};
54bf215546Sopenharmony_ci
55bf215546Sopenharmony_cistruct rbug_proto_texture_write
56bf215546Sopenharmony_ci{
57bf215546Sopenharmony_ci	struct rbug_header header;
58bf215546Sopenharmony_ci	rbug_texture_t texture;
59bf215546Sopenharmony_ci	uint32_t face;
60bf215546Sopenharmony_ci	uint32_t level;
61bf215546Sopenharmony_ci	uint32_t zslice;
62bf215546Sopenharmony_ci	uint32_t x;
63bf215546Sopenharmony_ci	uint32_t y;
64bf215546Sopenharmony_ci	uint32_t w;
65bf215546Sopenharmony_ci	uint32_t h;
66bf215546Sopenharmony_ci	uint8_t *data;
67bf215546Sopenharmony_ci	uint32_t data_len;
68bf215546Sopenharmony_ci	uint32_t stride;
69bf215546Sopenharmony_ci};
70bf215546Sopenharmony_ci
71bf215546Sopenharmony_cistruct rbug_proto_texture_read
72bf215546Sopenharmony_ci{
73bf215546Sopenharmony_ci	struct rbug_header header;
74bf215546Sopenharmony_ci	rbug_texture_t texture;
75bf215546Sopenharmony_ci	uint32_t face;
76bf215546Sopenharmony_ci	uint32_t level;
77bf215546Sopenharmony_ci	uint32_t zslice;
78bf215546Sopenharmony_ci	uint32_t x;
79bf215546Sopenharmony_ci	uint32_t y;
80bf215546Sopenharmony_ci	uint32_t w;
81bf215546Sopenharmony_ci	uint32_t h;
82bf215546Sopenharmony_ci};
83bf215546Sopenharmony_ci
84bf215546Sopenharmony_cistruct rbug_proto_texture_list_reply
85bf215546Sopenharmony_ci{
86bf215546Sopenharmony_ci	struct rbug_header header;
87bf215546Sopenharmony_ci	uint32_t serial;
88bf215546Sopenharmony_ci	rbug_texture_t *textures;
89bf215546Sopenharmony_ci	uint32_t textures_len;
90bf215546Sopenharmony_ci};
91bf215546Sopenharmony_ci
92bf215546Sopenharmony_cistruct rbug_proto_texture_info_reply
93bf215546Sopenharmony_ci{
94bf215546Sopenharmony_ci	struct rbug_header header;
95bf215546Sopenharmony_ci	uint32_t serial;
96bf215546Sopenharmony_ci	uint32_t target;
97bf215546Sopenharmony_ci	uint32_t format;
98bf215546Sopenharmony_ci	uint32_t *width;
99bf215546Sopenharmony_ci	uint32_t width_len;
100bf215546Sopenharmony_ci	uint32_t *height;
101bf215546Sopenharmony_ci	uint32_t height_len;
102bf215546Sopenharmony_ci	uint32_t *depth;
103bf215546Sopenharmony_ci	uint32_t depth_len;
104bf215546Sopenharmony_ci	uint32_t blockw;
105bf215546Sopenharmony_ci	uint32_t blockh;
106bf215546Sopenharmony_ci	uint32_t blocksize;
107bf215546Sopenharmony_ci	uint32_t last_level;
108bf215546Sopenharmony_ci	uint32_t nr_samples;
109bf215546Sopenharmony_ci	uint32_t tex_usage;
110bf215546Sopenharmony_ci};
111bf215546Sopenharmony_ci
112bf215546Sopenharmony_cistruct rbug_proto_texture_read_reply
113bf215546Sopenharmony_ci{
114bf215546Sopenharmony_ci	struct rbug_header header;
115bf215546Sopenharmony_ci	uint32_t serial;
116bf215546Sopenharmony_ci	uint32_t format;
117bf215546Sopenharmony_ci	uint32_t blockw;
118bf215546Sopenharmony_ci	uint32_t blockh;
119bf215546Sopenharmony_ci	uint32_t blocksize;
120bf215546Sopenharmony_ci	uint8_t *data;
121bf215546Sopenharmony_ci	uint32_t data_len;
122bf215546Sopenharmony_ci	uint32_t stride;
123bf215546Sopenharmony_ci};
124bf215546Sopenharmony_ci
125bf215546Sopenharmony_ciint rbug_send_texture_list(struct rbug_connection *__con,
126bf215546Sopenharmony_ci                           uint32_t *__serial);
127bf215546Sopenharmony_ci
128bf215546Sopenharmony_ciint rbug_send_texture_info(struct rbug_connection *__con,
129bf215546Sopenharmony_ci                           rbug_texture_t texture,
130bf215546Sopenharmony_ci                           uint32_t *__serial);
131bf215546Sopenharmony_ci
132bf215546Sopenharmony_ciint rbug_send_texture_write(struct rbug_connection *__con,
133bf215546Sopenharmony_ci                            rbug_texture_t texture,
134bf215546Sopenharmony_ci                            uint32_t face,
135bf215546Sopenharmony_ci                            uint32_t level,
136bf215546Sopenharmony_ci                            uint32_t zslice,
137bf215546Sopenharmony_ci                            uint32_t x,
138bf215546Sopenharmony_ci                            uint32_t y,
139bf215546Sopenharmony_ci                            uint32_t w,
140bf215546Sopenharmony_ci                            uint32_t h,
141bf215546Sopenharmony_ci                            uint8_t *data,
142bf215546Sopenharmony_ci                            uint32_t data_len,
143bf215546Sopenharmony_ci                            uint32_t stride,
144bf215546Sopenharmony_ci                            uint32_t *__serial);
145bf215546Sopenharmony_ci
146bf215546Sopenharmony_ciint rbug_send_texture_read(struct rbug_connection *__con,
147bf215546Sopenharmony_ci                           rbug_texture_t texture,
148bf215546Sopenharmony_ci                           uint32_t face,
149bf215546Sopenharmony_ci                           uint32_t level,
150bf215546Sopenharmony_ci                           uint32_t zslice,
151bf215546Sopenharmony_ci                           uint32_t x,
152bf215546Sopenharmony_ci                           uint32_t y,
153bf215546Sopenharmony_ci                           uint32_t w,
154bf215546Sopenharmony_ci                           uint32_t h,
155bf215546Sopenharmony_ci                           uint32_t *__serial);
156bf215546Sopenharmony_ci
157bf215546Sopenharmony_ciint rbug_send_texture_list_reply(struct rbug_connection *__con,
158bf215546Sopenharmony_ci                                 uint32_t serial,
159bf215546Sopenharmony_ci                                 rbug_texture_t *textures,
160bf215546Sopenharmony_ci                                 uint32_t textures_len,
161bf215546Sopenharmony_ci                                 uint32_t *__serial);
162bf215546Sopenharmony_ci
163bf215546Sopenharmony_ciint rbug_send_texture_info_reply(struct rbug_connection *__con,
164bf215546Sopenharmony_ci                                 uint32_t serial,
165bf215546Sopenharmony_ci                                 uint32_t target,
166bf215546Sopenharmony_ci                                 uint32_t format,
167bf215546Sopenharmony_ci                                 uint32_t *width,
168bf215546Sopenharmony_ci                                 uint32_t width_len,
169bf215546Sopenharmony_ci                                 uint16_t *height,
170bf215546Sopenharmony_ci                                 uint32_t height_len,
171bf215546Sopenharmony_ci                                 uint16_t *depth,
172bf215546Sopenharmony_ci                                 uint32_t depth_len,
173bf215546Sopenharmony_ci                                 uint32_t blockw,
174bf215546Sopenharmony_ci                                 uint32_t blockh,
175bf215546Sopenharmony_ci                                 uint32_t blocksize,
176bf215546Sopenharmony_ci                                 uint32_t last_level,
177bf215546Sopenharmony_ci                                 uint32_t nr_samples,
178bf215546Sopenharmony_ci                                 uint32_t tex_usage,
179bf215546Sopenharmony_ci                                 uint32_t *__serial);
180bf215546Sopenharmony_ci
181bf215546Sopenharmony_ciint rbug_send_texture_read_reply(struct rbug_connection *__con,
182bf215546Sopenharmony_ci                                 uint32_t serial,
183bf215546Sopenharmony_ci                                 uint32_t format,
184bf215546Sopenharmony_ci                                 uint32_t blockw,
185bf215546Sopenharmony_ci                                 uint32_t blockh,
186bf215546Sopenharmony_ci                                 uint32_t blocksize,
187bf215546Sopenharmony_ci                                 uint8_t *data,
188bf215546Sopenharmony_ci                                 uint32_t data_len,
189bf215546Sopenharmony_ci                                 uint32_t stride,
190bf215546Sopenharmony_ci                                 uint32_t *__serial);
191bf215546Sopenharmony_ci
192bf215546Sopenharmony_cistruct rbug_proto_texture_list * rbug_demarshal_texture_list(struct rbug_proto_header *header);
193bf215546Sopenharmony_ci
194bf215546Sopenharmony_cistruct rbug_proto_texture_info * rbug_demarshal_texture_info(struct rbug_proto_header *header);
195bf215546Sopenharmony_ci
196bf215546Sopenharmony_cistruct rbug_proto_texture_write * rbug_demarshal_texture_write(struct rbug_proto_header *header);
197bf215546Sopenharmony_ci
198bf215546Sopenharmony_cistruct rbug_proto_texture_read * rbug_demarshal_texture_read(struct rbug_proto_header *header);
199bf215546Sopenharmony_ci
200bf215546Sopenharmony_cistruct rbug_proto_texture_list_reply * rbug_demarshal_texture_list_reply(struct rbug_proto_header *header);
201bf215546Sopenharmony_ci
202bf215546Sopenharmony_cistruct rbug_proto_texture_info_reply * rbug_demarshal_texture_info_reply(struct rbug_proto_header *header);
203bf215546Sopenharmony_ci
204bf215546Sopenharmony_cistruct rbug_proto_texture_read_reply * rbug_demarshal_texture_read_reply(struct rbug_proto_header *header);
205bf215546Sopenharmony_ci
206bf215546Sopenharmony_ci#endif
207