From: John Hodge Date: Sat, 21 Jun 2014 15:55:15 +0000 (+0800) Subject: UDI - Tweaks to bochsga driver X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=b89845fd0e4bde75a360e66bb6bd51b062039d60;p=tpg%2Facess2.git UDI - Tweaks to bochsga driver --- diff --git a/UDI/Tools/udibuild.ini b/UDI/Tools/udibuild.ini index 1c5739cf..c5187fac 100644 --- a/UDI/Tools/udibuild.ini +++ b/UDI/Tools/udibuild.ini @@ -1,7 +1,8 @@ [COMMON] [ia32] -CFLAGS=-ffreestanding -I/home/tpg/Projects/GitClones/acess2/UDI/include/ -Wall -Wextra -Wno-unused-parameter -std=c99 -pedantic +CFLAGS=-ffreestanding -I/home/tpg/Projects/GitClones/acess2/UDI/include/ -Wall -Wextra -Wno-unused-parameter +# -std=c89 # -Wc++-compat CC=i586-elf-gcc LD=i586-elf-ld diff --git a/UDI/drivers/gfx_bochs/bochsga_common.h b/UDI/drivers/gfx_bochs/bochsga_common.h index b956900c..3b3a5db8 100644 --- a/UDI/drivers/gfx_bochs/bochsga_common.h +++ b/UDI/drivers/gfx_bochs/bochsga_common.h @@ -30,14 +30,15 @@ */ #include "bochsga_pio.h" -#include "bochsga_engines.h" typedef struct { udi_ubit32_t width; udi_ubit32_t height; - udi_index_t op_idx; + udi_index_t bitdepth; } engine_t; +#define N_ENGINES 1 + /** * Region data */ diff --git a/UDI/drivers/gfx_bochs/bochsga_core.c b/UDI/drivers/gfx_bochs/bochsga_core.c index 82c3e7a2..8f6dae8d 100644 --- a/UDI/drivers/gfx_bochs/bochsga_core.c +++ b/UDI/drivers/gfx_bochs/bochsga_core.c @@ -8,28 +8,30 @@ #define UDI_VERSION 0x101 #define UDI_PHYSIO_VERSION 0x101 #define UDI_GFX_VERSION 0x101 +#define UDI_PCI_VERSION 0x101 #include #include #include +#include #define DEBUG_ENABLED 1 #include "../helpers.h" #include "../helpers_gfx.h" #include "bochsga_common.h" -// --- Management Metalang +/* --- Management Metalang -- */ void bochsga_usage_ind(udi_usage_cb_t *cb, udi_ubit8_t resource_level) { - rdata_t *rdata = UDI_GCB(cb)->context; - //udi_trace_write(rdata->init_context, UDI_TREVENT_LOCAL_PROC_ENTRY, 0, ); + //rdata_t *rdata = UDI_GCB(cb)->context; + /*udi_trace_write(rdata->init_context, UDI_TREVENT_LOCAL_PROC_ENTRY, 0, );*/ - // TODO: Set up region data + /* TODO: Set up region data */ udi_usage_res(cb); } void bochsga_enumerate_req(udi_enumerate_cb_t *cb, udi_ubit8_t enumeration_level) { - rdata_t *rdata = UDI_GCB(cb)->context; + //rdata_t *rdata = UDI_GCB(cb)->context; udi_instance_attr_list_t *attr_list = cb->attr_list; switch(enumeration_level) @@ -50,7 +52,7 @@ void bochsga_devmgmt_req(udi_mgmt_cb_t *cb, udi_ubit8_t mgmt_op, udi_ubit8_t par void bochsga_final_cleanup_req(udi_mgmt_cb_t *cb) { } -// --- +/* --- */ void bochsga_bus_dev_channel_event_ind(udi_channel_event_cb_t *cb); void bochsga_bus_dev_bus_bind_ack(udi_bus_bind_cb_t *cb, udi_dma_constraints_t dma_constraints, udi_ubit8_t perferred_endianness, udi_status_t status); void bochsga_bus_dev_bind__pio_map(udi_cb_t *cb, udi_pio_handle_t new_pio_handle); @@ -80,15 +82,15 @@ void bochsga_bus_dev_bus_bind_ack(udi_bus_bind_cb_t *cb, udi_cb_t *gcb = UDI_GCB(cb); rdata_t *rdata = gcb->context; - // Set up PIO handles + /* Set up PIO handles */ rdata->init.pio_index = -1; bochsga_bus_dev_bind__pio_map(gcb, UDI_NULL_PIO_HANDLE); - // V V V V + /* V V V V */ } void bochsga_bus_dev_bind__pio_map(udi_cb_t *gcb, udi_pio_handle_t new_pio_handle) { rdata_t *rdata = gcb->context; - if( rdata->init.pio_index != -1 ) + if( rdata->init.pio_index != (udi_index_t)-1 ) { rdata->pio_handles[rdata->init.pio_index] = new_pio_handle; } @@ -117,19 +119,19 @@ void bochsga_bus_dev_intr_attach_ack(udi_intr_attach_cb_t *intr_attach_cb, udi_s void bochsga_bus_dev_intr_detach_ack(udi_intr_detach_cb_t *intr_detach_cb) { } -// --- -// GFX Provider ops + +/* --- GFX Provider ops -- */ void bochsga_gfx_channel_event_ind(udi_channel_event_cb_t *cb) { - // No operation + /* No operation */ } void bochsga_gfx_bind_req(udi_gfx_bind_cb_t *cb) { - // TODO: ACK bind if nothing already bound + /* TODO: ACK bind if nothing already bound */ } void bochsga_gfx_unbind_req(udi_gfx_bind_cb_t *cb) { - // TODO: Release internal state? + /* TODO: Release internal state? */ } void bochsga_gfx_set_connector_req$pio(udi_cb_t *gcb, udi_buf_t *new_buf, udi_status_t status, udi_ubit16_t result) { @@ -153,27 +155,14 @@ void bochsga_gfx_set_connector_req(udi_gfx_state_cb_t *cb, udi_ubit32_t value) } udi_gfx_set_connector_ack(cb); return; - // Change input engine - // - + /* Change input engine */ case UDI_GFX_PROP_INPUT: - if( rdata->outputstate.engine != value ) - { - // Validate - if( !(0 <= value && value <= N_ENGINES) ) { - udi_gfx_set_connector_ack(cb /*, UDI_STAT_NOT_SUPPORTED*/); - return ; - } - - // Change saved bitdepth (requires cycling enable) - rdata->outputstate.engine = value; - rdata->outputstate.bitdepth = bochsga_engine_defs[value].bitdepth; - } udi_gfx_set_connector_ack(cb); return; - // Alter output dimensions + /* Alter output dimensions */ case UDI_GFX_PROP_WIDTH: if( value % 8 != 0 ) { - // Qemu doesn't like resolutions not a multiple of 8 + /* Qemu doesn't like resolutions not a multiple of 8 */ return ; } if( !(320 <= value && value <= rdata->limits.max_width) ) { @@ -210,7 +199,7 @@ void bochsga_gfx_get_connector_req(udi_gfx_state_cb_t *cb) udi_gfx_get_connector_ack(cb, !!rdata->output_enable); return; case UDI_GFX_PROP_INPUT: - udi_gfx_get_connector_ack(cb, rdata->outputstate.bitdepth/8-1); + udi_gfx_get_connector_ack(cb, 0); return; case UDI_GFX_PROP_WIDTH: udi_gfx_get_connector_ack(cb, rdata->outputstate.width); @@ -240,20 +229,22 @@ void bochsga_gfx_range_connector_req(udi_gfx_range_cb_t *cb) switch(cb->attribute) { case UDI_GFX_PROP_ENABLE: - // 2 values: 0 and 1 + /* 2 values: 0 and 1 */ gfxhelpers_return_range_set(udi_gfx_range_connector_ack, cb, 2, 0, 1); return; case UDI_GFX_PROP_INPUT: - // 0--3 with a step of 1 - gfxhelpers_return_range_simple(udi_gfx_range_connector_ack, cb, 0, 3, 1); + /* Fix 0 */ + gfxhelpers_return_range_fixed(udi_gfx_range_connector_ack, cb, 0); return; case UDI_GFX_PROP_WIDTH: + /* qemu restricts to 8 step */ gfxhelpers_return_range_simple(udi_gfx_range_connector_ack, cb, - BOCHSGA_MIN_WIDTH, rdata->limits.max_width, 8); // qemu restricts to 8 step + BOCHSGA_MIN_WIDTH, rdata->limits.max_width, 8); return; case UDI_GFX_PROP_HEIGHT: + /* step of 8 for neatness */ gfxhelpers_return_range_simple(udi_gfx_range_connector_ack, cb, - BOCHSGA_MIN_HEIGHT, rdata->limits.max_height, 8); // step of 8 for neatness + BOCHSGA_MIN_HEIGHT, rdata->limits.max_height, 8); return; case UDI_GFX_PROP_CONNECTOR_TYPE: gfxhelpers_return_range_fixed(udi_gfx_range_connector_ack, cb, UDI_GFX_CONNECTOR_HIDDEN); @@ -269,7 +260,8 @@ void bochsga_gfx_range_connector_req(udi_gfx_range_cb_t *cb) udi_gfx_range_cb_t *cb = UDI_MCB(cb, udi_gfx_range_cb_t); udi_gfx_range_connector_ack(cb); } -// --- Engine Manipulation --- + +/* --- Engine Manipulation --- */ void bochsga_gfx_set_engine_req(udi_gfx_state_cb_t *cb, udi_ubit32_t value) { udi_cb_t *gcb = UDI_GCB(cb); @@ -292,15 +284,6 @@ void bochsga_gfx_set_engine_req(udi_gfx_state_cb_t *cb, udi_ubit32_t value) engine->height = value; udi_gfx_set_engine_ack(cb); return; - case UDI_GFX_PROP_OPERATOR_INDEX: - if( value >= bochsga_engine_defs[cb->subsystem].op_map.op_count ) { - // Bad value - udi_gfx_set_engine_ack(cb); - return; - } - engine->op_idx = value; - udi_gfx_set_engine_ack(cb); - return; } CONTIN(bochsga_gfx_set_engine_req, udi_log_write, (UDI_TREVENT_LOG, UDI_LOG_INFORMATION, BOCHSGA_OPS_GFX, 0, BOCHSGA_MSGNUM_PROPUNK, __func__, cb->attribute), @@ -320,7 +303,6 @@ void bochsga_gfx_get_engine_req(udi_gfx_state_cb_t *cb) } const engine_t *engine = &rdata->engines[cb->subsystem]; - const engine_static_t *engine_def = &bochsga_engine_defs[cb->subsystem]; switch(cb->attribute) { @@ -339,14 +321,8 @@ void bochsga_gfx_get_engine_req(udi_gfx_state_cb_t *cb) udi_gfx_get_engine_ack(cb, engine->height); return; - case UDI_GFX_PROP_OPERATOR_INDEX: - udi_gfx_get_engine_ack(cb, engine->op_idx); - return; - case UDI_GFX_PROP_OPERATOR_OPCODE: - case UDI_GFX_PROP_OPERATOR_ARG_1: - case UDI_GFX_PROP_OPERATOR_ARG_2: - case UDI_GFX_PROP_OPERATOR_ARG_3: - udi_gfx_get_engine_ack(cb, gfxhelpers_get_engine_op(&engine_def->op_map, engine->op_idx, cb->attribute)); + case UDI_GFX_PROP_STOCK_FORMAT: + udi_gfx_get_engine_ack(cb, UDI_GFX_STOCK_FORMAT_R8G8B8); return; } CONTIN(bochsga_gfx_get_engine_req, udi_log_write, @@ -360,14 +336,14 @@ void bochsga_gfx_range_engine_req(udi_gfx_range_cb_t *cb) { udi_cb_t *gcb = UDI_GCB(cb); rdata_t *rdata = gcb->context; + (void)rdata; if( cb->subsystem >= N_ENGINES ) { udi_gfx_range_engine_ack(cb); return; } - engine_t *engine = &rdata->engines[cb->subsystem]; - const engine_static_t *engine_def = &bochsga_engine_defs[cb->subsystem]; + //engine_t *engine = &rdata->engines[cb->subsystem]; switch(cb->attribute) { @@ -378,15 +354,8 @@ void bochsga_gfx_range_engine_req(udi_gfx_range_cb_t *cb) gfxhelpers_return_range_fixed(udi_gfx_range_engine_ack, cb, -1); return; - case UDI_GFX_PROP_OPERATOR_INDEX: - gfxhelpers_return_range_simple(udi_gfx_range_engine_ack, cb, 0, engine->op_idx-1, 1); - return; - case UDI_GFX_PROP_OPERATOR_OPCODE: - case UDI_GFX_PROP_OPERATOR_ARG_1: - case UDI_GFX_PROP_OPERATOR_ARG_2: - case UDI_GFX_PROP_OPERATOR_ARG_3: - gfxhelpers_return_range_fixed(udi_gfx_range_engine_ack, cb, - gfxhelpers_get_engine_op(&engine_def->op_map, engine->op_idx, cb->attribute)); + case UDI_GFX_PROP_STOCK_FORMAT: + gfxhelpers_return_range_fixed(udi_gfx_range_engine_ack, cb, UDI_GFX_STOCK_FORMAT_B8G8R8); return; } CONTIN(bochsga_gfx_range_engine_req, udi_log_write, @@ -396,13 +365,50 @@ void bochsga_gfx_range_engine_req(udi_gfx_range_cb_t *cb) udi_gfx_range_cb_t *cb = UDI_MCB(cb, udi_gfx_range_cb_t); udi_gfx_range_engine_ack( cb ); } -void bochsga_gfx_command_req(udi_gfx_command_cb_t *cb) +void bochsga_gfx_get_engine_operator_req(udi_gfx_range_cb_t *cb) +{ + /* TODO: Get Engine operator */ + udi_gfx_get_engine_operator_ack(cb, 0, 0,0,0); +} +void bochsga_gfx_connector_command_req(udi_gfx_command_cb_t *cb) +{ + /* Need to parse the GLX stream */ + udi_gfx_connector_command_ack(cb); +} +void bochsga_gfx_engine_command_req(udi_gfx_command_cb_t *cb) +{ + /* Need to parse the GLX stream */ + udi_gfx_engine_command_ack(cb); +} +void bochsga_gfx_buffer_info_req(udi_gfx_buffer_info_cb_t *cb) +{ + switch(cb->buffer_index) + { + case 0: + udi_gfx_buffer_info_ack(cb, 1024, 768, 24, 0); + return; + default: + break; + } + CONTIN(bochsga_gfx_buffer_info_req, udi_log_write, + (UDI_TREVENT_LOG, UDI_LOG_INFORMATION, BOCHSGA_OPS_GFX, 0, BOCHSGA_MSGNUM_BUFUNK, __func__, cb->buffer_index), + (udi_status_t status) + ); + udi_gfx_buffer_info_cb_t *cb = UDI_MCB(gcb, udi_gfx_buffer_info_cb_t); + udi_gfx_buffer_info_ack(cb, 0,0,0,0); +} +void bochsga_gfx_buffer_write_req(udi_gfx_buffer_cb_t *cb) +{ +} +void bochsga_gfx_buffer_read_req(udi_gfx_buffer_cb_t *cb) { - // Need to parse the GLX stream } -// ==================================================================== -// - Management ops +/* +==================================================================== +Management ops +==================================================================== +*/ udi_mgmt_ops_t bochsga_mgmt_ops = { bochsga_usage_ind, bochsga_enumerate_req, @@ -410,7 +416,7 @@ udi_mgmt_ops_t bochsga_mgmt_ops = { bochsga_final_cleanup_req }; udi_ubit8_t bochsga_mgmt_op_flags[4] = {0,0,0,0}; -// - Bus Ops +/* - Bus Ops */ udi_bus_device_ops_t bochsga_bus_dev_ops = { bochsga_bus_dev_channel_event_ind, bochsga_bus_dev_bus_bind_ack, @@ -419,7 +425,7 @@ udi_bus_device_ops_t bochsga_bus_dev_ops = { bochsga_bus_dev_intr_detach_ack }; udi_ubit8_t bochsga_bus_dev_ops_flags[5] = {0}; -// - GFX provider ops +/* - GFX provider ops */ udi_gfx_provider_ops_t bochsga_gfx_ops = { bochsga_gfx_channel_event_ind, bochsga_gfx_bind_req, @@ -430,10 +436,15 @@ udi_gfx_provider_ops_t bochsga_gfx_ops = { bochsga_gfx_get_engine_req, bochsga_gfx_range_connector_req, bochsga_gfx_range_engine_req, - bochsga_gfx_command_req + bochsga_gfx_get_engine_operator_req, + bochsga_gfx_connector_command_req, + bochsga_gfx_engine_command_req, + bochsga_gfx_buffer_info_req, + bochsga_gfx_buffer_read_req, + bochsga_gfx_buffer_write_req, }; udi_ubit8_t bochsga_gfx_ops_flags[10] = {0}; -// -- +/* -- */ udi_primary_init_t bochsga_pri_init = { .mgmt_ops = &bochsga_mgmt_ops, .mgmt_op_flags = bochsga_mgmt_op_flags, diff --git a/UDI/drivers/gfx_bochs/bochsga_engines.h b/UDI/drivers/gfx_bochs/bochsga_engines.h index 48323d28..272f0be7 100644 --- a/UDI/drivers/gfx_bochs/bochsga_engines.h +++ b/UDI/drivers/gfx_bochs/bochsga_engines.h @@ -4,20 +4,20 @@ #define BOCHSGA_ENGINE_PROP_BUFFER (UDI_GFX_PROP_CUSTOM+0) -// === CONSTANTS === +/* === CONSTANTS === */ const gfxhelpers_op_t bochsga_engine_ops_8bpp[] = { }; const gfxhelpers_op_t bochsga_engine_ops_32bpp[] = { - {UDI_GFX_OPERATOR_RGB, 1, 2, 3}, // #0 Output RGB from ops #1,#2,#3 - {UDI_GFX_OPERATOR_SEG, 4, 16, 8}, // #1 Extract 8 bits from bit 16 of #4 - {UDI_GFX_OPERATOR_SEG, 4, 8, 8}, // #2 8 bits from ofs 8 of #4 - {UDI_GFX_OPERATOR_SEG, 4, 0, 8}, // #3 8 bits from ofs 0 of #4 - {UDI_GFX_OPERATOR_BUFFER, 5, 6, 32}, // #4 32 bits from buffer #5 ofs #6 - {UDI_GFX_OPERATOR_ATTR, 0, BOCHSGA_ENGINE_PROP_BUFFER, 0}, // #5 Buffer index - {UDI_GFX_OPERATOR_MAD, 7, 8, 9}, // #6 Get offset (#8 * #7 + #9) - {UDI_GFX_OPERATOR_ATTR, 0, UDI_GFX_PROP_SOURCE_WIDTH, 0}, // #7 Read buffer width - {UDI_GFX_OPERATOR_Y, 0, 0, 0}, // #8 Y coordinate - {UDI_GFX_OPERATOR_X, 0, 0, 0} // #9 X coordinate + {UDI_GFX_OPERATOR_RGB, 1, 2, 3}, /* #0 Output RGB from ops #1,#2,#3 */ + {UDI_GFX_OPERATOR_SEG, 4, 16, 8}, /* #1 Extract 8 bits from bit 16 of #4 */ + {UDI_GFX_OPERATOR_SEG, 4, 8, 8}, /* #2 8 bits from ofs 8 of #4 */ + {UDI_GFX_OPERATOR_SEG, 4, 0, 8}, /* #3 8 bits from ofs 0 of #4 */ + {UDI_GFX_OPERATOR_BUFFER, 5, 6, 32}, /* #4 32 bits from buffer #5 ofs #6 */ + {UDI_GFX_OPERATOR_ATTR, 0, BOCHSGA_ENGINE_PROP_BUFFER, 0}, /* #5 Buffer index */ + {UDI_GFX_OPERATOR_MAD, 7, 8, 9}, /* #6 Get offset (#8 * #7 + #9) */ + {UDI_GFX_OPERATOR_ATTR, 0, UDI_GFX_PROP_SOURCE_WIDTH, 0}, /* #7 Read buffer width */ + {UDI_GFX_OPERATOR_Y, 0, 0, 0}, /* #8 Y coordinate */ + {UDI_GFX_OPERATOR_X, 0, 0, 0} /* #9 X coordinate */ }; typedef struct { diff --git a/UDI/drivers/helpers.h b/UDI/drivers/helpers.h index 9b827b3d..134cb8e5 100644 --- a/UDI/drivers/helpers.h +++ b/UDI/drivers/helpers.h @@ -19,7 +19,8 @@ #define CONTIN(suffix, call, args, params) extern void _EXPJOIN(suffix##$,__LINE__) _ADDGCB params;\ call( _EXPJOIN(suffix##$,__LINE__), gcb, _EXPLODE args); } \ void _EXPJOIN(suffix##$,__LINE__) _ADDGCB params { \ - rdata_t *rdata = gcb->context; + rdata_t *rdata = gcb->context; \ + (void)rdata; /* Copied from http://projectudi.cvs.sourceforge.net/viewvc/projectudi/udiref/driver/udi_dpt/udi_dpt.h */ #define UDIH_SET_ATTR_BOOLEAN(attr, name, val) \ diff --git a/UDI/drivers/helpers_gfx.h b/UDI/drivers/helpers_gfx.h index f4d9bcff..999a4082 100644 --- a/UDI/drivers/helpers_gfx.h +++ b/UDI/drivers/helpers_gfx.h @@ -6,6 +6,10 @@ #ifndef _HELPERS_GFX_H_ #define _HELPERS_GFX_H_ +#if __STDC_VERSION__ < 199901L +# define inline +#endif + typedef struct { udi_index_t op; udi_ubit32_t arg_1; @@ -18,22 +22,6 @@ typedef struct { const gfxhelpers_op_t *ops; } gfxhelpers_op_map_t; -static inline udi_ubit32_t gfxhelpers_get_engine_op( - const gfxhelpers_op_map_t *map, udi_index_t index, udi_index_t prop - ) -{ - if( index >= map->op_count ) { - return 0; - } - switch(prop) { - case UDI_GFX_PROP_OPERATOR_OPCODE: return map->ops[index].op; - case UDI_GFX_PROP_OPERATOR_ARG_1: return map->ops[index].arg_1; - case UDI_GFX_PROP_OPERATOR_ARG_2: return map->ops[index].arg_2; - case UDI_GFX_PROP_OPERATOR_ARG_3: return map->ops[index].arg_3; - } - return 0; -} - static inline void gfxhelpers_return_range_simple( udi_gfx_range_connector_ack_op_t *callback, udi_gfx_range_cb_t *cb, udi_ubit32_t min, udi_ubit32_t max, udi_ubit32_t step diff --git a/UDI/include/udi_gfx.h b/UDI/include/udi_gfx.h index 23da6fa9..4416fc92 100644 --- a/UDI/include/udi_gfx.h +++ b/UDI/include/udi_gfx.h @@ -12,7 +12,7 @@ * http://www.d-rift.nl/combuster/mos3/?p=viewsource&file=/include/common/udi_gfx.h */ -// note that the specification, and thus, the contents of this file is not fixed. +/* note that the specification, and thus, the contents of this file is not fixed. */ #ifndef __UDI_GFX_H__ #define __UDI_GFX_H__ @@ -30,7 +30,6 @@ * Lists the various UDI properties */ -// General state properties /* Constant: UDI_GFX_PROP_ENABLE * * Valid values: @@ -130,7 +129,7 @@ */ #define UDI_GFX_PROP_CUSTOM 1024 -// engine properties +/* engine properties */ /* Constant: UDI_GFX_PROP_CLIP * @@ -272,7 +271,8 @@ */ #define UDI_GFX_PROP_OPERATOR_COUNT 28 -// properties for removal: +#if 0 +/* properties for removal: */ #define UDI_GFX_PROP_STORE_COUNT 24 // not generic #define UDI_GFX_PROP_STORE_WIDTH 9 // not generic #define UDI_GFX_PROP_STORE_HEIGHT 10 // not generic @@ -289,8 +289,9 @@ #define UDI_GFX_PROP_SOURCE_HEIGHT 13 // should have been documented when I still knew what it did. #define UDI_GFX_PROP_INPUTX 25 // should have been documented when I still knew what it did. #define UDI_GFX_PROP_INPUTY 26 // should have been documented when I still knew what it did. +#endif -// connector properties +/* connector properties */ #define UDI_GFX_PROP_SIGNAL 23 #define UDI_GFX_PROP_CONNECTOR_TYPE 24 #define UDI_GFX_PROP_VGA_H_FRONT_PORCH 25 @@ -344,42 +345,42 @@ * a1/a2/a3 represents taking the output of a previous operation * v1/v2/v3 represents the literal value of that argument */ -#define UDI_GFX_OPERATOR_RGB 0 // output = (color) red(a1) + green(a2) + blue(a3) (each component is UDI_GFX_PROP_COLOR_BITS -#define UDI_GFX_OPERATOR_YUV 1 // output = (color) Y(a1) + U(a2) + V(a3) -#define UDI_GFX_OPERATOR_YIQ 2 // output = (color) Y(a1) + I(a2) + Q(a3) -#define UDI_GFX_OPERATOR_I 3 // output = (color) intensity(a1) -#define UDI_GFX_OPERATOR_ALPHA 4 // output = (color) a1 + alpha(a2) -#define UDI_GFX_OPERATOR_ADD 5 // output = a1 + a2 + v3 -#define UDI_GFX_OPERATOR_SUB 6 // output = a1 - a2 - v3 -#define UDI_GFX_OPERATOR_MUL 7 // output = a1 * a2 -#define UDI_GFX_OPERATOR_DIV 8 // output = a1 / a2 -#define UDI_GFX_OPERATOR_MAD 9 // output = a1 * a2 + a3 -#define UDI_GFX_OPERATOR_FRC 10 // output = (a1 * a2) / a3 -#define UDI_GFX_OPERATOR_SHR 11 // output = a1 >> (a2 + v3) -#define UDI_GFX_OPERATOR_SHL 12 // output = a1 << (a2 + v3) -#define UDI_GFX_OPERATOR_ROR 13 // output = a1 >> a2 (over a3 bits) -#define UDI_GFX_OPERATOR_ROL 14 // output = a1 << a2 (over a3 bits) -#define UDI_GFX_OPERATOR_SAR 15 // output = a1 >> a2 (width is a3 bits, i.e. empties are filled with bit a3-1) -#define UDI_GFX_OPERATOR_SAL 16 // output = a1 <<< (a2 + v3) (empties filled with bit 0) -#define UDI_GFX_OPERATOR_AND 17 // output = a1 & a2 -#define UDI_GFX_OPERATOR_OR 18 // output = a1 | a2 | v3 -#define UDI_GFX_OPERATOR_NOT 19 // output = ~a1 -#define UDI_GFX_OPERATOR_XOR 20 // output = a1 ^ a2 ^ v3 -#define UDI_GFX_OPERATOR_NEG 21 // output = -a1 -#define UDI_GFX_OPERATOR_SEG 22 // output = (a1 >> v2) & (2**v3-1) (select v3 bits starting from bit v2) -#define UDI_GFX_OPERATOR_RANGE 23 // output = (a1 > a2) ? a2 : ((a1 < a3) ? a3 : a1) -#define UDI_GFX_OPERATOR_CONST 24 // output = v1 -#define UDI_GFX_OPERATOR_ATTR 25 // output = property[a1 + v2] -#define UDI_GFX_OPERATOR_SWITCH 26 // output = output[(a1 % v3) + v2] -#define UDI_GFX_OPERATOR_BUFFER 27 // output = buffer[a1][a2] (buffer is v3 bits per entry) -#define UDI_GFX_OPERATOR_X 28 // output = output x pixel -#define UDI_GFX_OPERATOR_Y 29 // output = output y pixel -#define UDI_GFX_OPERATOR_TX 30 // output = horizontal tile index belonging to output pixel -#define UDI_GFX_OPERATOR_TY 31 // output = vertical tile index belonging to output pixel -#define UDI_GFX_OPERATOR_TXOFF 32 // output = horizontal offset from start of tile -#define UDI_GFX_OPERATOR_TYOFF 33 // output = vertical offset from start of tile -#define UDI_GFX_OPERATOR_INPUT 34 // output = input engine[x][y] component v1 -#define UDI_GFX_OPERATOR_DINPUT 35 // output = input engine[a1][a2] component v3 +#define UDI_GFX_OPERATOR_RGB 0 /* output = (color) red(a1) + green(a2) + blue(a3) (each component is UDI_GFX_PROP_COLOR_BITS*/ +#define UDI_GFX_OPERATOR_YUV 1 /* output = (color) Y(a1) + U(a2) + V(a3)*/ +#define UDI_GFX_OPERATOR_YIQ 2 /* output = (color) Y(a1) + I(a2) + Q(a3)*/ +#define UDI_GFX_OPERATOR_I 3 /* output = (color) intensity(a1)*/ +#define UDI_GFX_OPERATOR_ALPHA 4 /* output = (color) a1 + alpha(a2)*/ +#define UDI_GFX_OPERATOR_ADD 5 /* output = a1 + a2 + v3*/ +#define UDI_GFX_OPERATOR_SUB 6 /* output = a1 - a2 - v3*/ +#define UDI_GFX_OPERATOR_MUL 7 /* output = a1 * a2*/ +#define UDI_GFX_OPERATOR_DIV 8 /* output = a1 / a2*/ +#define UDI_GFX_OPERATOR_MAD 9 /* output = a1 * a2 + a3*/ +#define UDI_GFX_OPERATOR_FRC 10 /* output = (a1 * a2) / a3*/ +#define UDI_GFX_OPERATOR_SHR 11 /* output = a1 >> (a2 + v3)*/ +#define UDI_GFX_OPERATOR_SHL 12 /* output = a1 << (a2 + v3)*/ +#define UDI_GFX_OPERATOR_ROR 13 /* output = a1 >> a2 (over a3 bits)*/ +#define UDI_GFX_OPERATOR_ROL 14 /* output = a1 << a2 (over a3 bits)*/ +#define UDI_GFX_OPERATOR_SAR 15 /* output = a1 >> a2 (width is a3 bits, i.e. empties are filled with bit a3-1)*/ +#define UDI_GFX_OPERATOR_SAL 16 /* output = a1 <<< (a2 + v3) (empties filled with bit 0)*/ +#define UDI_GFX_OPERATOR_AND 17 /* output = a1 & a2*/ +#define UDI_GFX_OPERATOR_OR 18 /* output = a1 | a2 | v3*/ +#define UDI_GFX_OPERATOR_NOT 19 /* output = ~a1*/ +#define UDI_GFX_OPERATOR_XOR 20 /* output = a1 ^ a2 ^ v3*/ +#define UDI_GFX_OPERATOR_NEG 21 /* output = -a1*/ +#define UDI_GFX_OPERATOR_SEG 22 /* output = (a1 >> v2) & (2**v3-1) (select v3 bits starting from bit v2)*/ +#define UDI_GFX_OPERATOR_RANGE 23 /* output = (a1 > a2) ? a2 : ((a1 < a3) ? a3 : a1)*/ +#define UDI_GFX_OPERATOR_CONST 24 /* output = v1*/ +#define UDI_GFX_OPERATOR_ATTR 25 /* output = property[a1 + v2]*/ +#define UDI_GFX_OPERATOR_SWITCH 26 /* output = output[(a1 % v3) + v2]*/ +#define UDI_GFX_OPERATOR_BUFFER 27 /* output = buffer[a1][a2] (buffer is v3 bits per entry)*/ +#define UDI_GFX_OPERATOR_X 28 /* output = output x pixel*/ +#define UDI_GFX_OPERATOR_Y 29 /* output = output y pixel*/ +#define UDI_GFX_OPERATOR_TX 30 /* output = horizontal tile index belonging to output pixel*/ +#define UDI_GFX_OPERATOR_TY 31 /* output = vertical tile index belonging to output pixel*/ +#define UDI_GFX_OPERATOR_TXOFF 32 /* output = horizontal offset from start of tile*/ +#define UDI_GFX_OPERATOR_TYOFF 33 /* output = vertical offset from start of tile*/ +#define UDI_GFX_OPERATOR_INPUT 34 /* output = input engine[x][y] component v1*/ +#define UDI_GFX_OPERATOR_DINPUT 35 /* output = input engine[a1][a2] component v3*/ /* Enumeration: UDI_GFX_STOCK_FORMAT * Lists stock configurations @@ -401,13 +402,14 @@ #define UDI_GFX_STOCK_FORMAT_B5G5R5X1 8 #define UDI_GFX_STOCK_FORMAT_N8 9 -// Enumeration: UDI_GFX_BUFFER_INFO_FLAG -// Lists behavioural patterns for direct buffer accesses. -// -#define UDI_GFX_BUFFER_INFO_FLAG_R 0x0001 // buffer can be read -#define UDI_GFX_BUFFER_INFO_FLAG_W 0x0002 // buffer can be written -#define UDI_GFX_BUFFER_INFO_FLAG_BITALIGN_ENTRY 0x0004 // for non-multiple-of-eight buffer slot sizes, align on byte boundary every unit -#define UDI_GFX_BUFFER_INFO_FLAG_BITALIGN_ROW 0x0008 // for non-multiple-of-eight buffer slot sizes, align only the start of the row +/* + * Enumeration: UDI_GFX_BUFFER_INFO_FLAG + * Lists behavioural patterns for direct buffer accesses. + */ +#define UDI_GFX_BUFFER_INFO_FLAG_R 0x0001 /* buffer can be read*/ +#define UDI_GFX_BUFFER_INFO_FLAG_W 0x0002 /* buffer can be written*/ +#define UDI_GFX_BUFFER_INFO_FLAG_BITALIGN_ENTRY 0x0004 /* for non-multiple-of-eight buffer slot sizes, align on byte boundary every unit*/ +#define UDI_GFX_BUFFER_INFO_FLAG_BITALIGN_ROW 0x0008 /* for non-multiple-of-eight buffer slot sizes, align only the start of the row*/ // Constant: UDI_GFX_PROVIDER_OPS_NUM @@ -806,9 +808,9 @@ typedef const struct { udi_gfx_get_engine_operator_req_op_t*gfx_get_engine_operator_req_op_t; udi_gfx_connector_command_req_op_t *gfx_connector_command_op; udi_gfx_engine_command_req_op_t *gfx_engine_command_op; - udi_gfx_buffer_info_req_op_t *gfx_buffer_info_ack; - udi_gfx_buffer_read_req_op_t *gfx_buffer_read_ack; - udi_gfx_buffer_write_req_op_t *gfx_buffer_write_ack; + udi_gfx_buffer_info_req_op_t *gfx_buffer_info_req_op; + udi_gfx_buffer_read_req_op_t *gfx_buffer_read_req_op; + udi_gfx_buffer_write_req_op_t *gfx_buffer_write_req_op; } udi_gfx_provider_ops_t; /* Structure: udi_gfx_client_ops_t