X-Git-Url: https://git.ucc.asn.au/?p=tpg%2Facess2.git;a=blobdiff_plain;f=KernelLand%2FModules%2FInterfaces%2FUDI%2Ftrans%2Fgfx.udic;fp=KernelLand%2FModules%2FInterfaces%2FUDI%2Ftrans%2Fgfx.udic;h=d61579d484c292703180e24bbdaa63d557f9a0ea;hp=0000000000000000000000000000000000000000;hb=845b6f9d90bb87b5e760e4d49aa93b0e003ab750;hpb=67a7fe2bb79eceaf10c572a99bd8345c4e81cf5b diff --git a/KernelLand/Modules/Interfaces/UDI/trans/gfx.udic b/KernelLand/Modules/Interfaces/UDI/trans/gfx.udic new file mode 100644 index 00000000..d61579d4 --- /dev/null +++ b/KernelLand/Modules/Interfaces/UDI/trans/gfx.udic @@ -0,0 +1,78 @@ +/* + * Acess2 UDI Layer + * - By John Hodge (thePowersGang) + * + * trans/gfx.c + * - Graphics interface + */ +#define DEBUG 1 +#define UDI_VERSION 0x101 +#define UDI_GFX_VERSION 0x101 +#include +#include +#include +#include + +// === TYPES === +typedef struct rdata_s +{ + +} rdata_t; + +// === CODE === +void usage_ind(udi_usage_cb_t *cb, udi_ubit8_t resource_level) +{ + // Set up structures that don't need interegating the card to do + +} + +@1=GFX_CLIENT channel_event_ind(udi_channel_event_cb_t *cb) +{ + udi_gfx_bind_cb_t *bind_cb = cb->params.parent_bound.bind_cb; + switch(cb->event) + { + case UDI_CHANNEL_CLOSED: + return; + case UDI_CHANNEL_BOUND: + [sockets, engines, status] = udi_gfx_bind_req(bind_cb); + if( status != UDI_OK ) { + return; + } + // allocate a CB + [new_cb] = udi_cb_alloc(bind_cb, ACESSGFX_CB_STATE); + udi_gfx_state_cb_t *state_cb = new_cb; + for( int i = 0; i < engines; i ++ ) + { + state_cb->subsystem = i; + state_cb->attribute = UDI_GFX_PROP_PIXELFORMAT; + [pixfmt] = @TRY_NAK[status] udi_gfx_get_engine_req(state_cb) + { + // Shit to do if NAK happens + return ; + // break PIXFMT_NONE; + } + + // TODO: Annotate udi_gfx_state_cb_t to note values are kept? + state_cb->subsystem = i; + state_cb->attribute = UDI_GFX_PROP_OPERATOR_INDEX; + [count] = udi_gfx_get_engine_req(state_cb); + for( int j = 0; j < count; j ++ ) + { + state_cb->attribute = j; + [operator, arg_1, arg_2, arg_3] = udi_gfx_engine_getop_req(state_cb); + Log_Debug("UDIGFX", "%i/%i: %i 0x%x 0x%x 0x%x", + i, j, + operator, arg_1, arg_2, arg_3); + } + } + return; + default: + // TODO: emit an error of some form? + return; + } +} + +// === UDI Bindings === + + +// vim: ft=c