Kernel/VTerm - Half-screen scroll step, fix limits
[tpg/acess2.git] / UDI / include / udi_gfx.h.ORIG
1 /**\r
2  * Summary: udi_gfx.h\r
3  * Contains the graphics metalanguage interface details\r
4  *\r
5  * Author:\r
6  *     Marcel Sondaar\r
7  *\r
8  * License:\r
9  *     <Public Domain>\r
10  *\r
11  * Origin:\r
12  *     http://www.d-rift.nl/combuster/mos3/?p=viewsource&file=/include/common/udi_gfx.h\r
13  */\r
14 \r
15 // note that the specification, and thus, the contents of this file is not fixed.\r
16 \r
17 #ifndef __UDI_GFX_H__\r
18 #define __UDI_GFX_H__\r
19 \r
20 #include <udi.h>\r
21 \r
22 #ifndef UDI_GFX_VERSION\r
23 #error "UDI_GFX_VERSION not defined."\r
24 #elif UDI_GFX_VERSION != 0x101\r
25 #error "UDI_GFX_VERSION not supported."\r
26 #endif\r
27 \r
28 /**\r
29  * Enumeration: UDI_GFX_PROP\r
30  * Lists the various UDI properties\r
31  */\r
32 \r
33 // General state properties\r
34 /* Constant: UDI_GFX_PROP_ENABLE\r
35  *\r
36  * Valid values:\r
37  *     0 - disabled\r
38  *     1 - enabled\r
39  *     2 - reset\r
40  *\r
41  * Ranges:\r
42  *     Must include at least 1\r
43  *\r
44  * The primary state of the connector or engine. An enabled state indicates\r
45  * it is functioning and generating live output. A disabled state is one where\r
46  * it is not contributing to any output but is otherwise functional. Finally\r
47  * the reset state is where the driver is free to deallocate all resources \r
48  * corresponding to this component and trash any state not referenced by other\r
49  * components.\r
50  *\r
51  * A disabled or reset engine forwards all data from the previous stage \r
52  * unmodified. The disabled state indicates that the component might be \r
53  * returned to its enabled state within short notice.\r
54  *\r
55  * A disabled connector will not send pixel data, but can perform other \r
56  * initialisation communication such as DDC. A reset connector will not respond\r
57  * in any fashion and can not be used for other purposes. Hardware is expected\r
58  * to be powered down in such state.\r
59  *\r
60  * Users should expect significant delays when moving components in and out of\r
61  * the reset state. Moving engines between the enabled and disabled state should\r
62  * take effect within one frame, such transition should take effect on a frame \r
63  * boundary when supported.\r
64  */\r
65 #define UDI_GFX_PROP_ENABLE 0\r
66 \r
67 #define UDI_GFX_PROP_ENABLE_DISABLED 0\r
68 #define UDI_GFX_PROP_ENABLE_ENABLED 1\r
69 #define UDI_GFX_PROP_ENABLE_RESET 2\r
70 /* Constant: UDI_GFX_PROP_INPUT\r
71  *\r
72  * Valid values:\r
73  *     Any valid engine ID, provided no dependency cycles are created, or -1\r
74  *\r
75  * Ranges:\r
76  *     Any non-empty set of valid values. Often hardwired.\r
77  *\r
78  * Points to the engine that is processed before this unit. In the case of a \r
79  * connector, it points to the last engine in a pipeline, and each engine points \r
80  * to the next engine in the sequence. A value of -1 indicates a source that \r
81  * only yields black pixels. Implementations must not allow cyclic structures. \r
82  * Changing this value may reallocate resources, and engines that are no longer \r
83  * referenced may lose their data (but not their state) when it is not part of \r
84  * any pipeline. If preservation is required, the ENABLE state should be used\r
85  * instead. Valid ranges includes one or more from the list of engines and -1 \r
86  * combined. In most cases, this property can not be modified.\r
87  */\r
88 #define UDI_GFX_PROP_INPUT 1\r
89 /* Constant: UDI_GFX_PROP_WIDTH\r
90  *\r
91  * Valid values:\r
92  *     Any non-zero positive number.\r
93  *\r
94  * Ranges:\r
95  *     Contains at least one valid value. Often only multiples of UNIT_WIDTH\r
96  *     or a power of two are allowed. May be hardwired.\r
97  *\r
98  * Contains the amount of pixels in the horizontal direction. For connectors, \r
99  * this is the amount of data pixels rendered horizontally. For engines, this \r
100  * is the width in pixels of the image. Pixels requested from an engine outside \r
101  * the range (0..width-1) are defined according to the <UDI_GFX_PROP_CLIP> \r
102  * property. In some cases, hardware may support only fixed combinations of \r
103  * width and height. In such cases, changing the width will also change the \r
104  * height to a corresponding valid number. Valid ranges include any values\r
105  * strictly above zero. For connectors, expect large continuous ranges, large\r
106  * ranges with a certain modulus, a limited number of fixed values, or a\r
107  * constant value.\r
108  */\r
109 #define UDI_GFX_PROP_WIDTH 2\r
110 /* Constant: UDI_GFX_PROP_HEIGHT\r
111  *\r
112  * Valid values:\r
113  *     Any non-zero positive number.\r
114  *\r
115  * Ranges:\r
116  *     Contains at least one valid value. Often only multiples of UNIT_HEIGHT\r
117  *     or a power of two are allowed. May be hardwired.\r
118  *\r
119  * Contains the amount of pixels in the vertical direction. Functions similar\r
120  * to the width property, but changing it will not alter the width property,\r
121  * and it's range at any time contains the valid range for the currently\r
122  * selected width.\r
123  */\r
124 #define UDI_GFX_PROP_HEIGHT 3\r
125 \r
126 /* Constant: UDI_GFX_PROP_CUSTOM\r
127  * The first property index of the driver's custom range. These are not assigned\r
128  * directly assigned by the UDI specification, but may be specified in the\r
129  * operator tree.\r
130  */\r
131 #define UDI_GFX_PROP_CUSTOM 1024\r
132 \r
133 // engine properties\r
134 \r
135 /* Constant: UDI_GFX_PROP_CLIP\r
136  *\r
137  * Valid values:\r
138  *     0 - points outside width x height are passed unmodified from input\r
139  *     1 - the engine's contents is tiled with size width x height\r
140  *     2 - points outside the width overflow into the y coordinate\r
141  *     3 - points outside the height overflow into the x coordinate\r
142  *\r
143  * Ranges:\r
144  *     Hardwired zero for connectors. Any non-empty subset for engines, usually\r
145  *     hardwired.\r
146  *\r
147  * For engines, contains the behaviour for pixels requested outside the width\r
148  * and height of the engine. Can be either 0 (pass from next stage), 1 (the\r
149  * coordinates are wrapped modulus the height and width), 2 (the coordinates\r
150  * overflow onto the next scanline horizontally, and wrap vertically), 3 (the\r
151  * coordinates overflow onto the next column vertically, and wrap horizontally).\r
152  * Valid ranges contain one or more of these options. For overlays and sprites,\r
153  * a value 0 is common. For framebuffers, 2 is the most common value. For\r
154  * connectors, this property is always 0 since they do not store pixel data\r
155  */\r
156 #define UDI_GFX_PROP_CLIP 4\r
157 \r
158 /* Constant: UDI_GFX_PROP_UNIT_WIDTH\r
159  *\r
160  * Valid values:\r
161  *     Any non-zero positive value\r
162  *\r
163  * Ranges:\r
164  *     Any non-empty set of valid values. May be hardwired to 1 for\r
165  *     framebuffers, or a range of small values for hardware scaling, or any\r
166  *     larger hardwired number or set for tiling engines.\r
167  *\r
168  * Tiles are used to indicate that the hardware groups sets of pixels and have\r
169  * each group share certain properties, i.e. color or tile index, or share the\r
170  * same chroma subsample with only a different intensity. If the engine has no\r
171  * such grouping, or shares all properties over the entire contents, the value\r
172  * of this property should be 1. Some tile examples include rescaling, where a\r
173  * tile width of 2 indicates a pixel doubling in X direction, or in text mode\r
174  * where a tile width of 8 or 9 corresponds with the width of common bitmap\r
175  * fonts\r
176  */\r
177 #define UDI_GFX_PROP_UNIT_WIDTH 5\r
178 \r
179 /* Constant: UDI_GFX_PROP_UNIT_HEIGHT\r
180  *\r
181  * Valid values:\r
182  *     Any non-zero positive value\r
183  *\r
184  * Ranges:\r
185  *     Any non-empty set of valid values. May be hardwired to 1 for\r
186  *     framebuffers, or a range of small values for hardware scaling, or any\r
187  *     larger hardwired number or set for tiling engines.\r
188  *\r
189  * See <UDI_GFX_PROP_UNIT_WIDTH>, but for the Y direction. Common values are\r
190  * 1-2 for framebuffers (doublescanning on or off), identical to the tile\r
191  * width, or mostly independent.\r
192  */\r
193 #define UDI_GFX_PROP_UNIT_HEIGHT 6\r
194 \r
195 /* Constant: UDI_GFX_PROP_TRANSLATEX\r
196  * \r
197  * Valid values:\r
198  *     Any, signed value.\r
199  *\r
200  * Ranges:\r
201  *     Any non-empty set. Typical values are hardwired zero, continuous\r
202  *     between -WIDTH and WIDTH, -WIDTH to zero inclusive, or all possible values\r
203  *\r
204  * The horizontal offset where drawing starts. A positive value means the top-left \r
205  * corner moves towards the right end of the screen, a negative value moves the\r
206  * origin off the screen on the left side. Clipped areas moved off the screen do \r
207  * not reappear on the opposite side.\r
208  *\r
209  * With clipping enabled, this field combined with <UDI_GFX_PROP_WIDTH> \r
210  * determines the area where the image should be drawn, which is the horizontal \r
211  * range from UDI_GFX_PROP_TRANSLATEX to UDI_GFX_PROP_WIDTH + \r
212  * UDI_GFX_PROP_TRANSLATEX - 1\r
213  */\r
214 #define UDI_GFX_PROP_TRANSLATEX 7\r
215 \r
216 /* Constant: UDI_GFX_PROP_TRANSLATEY\r
217  *\r
218  * Valid values:\r
219  *     Any signed value.\r
220  *\r
221  * Ranges:\r
222  *     Any non-empty set. Typical values are hardwired zero, continuous\r
223  *     between -WIDTH and WIDTH, or all possible values\r
224  *\r
225  * See <UDI_GFX_PROP_TRANSLATEX> but for the Y direction.\r
226  */\r
227 #define UDI_GFX_PROP_TRANSLATEY 8\r
228 \r
229 #define UDI_GFX_PROP_GL_VERSION 14\r
230 #define UDI_GFX_PROP_GLES_VERSION 15\r
231 #define UDI_GFX_PROP_STATE_BLOCK 16\r
232 #define UDI_GFX_PROP_COLOR_BITS 22\r
233 #define UDI_GFX_PROP_GL_TARGET 23\r
234 \r
235 /* Constant: UDI_GFX_PROP_STOCK_FORMAT\r
236  *\r
237  * Value:\r
238  *     Zero, or any constant from <UDI_GFX_STOCK_FORMAT>\r
239  *\r
240  * Ranges:\r
241  *     Any non-empty set of valid values.\r
242  *\r
243  * This field indicates the storage format is one from a limited set of \r
244  * typical configurations. If the field is zero, the engine is not knowingly\r
245  * configured as a common framebuffer. If nonzero, the operator chain and any\r
246  * dependent settings are defined to be functionally equivalent to that of a\r
247  * typical framebuffer device.\r
248  *\r
249  * The value zero does not imply that the device does not actually follow a\r
250  * set convention. This saves drivers from writing elaborate checking code\r
251  * to determine the condition in question.\r
252  *\r
253  * Writing this field potentially modifies other property fields within the\r
254  * same engine to establish the requested configuration. Manually writing such \r
255  * properties after changing this setting may in turn revert this property to\r
256  * the zero state, even if there was no modification or the behaviour is still\r
257  * as previously advertised by this property.\r
258  */\r
259 #define UDI_GFX_PROP_STOCK_FORMAT 27\r
260 \r
261 /* Constant: UDI_GFX_PROP_OPERATOR_COUNT\r
262  * \r
263  * Valid values:\r
264  *     Any non-zero positive number\r
265  * \r
266  * Ranges:\r
267  *     Most likely constant. Can be any set of valid values.\r
268  *\r
269  * The current value is the number of entries in the operator tree that can\r
270  * be requested for this engine using <udi_gfx_get_engine_operator_req> and\r
271  * <udi_gfx_get_engine_operator_ack>\r
272  */\r
273 #define UDI_GFX_PROP_OPERATOR_COUNT 28\r
274 \r
275 // properties for removal:\r
276 #define UDI_GFX_PROP_STORE_COUNT 24       // not generic\r
277 #define UDI_GFX_PROP_STORE_WIDTH 9        // not generic\r
278 #define UDI_GFX_PROP_STORE_HEIGHT 10      // not generic\r
279 #define UDI_GFX_PROP_STORE_BITS 11        // not generic\r
280 #define UDI_GFX_PROP_PALETTE 1024         // optional, can be derived from the operator tree\r
281 #define UDI_GFX_PROP_BUFFER 1025          // optional, can be derived from the operator tree\r
282 #define UDI_GFX_PROP_TILESHEET 1026       // optional, can be derived from the operator tree\r
283 #define UDI_GFX_PROP_OPERATOR_INDEX 17    // deprecated for dedicated methods\r
284 #define UDI_GFX_PROP_OPERATOR_OPCODE 18   // deprecated for dedicated methods\r
285 #define UDI_GFX_PROP_OPERATOR_ARG_1 19    // deprecated for dedicated methods\r
286 #define UDI_GFX_PROP_OPERATOR_ARG_2 20    // deprecated for dedicated methods\r
287 #define UDI_GFX_PROP_OPERATOR_ARG_3 21    // deprecated for dedicated methods\r
288 #define UDI_GFX_PROP_SOURCE_WIDTH 12      // should have been documented when I still knew what it did.\r
289 #define UDI_GFX_PROP_SOURCE_HEIGHT 13     // should have been documented when I still knew what it did.\r
290 #define UDI_GFX_PROP_INPUTX 25            // should have been documented when I still knew what it did.\r
291 #define UDI_GFX_PROP_INPUTY 26            // should have been documented when I still knew what it did.\r
292 \r
293 // connector properties\r
294 #define UDI_GFX_PROP_SIGNAL 23\r
295 #define UDI_GFX_PROP_CONNECTOR_TYPE 24\r
296 #define UDI_GFX_PROP_VGA_H_FRONT_PORCH 25\r
297 #define UDI_GFX_PROP_VGA_H_BACK_PORCH 26\r
298 #define UDI_GFX_PROP_VGA_H_SYNC 27\r
299 #define UDI_GFX_PROP_VGA_V_FRONT_PORCH 28\r
300 #define UDI_GFX_PROP_VGA_V_BACK_PORCH 29\r
301 #define UDI_GFX_PROP_VGA_V_SYNC 30\r
302 #define UDI_GFX_PROP_DOT_CLOCK 31\r
303 #define UDI_GFX_PROP_VGA_H_SYNC_POL 32\r
304 #define UDI_GFX_PROP_VGA_V_SYNC_POL 33\r
305 \r
306 /**\r
307  * Enumeration: UDI_GFX_SIGNAL\r
308  * Lists the various signal types\r
309  */\r
310 #define UDI_GFX_SIGNAL_HIDDEN 0\r
311 #define UDI_GFX_SIGNAL_INTEGRATED 0\r
312 #define UDI_GFX_SIGNAL_RGBHV 1\r
313 #define UDI_GFX_SIGNAL_RGBS 2\r
314 #define UDI_GFX_SIGNAL_RGSB 3\r
315 #define UDI_GFX_SIGNAL_YPBPR 4\r
316 #define UDI_GFX_SIGNAL_DVID 5\r
317 #define UDI_GFX_SIGNAL_YUV 6\r
318 #define UDI_GFX_SIGNAL_YIQ 7\r
319 #define UDI_GFX_SIGNAL_Y_UV 8\r
320 #define UDI_GFX_SIGNAL_Y_IQ 9\r
321 #define UDI_GFX_SIGNAL_HDMI 10\r
322 #define UDI_GFX_SIGNAL_TEXT 11\r
323 #define UDI_GFX_SIGNAL_CUSTOM 12\r
324 \r
325 /**\r
326  * Enumeration: UDI_GFX_CONNECTOR\r
327  * Lists the various external connectors\r
328  */\r
329 #define UDI_GFX_CONNECTOR_HIDDEN 0\r
330 #define UDI_GFX_CONNECTOR_VGA 1\r
331 #define UDI_GFX_CONNECTOR_DVI 2\r
332 #define UDI_GFX_CONNECTOR_SVIDEO 3\r
333 #define UDI_GFX_CONNECTOR_COMPONENT 4\r
334 #define UDI_GFX_CONNECTOR_HDMI 5\r
335 #define UDI_GFX_CONNECTOR_RF 6\r
336 #define UDI_GFX_CONNECTOR_SCART 7\r
337 #define UDI_GFX_CONNECTOR_COMPOSITE 8\r
338 #define UDI_GFX_CONNECTOR_MEMBUFFER 9\r
339 \r
340 /**\r
341  * Enumeration: UDI_GFX_OPERATOR\r
342  * Lists the display output operator\r
343  */\r
344 #define UDI_GFX_OPERATOR_RGB     0 // output = (color) red(a1) + green(a2) + blue(a3) (each component is UDI_GFX_PROP_COLOR_BITS\r
345 #define UDI_GFX_OPERATOR_YUV     1 // output = (color) Y(a1) + U(a2) + V(a3)\r
346 #define UDI_GFX_OPERATOR_YIQ     2 // output = (color) Y(a1) + I(a2) + Q(a3)\r
347 #define UDI_GFX_OPERATOR_I       3 // output = (color) intensity(a1)\r
348 #define UDI_GFX_OPERATOR_ALPHA   4 // output = (color) a1 + alpha(a2)\r
349 #define UDI_GFX_OPERATOR_ADD     5 // output = a1 + a2 + v3\r
350 #define UDI_GFX_OPERATOR_SUB     6 // output = a1 - a2 - v3\r
351 #define UDI_GFX_OPERATOR_MUL     7 // output = a1 * a2\r
352 #define UDI_GFX_OPERATOR_DIV     8 // output = a1 / a2\r
353 #define UDI_GFX_OPERATOR_MAD     9 // output = a1 * a2 + a3\r
354 #define UDI_GFX_OPERATOR_FRC    10 // output = (a1 * a2) / a3\r
355 #define UDI_GFX_OPERATOR_SHR    11 // output = a1 >> (a2 + v3)\r
356 #define UDI_GFX_OPERATOR_SHL    12 // output = a1 << (a2 + v3)\r
357 #define UDI_GFX_OPERATOR_ROR    13 // output = a1 >> a2 (over a3 bits)\r
358 #define UDI_GFX_OPERATOR_ROL    14 // output = a1 << a2 (over a3 bits)\r
359 #define UDI_GFX_OPERATOR_SAR    15 // output = a1 >> a2 (width is a3 bits, i.e. empties are filled with bit a3-1)\r
360 #define UDI_GFX_OPERATOR_SAL    16 // output = a1 <<< (a2 + v3) (empties filled with bit 0)\r
361 #define UDI_GFX_OPERATOR_AND    17 // output = a1 & a2\r
362 #define UDI_GFX_OPERATOR_OR     18 // output = a1 | a2 | v3\r
363 #define UDI_GFX_OPERATOR_NOT    19 // output = ~a1\r
364 #define UDI_GFX_OPERATOR_XOR    20 // output = a1 ^ a2 ^ v3\r
365 #define UDI_GFX_OPERATOR_NEG    21 // output = -a1\r
366 #define UDI_GFX_OPERATOR_SEG    22 // output = (a1 >> v2) & (2**v3-1) (select v3 bits starting from bit v2)\r
367 #define UDI_GFX_OPERATOR_RANGE  23 // output = (a1 > a2) ? a2 : ((a1 < a3) ? a3 : a1)\r
368 #define UDI_GFX_OPERATOR_CONST  24 // output = v1\r
369 #define UDI_GFX_OPERATOR_ATTR   25 // output = property[a1 + v2]\r
370 #define UDI_GFX_OPERATOR_SWITCH 26 // output = output[(a1 % v3) + v2]\r
371 #define UDI_GFX_OPERATOR_BUFFER 27 // output = buffer[a1][a2] (buffer is v3 bits per entry)\r
372 #define UDI_GFX_OPERATOR_X      28 // output = output x pixel\r
373 #define UDI_GFX_OPERATOR_Y      29 // output = output y pixel\r
374 #define UDI_GFX_OPERATOR_TX     30 // output = horizontal tile index belonging to output pixel\r
375 #define UDI_GFX_OPERATOR_TY     31 // output = vertical tile index belonging to output pixel\r
376 #define UDI_GFX_OPERATOR_TXOFF  32 // output = horizontal offset from start of tile\r
377 #define UDI_GFX_OPERATOR_TYOFF  33 // output = vertical offset from start of tile\r
378 #define UDI_GFX_OPERATOR_INPUT  34 // output = input engine[x][y]   component v1\r
379 #define UDI_GFX_OPERATOR_DINPUT 35 // output = input engine[a1][a2] component v3\r
380 \r
381 /* Enumeration: UDI_GFX_STOCK_FORMAT\r
382  * Lists stock configurations\r
383  *\r
384  * When a stock configuration is used, the device is set to behave as a \r
385  * simple framebuffer device. The <UDI_GFX_PROP_WIDTH> and <UDI_GFX_PROP_HEIGHT>\r
386  * determine the virtual size of the framebuffer, and <UDI_GFX_PROP_TRANSLATEX>\r
387  * and <UDI_GFX_PROP_TRANSLATEY> indicate the offset into that framebuffer \r
388  * that is visible (which are typically restricted to negative values)\r
389  */\r
390 #define UDI_GFX_STOCK_FORMAT_UNKNOWN  0\r
391 #define UDI_GFX_STOCK_FORMAT_R8G8B8X8 1\r
392 #define UDI_GFX_STOCK_FORMAT_B8G8R8X8 2\r
393 #define UDI_GFX_STOCK_FORMAT_R8G8B8   3\r
394 #define UDI_GFX_STOCK_FORMAT_B8G8R8   4\r
395 #define UDI_GFX_STOCK_FORMAT_R5G6B5   5\r
396 #define UDI_GFX_STOCK_FORMAT_B5G6R5   6\r
397 #define UDI_GFX_STOCK_FORMAT_R5G5B5X1 7\r
398 #define UDI_GFX_STOCK_FORMAT_B5G5R5X1 8\r
399 #define UDI_GFX_STOCK_FORMAT_N8 9\r
400 \r
401 // Enumeration: UDI_GFX_BUFFER_INFO_FLAG\r
402 // Lists behavioural patterns for direct buffer accesses.\r
403 //\r
404 #define UDI_GFX_BUFFER_INFO_FLAG_R              0x0001  // buffer can be read\r
405 #define UDI_GFX_BUFFER_INFO_FLAG_W              0x0002  // buffer can be written\r
406 #define UDI_GFX_BUFFER_INFO_FLAG_BITALIGN_ENTRY 0x0004  // for non-multiple-of-eight buffer slot sizes, align on byte boundary every unit\r
407 #define UDI_GFX_BUFFER_INFO_FLAG_BITALIGN_ROW   0x0008  // for non-multiple-of-eight buffer slot sizes, align only the start of the row\r
408 \r
409 \r
410 // Constant: UDI_GFX_PROVIDER_OPS_NUM\r
411 // the ops number used for the graphics driver\r
412 #define UDI_GFX_PROVIDER_OPS_NUM 1\r
413 \r
414 // Constant: UDI_GFX_CLIENT_OPS_NUM\r
415 // the ops number used for the graphics application\r
416 #define UDI_GFX_CLIENT_OPS_NUM 2\r
417 \r
418 // Structure: udi_gfx_bind_cb_t\r
419 // Contains the operations of a driver binding request\r
420 typedef struct {\r
421     // Variable: gcb\r
422     // The main control block\r
423     udi_cb_t gcb;    \r
424 } udi_gfx_bind_cb_t;\r
425 #define UDI_GFX_BIND_CB_NUM 1\r
426 \r
427 // Function: udi_block_bind_req\r
428 // function pointer prototype for connecting to a block device\r
429 // \r
430 // in:\r
431 //     cb - A pointer to a <udi_block_bind_cb_t>\r
432 //\r
433 typedef void udi_gfx_bind_req_op_t (udi_gfx_bind_cb_t *cb );\r
434 udi_gfx_bind_req_op_t udi_gfx_bind_req;\r
435 \r
436 // Function: udi_gfx_bind_ack\r
437 // function pointer prototype for acknowledging a connection request\r
438 // \r
439 // in:\r
440 //     cb      - A pointer to a <udi_gfx_bind_cb_t>\r
441 //     sockets - The number of addressable socket components\r
442 //     engines - The number of addressable engine components\r
443 //     status  - The result of the bind operation\r
444 //\r
445 typedef void udi_gfx_bind_ack_op_t (udi_gfx_bind_cb_t *cb, udi_index_t sockets, udi_index_t engines, udi_status_t status );\r
446 udi_gfx_bind_ack_op_t udi_gfx_bind_ack;\r
447 \r
448 // Function: udi_gfx_unbind_req\r
449 // function pointer prototype for disconnecting a block device\r
450 // \r
451 // in:\r
452 //     cb - A pointer to a <udi_block_bind_cb_t>\r
453 //\r
454 typedef void udi_gfx_unbind_req_op_t (udi_gfx_bind_cb_t *cb );\r
455 udi_gfx_unbind_req_op_t udi_gfx_unbind_req;\r
456 \r
457 // Function: udi_gfx_unbind_ack\r
458 // function pointer prototype for connecting to a block device\r
459 // \r
460 // in:\r
461 //     cb - A pointer to a <udi_gfx_bind_cb_t>\r
462 //\r
463 typedef void udi_gfx_unbind_ack_op_t (udi_gfx_bind_cb_t *cb );\r
464 udi_gfx_unbind_ack_op_t udi_gfx_unbind_ack;\r
465 \r
466 // Structure: udi_gfx_state_cb_t\r
467 // Contains the operations of a read/write transaction\r
468 typedef struct {\r
469     // Variable: gcb\r
470     // The main control block\r
471     udi_cb_t gcb;    \r
472     udi_ubit32_t subsystem;\r
473     udi_ubit32_t attribute;\r
474 } udi_gfx_state_cb_t;\r
475 #define UDI_GFX_STATE_CB_NUM 2\r
476 \r
477 // Function: udi_gfx_set_engine_req\r
478 // function pointer prototype for setting an engine state\r
479 // \r
480 // in:\r
481 //     cb - A pointer to a <udi_gfx_state_cb_t>\r
482 //\r
483 typedef void udi_gfx_set_engine_req_op_t (udi_gfx_state_cb_t *cb, udi_ubit32_t value);\r
484 udi_gfx_set_engine_req_op_t udi_gfx_set_engine_req;\r
485 \r
486 // Function: udi_gfx_set_connector_req\r
487 // function pointer prototype for setting an connector state\r
488 // \r
489 // in:\r
490 //     cb - A pointer to a <udi_gfx_state_cb_t>\r
491 //\r
492 typedef void udi_gfx_set_connector_req_op_t (udi_gfx_state_cb_t *cb, udi_ubit32_t value);\r
493 udi_gfx_set_connector_req_op_t udi_gfx_set_connector_req;\r
494 \r
495 // Function: udi_gfx_set_engine_ack\r
496 // function pointer prototype for setting an engine state\r
497 // \r
498 // in:\r
499 //     cb - A pointer to a <udi_gfx_state_cb_t>\r
500 //\r
501 typedef void udi_gfx_set_engine_ack_op_t (udi_gfx_state_cb_t *cb );\r
502 udi_gfx_set_engine_ack_op_t udi_gfx_set_engine_ack;\r
503 \r
504 // Function: udi_gfx_set_connector_ack\r
505 // function pointer prototype for setting an engine state\r
506 // \r
507 // in:\r
508 //     cb - A pointer to a <udi_gfx_state_cb_t>\r
509 //\r
510 typedef void udi_gfx_set_connector_ack_op_t (udi_gfx_state_cb_t *cb );\r
511 udi_gfx_set_connector_ack_op_t udi_gfx_set_connector_ack;\r
512 \r
513 // Function: udi_gfx_get_engine_req\r
514 // function pointer prototype for setting an engine state\r
515 // \r
516 // in:\r
517 //     cb - A pointer to a <udi_gfx_state_cb_t>\r
518 //\r
519 typedef void udi_gfx_get_engine_req_op_t (udi_gfx_state_cb_t *cb );\r
520 udi_gfx_get_engine_req_op_t udi_gfx_get_engine_req;\r
521 \r
522 // Function: udi_gfx_get_connector_req\r
523 // function pointer prototype for setting an connector state\r
524 // \r
525 // in:\r
526 //     cb - A pointer to a <udi_gfx_state_cb_t>\r
527 //\r
528 typedef void udi_gfx_get_connector_req_op_t (udi_gfx_state_cb_t *cb );\r
529 udi_gfx_get_connector_req_op_t udi_gfx_get_connector_req;\r
530 \r
531 // Function: udi_gfx_get_engine_ack\r
532 // function pointer prototype for setting an engine state\r
533 // \r
534 // in:\r
535 //     cb - A pointer to a <udi_gfx_state_cb_t>\r
536 //\r
537 typedef void udi_gfx_get_engine_ack_op_t (udi_gfx_state_cb_t *cb, udi_ubit32_t value);\r
538 udi_gfx_get_engine_ack_op_t udi_gfx_get_engine_ack;\r
539 \r
540 // Function: udi_gfx_get_connector_ack\r
541 // function pointer prototype for setting an engine state\r
542 // \r
543 // in:\r
544 //     cb - A pointer to a <udi_gfx_state_cb_t>\r
545 //\r
546 typedef void udi_gfx_get_connector_ack_op_t (udi_gfx_state_cb_t *cb, udi_ubit32_t value);\r
547 udi_gfx_get_connector_ack_op_t udi_gfx_get_connector_ack;\r
548 \r
549 // Function: udi_gfx_set_engine_nak\r
550 // function pointer prototype for setting an engine state\r
551 // \r
552 // in:\r
553 //     cb     - A pointer to a <udi_gfx_state_cb_t>\r
554 //     status - An UDI status value indicative of the error\r
555 //\r
556 typedef void udi_gfx_set_engine_nak_op_t (udi_gfx_state_cb_t *cb, udi_status_t status);\r
557 udi_gfx_set_engine_nak_op_t udi_gfx_set_engine_nak;\r
558 \r
559 // Function: udi_gfx_set_connector_nak\r
560 // function pointer prototype for setting an engine state\r
561 // \r
562 // in:\r
563 //     cb     - A pointer to a <udi_gfx_state_cb_t>\r
564 //     status - An UDI status value indicative of the error\r
565 //\r
566 typedef void udi_gfx_set_connector_nak_op_t (udi_gfx_state_cb_t *cb, udi_status_t status);\r
567 udi_gfx_set_connector_nak_op_t udi_gfx_get_connector_nak;\r
568 \r
569 // Structure: udi_gfx_range_cb_t\r
570 // Contains the operations of a range request transaction\r
571 typedef struct {\r
572     // Variable: gcb\r
573     // The main control block\r
574     udi_cb_t gcb;    \r
575     udi_ubit32_t subsystem;\r
576     udi_ubit32_t attribute;\r
577     udi_buf_t * rangedata;  \r
578 } udi_gfx_range_cb_t;\r
579 #define UDI_GFX_RANGE_CB_NUM 3\r
580 \r
581 // Function: udi_gfx_range_engine_req\r
582 // function pointer prototype for getting an engine property range\r
583 // \r
584 // in:\r
585 //     cb - A pointer to a <udi_gfx_range_cb_t>\r
586 //\r
587 typedef void udi_gfx_range_engine_req_op_t (udi_gfx_range_cb_t *cb );\r
588 udi_gfx_range_engine_req_op_t udi_gfx_range_engine_req;\r
589 \r
590 // Function: udi_gfx_range_connector_req\r
591 // function pointer prototype for getting a connector property range\r
592 // \r
593 // in:\r
594 //     cb - A pointer to a <udi_gfx_range_cb_t>\r
595 //\r
596 typedef void udi_gfx_range_connector_req_op_t (udi_gfx_range_cb_t *cb );\r
597 udi_gfx_range_connector_req_op_t udi_gfx_range_connector_req;\r
598 \r
599 // Function: udi_gfx_range_engine_ack\r
600 // function pointer prototype for replying an engine property range\r
601 // \r
602 // in:\r
603 //     cb - A pointer to a <udi_gfx_range_cb_t>\r
604 //\r
605 typedef void udi_gfx_range_engine_ack_op_t (udi_gfx_range_cb_t *cb );\r
606 udi_gfx_range_engine_ack_op_t udi_gfx_range_engine_ack;\r
607 \r
608 // Function: udi_gfx_range_connector_ack\r
609 // function pointer prototype for replying a connector property range\r
610 // \r
611 // in:\r
612 //     cb - A pointer to a <udi_gfx_range_cb_t>\r
613 //\r
614 typedef void udi_gfx_range_connector_ack_op_t (udi_gfx_range_cb_t *cb );\r
615 udi_gfx_range_connector_ack_op_t udi_gfx_range_connector_ack;\r
616 \r
617 // Function: udi_gfx_get_engine_operator_req\r
618 // function pointer prototype for requesting the engine operator layout\r
619 // \r
620 // in:\r
621 //     cb - A pointer to a <udi_gfx_state_cb_t>\r
622 //\r
623 typedef void udi_gfx_get_engine_operator_req_op_t (udi_gfx_range_cb_t *cb );\r
624 udi_gfx_get_engine_operator_req_op_t udi_gfx_get_engine_operator_req;\r
625 \r
626 // Function: udi_gfx_get_engine_operator_ack\r
627 // function pointer prototype for replying the engine operator layout\r
628 // \r
629 // in:\r
630 //     cb   - A pointer to a <udi_gfx_state_cb_t>\r
631 //     op   - The operator performed at this index\r
632 //     arg1 - the first argument to this operator\r
633 //     arg2 - the second argument to this operator\r
634 //     arg3 - the third argument to this operator\r
635 //\r
636 typedef void udi_gfx_get_engine_operator_ack_op_t (udi_gfx_range_cb_t *cb, udi_ubit32_t op, udi_ubit32_t arg1, udi_ubit32_t arg2, udi_ubit32_t arg3 );\r
637 udi_gfx_get_engine_operator_ack_op_t udi_gfx_get_engine_operator_ack;\r
638 \r
639 \r
640 \r
641 // Structure: udi_gfx_command_cb_t\r
642 // Contains the operations of a command sequence\r
643 typedef struct {\r
644     // Variable: gcb\r
645     // The main control block\r
646     udi_cb_t gcb;    \r
647     udi_buf_t * commanddata;\r
648 } udi_gfx_command_cb_t;\r
649 #define UDI_GFX_COMMAND_CB_NUM 4\r
650 \r
651 // Function: udi_gfx_connector_command_req\r
652 // function pointer prototype for sending command data to the output connector\r
653 // \r
654 // in:\r
655 //     cb - A pointer to a <udi_gfx_command_cb_t>\r
656 //\r
657 typedef void udi_gfx_connector_command_req_op_t (udi_gfx_command_cb_t *cb );\r
658 udi_gfx_connector_command_req_op_t udi_gfx_connector_command_req;\r
659 \r
660 // Function: udi_gfx_engine_command_req\r
661 // function pointer prototype for sending command data to the engine\r
662 // \r
663 // in:\r
664 //     cb - A pointer to a <udi_gfx_command_cb_t>\r
665 //\r
666 typedef void udi_gfx_engine_command_req_op_t (udi_gfx_command_cb_t *cb );\r
667 udi_gfx_engine_command_req_op_t udi_gfx_engine_command_req;\r
668 \r
669 // Function: udi_gfx_connector_command_ack\r
670 // function pointer prototype for sending command data replies\r
671 // \r
672 // in:\r
673 //     cb - A pointer to a <udi_gfx_command_cb_t>\r
674 //\r
675 typedef void udi_gfx_connector_command_ack_op_t (udi_gfx_command_cb_t *cb);\r
676 udi_gfx_connector_command_ack_op_t udi_gfx_connector_command_ack;\r
677 \r
678 // Function: udi_gfx_engine_command_ack\r
679 // function pointer prototype for sending engine data replies\r
680 // \r
681 // in:\r
682 //     cb - A pointer to a <udi_gfx_command_cb_t>\r
683 //\r
684 typedef void udi_gfx_engine_command_ack_op_t (udi_gfx_command_cb_t *cb);\r
685 udi_gfx_engine_command_ack_op_t udi_gfx_engine_command_ack;\r
686 \r
687 // Structure: udi_gfx_buffer_cb_t\r
688 // Contains a description of a buffer, or area thereof\r
689 typedef struct {\r
690     // Variable: gcb\r
691     // The main control block\r
692     udi_cb_t gcb;    \r
693     udi_ubit32_t buffer_index;\r
694 } udi_gfx_buffer_info_cb_t;\r
695 \r
696 // Function: udi_gfx_buffer_info_req\r
697 // function pointer prototype for getting buffer configuration information\r
698 // \r
699 // in:\r
700 //     cb - A pointer to a <udi_gfx_command_cb_t>\r
701 //\r
702 typedef void udi_gfx_buffer_info_req_op_t (udi_gfx_buffer_info_cb_t *cb);\r
703 udi_gfx_buffer_info_req_op_t udi_gfx_buffer_info_req;\r
704 \r
705 // Function: udi_gfx_buffer_info_ack\r
706 // function pointer prototype for getting buffer configuration information\r
707 // \r
708 // in:\r
709 //     cb       - A pointer to a <udi_gfx_command_cb_t>\r
710 //     width    - The width of the buffer\r
711 //     height   - The height of the buffer\r
712 //     bitsper  - The number of bits read from the buffer per pixel unit\r
713 //     flags    - A bitfield of <UDI_GFX_BUFFER_FLAGS> indicating the exposed \r
714 //                capabilities of this buffer\r
715 //\r
716 // Note that bitsper might not be a multiple of eight.\r
717 //\r
718 typedef void udi_gfx_buffer_info_ack_op_t (udi_gfx_buffer_info_cb_t *cb, udi_ubit32_t width, udi_ubit32_t height, udi_ubit32_t bitsper, udi_ubit32_t flags);\r
719 udi_gfx_buffer_info_ack_op_t udi_gfx_buffer_info_ack;\r
720 \r
721 // Structure: udi_gfx_buffer_cb_t\r
722 // Contains a description of a buffer, or area thereof\r
723 typedef struct {\r
724     // Variable: gcb\r
725     // The main control block\r
726     udi_cb_t gcb;    \r
727     udi_ubit32_t buffer_index;\r
728     udi_ubit32_t x;\r
729     udi_ubit32_t y;\r
730     udi_ubit32_t width;\r
731     udi_ubit32_t height;\r
732     udi_buf_t * buffer;\r
733 } udi_gfx_buffer_cb_t;\r
734 \r
735 // Function: udi_gfx_buffer_write_req_op_t\r
736 // function pointer prototype for writing raw hardware buffers\r
737 // \r
738 // in:\r
739 //     cb - A pointer to a <udi_gfx_buffer_cb_t>\r
740 //\r
741 typedef void udi_gfx_buffer_write_req_op_t (udi_gfx_buffer_cb_t *cb);\r
742 udi_gfx_buffer_write_req_op_t udi_gfx_buffer_write_req;\r
743 \r
744 // Function: udi_gfx_buffer_write_req_op_t\r
745 // function pointer prototype for reading raw hardware buffers\r
746 // \r
747 // in:\r
748 //     cb - A pointer to a <udi_gfx_buffer_cb_t>\r
749 //\r
750 typedef void udi_gfx_buffer_read_req_op_t (udi_gfx_buffer_cb_t *cb);\r
751 udi_gfx_buffer_read_req_op_t udi_gfx_buffer_read_req;\r
752 \r
753 // Function: udi_gfx_buffer_write_ack_op_t\r
754 // function pointer prototype for writing raw hardware buffers\r
755 // \r
756 // in:\r
757 //     cb - A pointer to a <udi_gfx_buffer_cb_t>\r
758 //\r
759 typedef void udi_gfx_buffer_write_ack_op_t (udi_gfx_buffer_cb_t *cb);\r
760 udi_gfx_buffer_write_ack_op_t udi_gfx_buffer_write_ack;\r
761 \r
762 // Function: udi_gfx_buffer_write_ack_op_t\r
763 // function pointer prototype for reading raw hardware buffers\r
764 // \r
765 // in:\r
766 //     cb - A pointer to a <udi_gfx_buffer_cb_t>\r
767 //\r
768 typedef void udi_gfx_buffer_read_ack_op_t (udi_gfx_buffer_cb_t *cb);\r
769 udi_gfx_buffer_read_ack_op_t udi_gfx_buffer_read_ack;\r
770 \r
771 // Function: udi_gfx_buffer_write_nak_op_t\r
772 // error handling for buffer writes\r
773 // \r
774 // in:\r
775 //     cb - A pointer to a <udi_gfx_buffer_cb_t>\r
776 //\r
777 typedef void udi_gfx_buffer_write_nak_op_t (udi_gfx_buffer_cb_t *cb, udi_status_t status);\r
778 udi_gfx_buffer_write_nak_op_t udi_gfx_buffer_write_nak;\r
779 \r
780 // Function: udi_gfx_buffer_write_nak_op_t\r
781 // error handling for buffer reads\r
782 // \r
783 // in:\r
784 //     cb - A pointer to a <udi_gfx_buffer_cb_t>\r
785 //\r
786 typedef void udi_gfx_buffer_read_nak_op_t (udi_gfx_buffer_cb_t *cb, udi_status_t status);\r
787 udi_gfx_buffer_read_nak_op_t udi_gfx_buffer_read_nak;\r
788 \r
789 /* Structure: udi_gfx_provider_ops_t\r
790  * \r
791  * The graphics metalanguage entry points (provider side)\r
792  */\r
793 typedef const struct {\r
794     udi_channel_event_ind_op_t          *channel_event_ind_op;\r
795     udi_gfx_bind_req_op_t               *gfx_bind_req_op;\r
796     udi_gfx_unbind_req_op_t             *gfx_unbind_req_op;\r
797     udi_gfx_set_connector_req_op_t      *gfx_set_connector_req_op;\r
798     udi_gfx_set_engine_req_op_t         *gfx_set_engine_req_op;\r
799     udi_gfx_get_connector_req_op_t      *gfx_get_connector_req_op;\r
800     udi_gfx_get_engine_req_op_t         *gfx_get_engine_req_op;\r
801     udi_gfx_range_connector_req_op_t    *gfx_range_connector_req_op;\r
802     udi_gfx_range_engine_req_op_t       *gfx_range_engine_req_op;\r
803     udi_gfx_get_engine_operator_req_op_t*gfx_get_engine_operator_req_op;\r
804     udi_gfx_connector_command_req_op_t  *gfx_connector_command_req_op;\r
805     udi_gfx_engine_command_req_op_t     *gfx_engine_command_req_op;\r
806     udi_gfx_buffer_info_req_op_t        *gfx_buffer_info_req_op;\r
807     udi_gfx_buffer_read_req_op_t        *gfx_buffer_read_req_op;\r
808     udi_gfx_buffer_write_req_op_t       *gfx_buffer_write_req_op;\r
809 } udi_gfx_provider_ops_t;\r
810 \r
811 /* Structure: udi_gfx_client_ops_t\r
812  *\r
813  * The graphics metalanguage entry points (client side)\r
814  */\r
815 typedef const struct {\r
816     udi_channel_event_ind_op_t          *channel_event_ind_op;\r
817     udi_gfx_bind_ack_op_t               *gfx_bind_ack_op;\r
818     udi_gfx_unbind_ack_op_t             *gfx_unbind_ack_op;\r
819     udi_gfx_set_connector_ack_op_t      *gfx_set_connector_ack_op;\r
820     udi_gfx_set_engine_ack_op_t         *gfx_set_engine_ack_op;\r
821     udi_gfx_set_connector_nak_op_t      *gfx_set_connector_nak_op;\r
822     udi_gfx_set_engine_nak_op_t         *gfx_set_engine_nak_op;\r
823     udi_gfx_get_connector_ack_op_t      *gfx_get_connector_ack_op;\r
824     udi_gfx_get_engine_ack_op_t         *gfx_get_engine_ack_op;\r
825     udi_gfx_range_connector_ack_op_t    *gfx_range_connector_ack_op;\r
826     udi_gfx_range_engine_ack_op_t       *gfx_range_engine_ack_op;\r
827     udi_gfx_get_engine_operator_req_op_t*gfx_get_engine_operator_ack_op;\r
828     udi_gfx_connector_command_ack_op_t  *gfx_connector_command_ack_op;\r
829     udi_gfx_engine_command_ack_op_t     *gfx_engine_command_ack_op;\r
830     udi_gfx_buffer_info_ack_op_t        *gfx_buffer_info_ack_op;\r
831     udi_gfx_buffer_read_ack_op_t        *gfx_buffer_read_ack_op;\r
832     udi_gfx_buffer_write_ack_op_t       *gfx_buffer_write_ack_op;\r
833     udi_gfx_buffer_read_nak_op_t        *gfx_buffer_read_nak_op;\r
834     udi_gfx_buffer_write_nak_op_t       *gfx_buffer_write_nak_op;\r
835 } udi_gfx_client_ops_t;\r
836 \r
837 \r
838 // temporary\r
839 #ifndef UDI_ANNOY_ME\r
840 void EngineReturnSimpleRange (int source, int index, int prop, int first, int last, int modulus);\r
841 void ConnectorReturnSimpleRange (int source, int index, int prop, int first, int last, int modulus);\r
842 void EngineReturnConstantRange (int source, int index, int prop, int value);\r
843 void ConnectorReturnConstantRange (int source, int index, int prop, int value);\r
844 void EngineReturnBooleanRange (int source, int index, int prop, int value1, int value2);\r
845 void ConnectorReturnBooleanRange (int source, int index, int prop, int value1, int value2);\r
846 #endif\r
847 \r
848 #endif\r

UCC git Repository :: git.ucc.asn.au