121c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o/*
221c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o * Copyright 2009 VMware, Inc.
321c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o * All Rights Reserved.
421c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o *
521c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o * Permission is hereby granted, free of charge, to any person obtaining a
621c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o * copy of this software and associated documentation files (the "Software"),
721c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o * to deal in the Software without restriction, including without limitation
821c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o * on the rights to use, copy, modify, merge, publish, distribute, sub
921c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o * license, and/or sell copies of the Software, and to permit persons to whom
1021c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o * the Software is furnished to do so, subject to the following conditions:
1121c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o *
121b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o * The above copyright notice and this permission notice (including the next
131b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o * paragraph) shall be included in all copies or substantial portions of the
1421c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o * Software.
151b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o *
1686c627ec1136446409a0170d439e60c148e6eb48Theodore Ts'o * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1721c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1821c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
191b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o * VMWARE AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
209d1bd3de8dd44603a8141dbe4f0b2057dbdc5ea7Theodore Ts'o * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
21246501c612cb8309dc81b354b785405bbeef05ceTheodore Ts'o * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
22246501c612cb8309dc81b354b785405bbeef05ceTheodore Ts'o * USE OR OTHER DEALINGS IN THE SOFTWARE.
231b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o */
2421c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o
2521c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o/*
2621c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o * This file holds structs decelerations and function prototypes for one of
2721c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o * the rbug extensions. Implementation of the functions is in the same folder
2821c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o * in the c file matching this file's name.
2921c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o *
3021c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o * The structs what is returned from the demarshal functions. The functions
3121afac096df642708ebf63dc4354575883f11174Theodore Ts'o * starting rbug_send_* encodes a call to the write format and sends that to
3221c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o * the supplied connection, while functions starting with rbug_demarshal_*
3321c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o * demarshal data from the wire protocol.
341b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o *
351b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o * Structs and functions ending with _reply are replies to requests.
361b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o */
371b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o
3821afac096df642708ebf63dc4354575883f11174Theodore Ts'o#ifndef _RBUG_PROTO_TEXTURE_H_
3921c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o#define _RBUG_PROTO_TEXTURE_H_
4021c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o
4121c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o#include "rbug_proto.h"
4221c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o#include "rbug_core.h"
431b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o
441b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'ostruct rbug_proto_texture_list
451b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o{
461b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o	struct rbug_header header;
471b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o};
481b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o
491b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'ostruct rbug_proto_texture_info
501b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o{
511b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o	struct rbug_header header;
521b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o	rbug_texture_t texture;
5321c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o};
5421c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o
5521c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'ostruct rbug_proto_texture_write
5621c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o{
5721c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o	struct rbug_header header;
5821c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o	rbug_texture_t texture;
5921c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o	uint32_t face;
6021c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o	uint32_t level;
6121c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o	uint32_t zslice;
6221c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o	uint32_t x;
6321c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o	uint32_t y;
6421c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o	uint32_t w;
651b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o	uint32_t h;
661b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o	uint8_t *data;
671b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o	uint32_t data_len;
681b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o	uint32_t stride;
691b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o};
701b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o
711b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'ostruct rbug_proto_texture_read
721b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o{
731b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o	struct rbug_header header;
741b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o	rbug_texture_t texture;
751b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o	uint32_t face;
761b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o	uint32_t level;
771b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o	uint32_t zslice;
781b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o	uint32_t x;
791b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o	uint32_t y;
801b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o	uint32_t w;
811b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o	uint32_t h;
821b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o};
831b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o
841b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'ostruct rbug_proto_texture_list_reply
851b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o{
861b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o	struct rbug_header header;
871b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o	uint32_t serial;
881b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o	rbug_texture_t *textures;
891b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o	uint32_t textures_len;
901b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o};
911b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o
92d4b0ce03168d313e89110ab9fbaa6caf616d1786Theodore Ts'ostruct rbug_proto_texture_info_reply
93d4b0ce03168d313e89110ab9fbaa6caf616d1786Theodore Ts'o{
94d4b0ce03168d313e89110ab9fbaa6caf616d1786Theodore Ts'o	struct rbug_header header;
954ea0a1109d761e9caaa53f6fa9e036321826c5faTheodore Ts'o	uint32_t serial;
964ea0a1109d761e9caaa53f6fa9e036321826c5faTheodore Ts'o	uint32_t target;
973b5386dca8e0008e13351be5de6323576329aa58Theodore Ts'o	uint32_t format;
983b5386dca8e0008e13351be5de6323576329aa58Theodore Ts'o	uint32_t *width;
993b5386dca8e0008e13351be5de6323576329aa58Theodore Ts'o	uint32_t width_len;
1003b5386dca8e0008e13351be5de6323576329aa58Theodore Ts'o	uint32_t *height;
101adee8d75db09dc8ecb2a32f59a8c64d3f4c64b0eTheodore Ts'o	uint32_t height_len;
102adee8d75db09dc8ecb2a32f59a8c64d3f4c64b0eTheodore Ts'o	uint32_t *depth;
1033b5386dca8e0008e13351be5de6323576329aa58Theodore Ts'o	uint32_t depth_len;
104adee8d75db09dc8ecb2a32f59a8c64d3f4c64b0eTheodore Ts'o	uint32_t blockw;
105adee8d75db09dc8ecb2a32f59a8c64d3f4c64b0eTheodore Ts'o	uint32_t blockh;
1063b5386dca8e0008e13351be5de6323576329aa58Theodore Ts'o	uint32_t blocksize;
107adee8d75db09dc8ecb2a32f59a8c64d3f4c64b0eTheodore Ts'o	uint32_t last_level;
108adee8d75db09dc8ecb2a32f59a8c64d3f4c64b0eTheodore Ts'o	uint32_t nr_samples;
1093b5386dca8e0008e13351be5de6323576329aa58Theodore Ts'o	uint32_t tex_usage;
1103b5386dca8e0008e13351be5de6323576329aa58Theodore Ts'o};
1113b5386dca8e0008e13351be5de6323576329aa58Theodore Ts'o
1123b5386dca8e0008e13351be5de6323576329aa58Theodore Ts'ostruct rbug_proto_texture_read_reply
1133b5386dca8e0008e13351be5de6323576329aa58Theodore Ts'o{
1143b5386dca8e0008e13351be5de6323576329aa58Theodore Ts'o	struct rbug_header header;
1153b5386dca8e0008e13351be5de6323576329aa58Theodore Ts'o	uint32_t serial;
1163b5386dca8e0008e13351be5de6323576329aa58Theodore Ts'o	uint32_t format;
1173b5386dca8e0008e13351be5de6323576329aa58Theodore Ts'o	uint32_t blockw;
1183b5386dca8e0008e13351be5de6323576329aa58Theodore Ts'o	uint32_t blockh;
1193b5386dca8e0008e13351be5de6323576329aa58Theodore Ts'o	uint32_t blocksize;
1203b5386dca8e0008e13351be5de6323576329aa58Theodore Ts'o	uint8_t *data;
1213b5386dca8e0008e13351be5de6323576329aa58Theodore Ts'o	uint32_t data_len;
1223b5386dca8e0008e13351be5de6323576329aa58Theodore Ts'o	uint32_t stride;
1233b5386dca8e0008e13351be5de6323576329aa58Theodore Ts'o};
1243b5386dca8e0008e13351be5de6323576329aa58Theodore Ts'o
125d37066a9fa14ff3c0e7f4ea95e07204fce95f41aTheodore Ts'oint rbug_send_texture_list(struct rbug_connection *__con,
126d37066a9fa14ff3c0e7f4ea95e07204fce95f41aTheodore Ts'o                           uint32_t *__serial);
1273b5386dca8e0008e13351be5de6323576329aa58Theodore Ts'o
128d37066a9fa14ff3c0e7f4ea95e07204fce95f41aTheodore Ts'oint rbug_send_texture_info(struct rbug_connection *__con,
129d37066a9fa14ff3c0e7f4ea95e07204fce95f41aTheodore Ts'o                           rbug_texture_t texture,
1303b5386dca8e0008e13351be5de6323576329aa58Theodore Ts'o                           uint32_t *__serial);
131060b5fbf807dca3ce5f977a693ac68e84c03d13eTheodore Ts'o
132060b5fbf807dca3ce5f977a693ac68e84c03d13eTheodore Ts'oint rbug_send_texture_write(struct rbug_connection *__con,
133060b5fbf807dca3ce5f977a693ac68e84c03d13eTheodore Ts'o                            rbug_texture_t texture,
134ecf1b7767e1772f4c6dba8f02026057ed05397bdTheodore Ts'o                            uint32_t face,
1358394902e04e64ed10ca81e869892c00143ee4931Theodore Ts'o                            uint32_t level,
136ecf1b7767e1772f4c6dba8f02026057ed05397bdTheodore Ts'o                            uint32_t zslice,
13780bfaa3e40ae6ab00cc3d4d1f4c0eeefce0b1a96Theodore Ts'o                            uint32_t x,
138ecf1b7767e1772f4c6dba8f02026057ed05397bdTheodore Ts'o                            uint32_t y,
13980bfaa3e40ae6ab00cc3d4d1f4c0eeefce0b1a96Theodore Ts'o                            uint32_t w,
14080bfaa3e40ae6ab00cc3d4d1f4c0eeefce0b1a96Theodore Ts'o                            uint32_t h,
141ecf1b7767e1772f4c6dba8f02026057ed05397bdTheodore Ts'o                            uint8_t *data,
14280bfaa3e40ae6ab00cc3d4d1f4c0eeefce0b1a96Theodore Ts'o                            uint32_t data_len,
14380bfaa3e40ae6ab00cc3d4d1f4c0eeefce0b1a96Theodore Ts'o                            uint32_t stride,
144ecf1b7767e1772f4c6dba8f02026057ed05397bdTheodore Ts'o                            uint32_t *__serial);
14580bfaa3e40ae6ab00cc3d4d1f4c0eeefce0b1a96Theodore Ts'o
14680bfaa3e40ae6ab00cc3d4d1f4c0eeefce0b1a96Theodore Ts'oint rbug_send_texture_read(struct rbug_connection *__con,
147ecf1b7767e1772f4c6dba8f02026057ed05397bdTheodore Ts'o                           rbug_texture_t texture,
14880bfaa3e40ae6ab00cc3d4d1f4c0eeefce0b1a96Theodore Ts'o                           uint32_t face,
149424cd2beb7c40a3e4cf96b5bf28b24e48554a754Theodore Ts'o                           uint32_t level,
150424cd2beb7c40a3e4cf96b5bf28b24e48554a754Theodore Ts'o                           uint32_t zslice,
151424cd2beb7c40a3e4cf96b5bf28b24e48554a754Theodore Ts'o                           uint32_t x,
152424cd2beb7c40a3e4cf96b5bf28b24e48554a754Theodore Ts'o                           uint32_t y,
153424cd2beb7c40a3e4cf96b5bf28b24e48554a754Theodore Ts'o                           uint32_t w,
154424cd2beb7c40a3e4cf96b5bf28b24e48554a754Theodore Ts'o                           uint32_t h,
155c7f23364fd6d8d25d74e51ba5f342fc2230048d8Theodore Ts'o                           uint32_t *__serial);
1562f686ace1c8e2f680ffd450d143cdd01a649687aTheodore Ts'o
157c7f23364fd6d8d25d74e51ba5f342fc2230048d8Theodore Ts'oint rbug_send_texture_list_reply(struct rbug_connection *__con,
158773fd8a1d4202af708a37bdc7754134e6fdcfe22Theodore Ts'o                                 uint32_t serial,
159773fd8a1d4202af708a37bdc7754134e6fdcfe22Theodore Ts'o                                 rbug_texture_t *textures,
160773fd8a1d4202af708a37bdc7754134e6fdcfe22Theodore Ts'o                                 uint32_t textures_len,
161773fd8a1d4202af708a37bdc7754134e6fdcfe22Theodore Ts'o                                 uint32_t *__serial);
162773fd8a1d4202af708a37bdc7754134e6fdcfe22Theodore Ts'o
163773fd8a1d4202af708a37bdc7754134e6fdcfe22Theodore Ts'oint rbug_send_texture_info_reply(struct rbug_connection *__con,
16462e3e7fe4f32c2186e848f37b7f977835975413eTheodore Ts'o                                 uint32_t serial,
16562e3e7fe4f32c2186e848f37b7f977835975413eTheodore Ts'o                                 uint32_t target,
16662e3e7fe4f32c2186e848f37b7f977835975413eTheodore Ts'o                                 uint32_t format,
167d37066a9fa14ff3c0e7f4ea95e07204fce95f41aTheodore Ts'o                                 uint32_t *width,
168d37066a9fa14ff3c0e7f4ea95e07204fce95f41aTheodore Ts'o                                 uint32_t width_len,
169d37066a9fa14ff3c0e7f4ea95e07204fce95f41aTheodore Ts'o                                 uint32_t *height,
170d37066a9fa14ff3c0e7f4ea95e07204fce95f41aTheodore Ts'o                                 uint32_t height_len,
171d37066a9fa14ff3c0e7f4ea95e07204fce95f41aTheodore Ts'o                                 uint32_t *depth,
172d37066a9fa14ff3c0e7f4ea95e07204fce95f41aTheodore Ts'o                                 uint32_t depth_len,
17321c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o                                 uint32_t blockw,
17421c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o                                 uint32_t blockh,
17521c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o                                 uint32_t blocksize,
17621c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o                                 uint32_t last_level,
1771b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o                                 uint32_t nr_samples,
1781b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o                                 uint32_t tex_usage,
1791b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o                                 uint32_t *__serial);
18021c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o
1811b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'oint rbug_send_texture_read_reply(struct rbug_connection *__con,
18221c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o                                 uint32_t serial,
18321c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o                                 uint32_t format,
1841b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o                                 uint32_t blockw,
18521c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o                                 uint32_t blockh,
18621c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o                                 uint32_t blocksize,
1871b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o                                 uint8_t *data,
18821c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o                                 uint32_t data_len,
18921c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o                                 uint32_t stride,
1901b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o                                 uint32_t *__serial);
19121c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o
19221c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'ostruct rbug_proto_texture_list * rbug_demarshal_texture_list(struct rbug_proto_header *header);
1931b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o
19421c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'ostruct rbug_proto_texture_info * rbug_demarshal_texture_info(struct rbug_proto_header *header);
19521c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o
1961b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'ostruct rbug_proto_texture_write * rbug_demarshal_texture_write(struct rbug_proto_header *header);
19721c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o
19821c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'ostruct rbug_proto_texture_read * rbug_demarshal_texture_read(struct rbug_proto_header *header);
1991b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o
20021c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'ostruct rbug_proto_texture_list_reply * rbug_demarshal_texture_list_reply(struct rbug_proto_header *header);
20121c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o
2021b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'ostruct rbug_proto_texture_info_reply * rbug_demarshal_texture_info_reply(struct rbug_proto_header *header);
20321c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o
20421c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'ostruct rbug_proto_texture_read_reply * rbug_demarshal_texture_read_reply(struct rbug_proto_header *header);
2051b6bf1759af884957234b7dce768b785f792abd0Theodore Ts'o
20621c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o#endif
20721c84b71e205b5ab13f14343da5645dcc985856dTheodore Ts'o