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

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