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

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