void sh_css_sp_set_if_configs( const input_formatter_cfg_t *config_a, const input_formatter_cfg_t *config_b) { input_formatter_ID_t id; #if defined(IS_ISP_2300_SYSTEM) bool block[N_INPUT_FORMATTER_ID] = {false, false}; #elif defined(IS_ISP_2400_SYSTEM) bool block[N_INPUT_FORMATTER_ID] = {false, false, false}; #else #error "sh_css_sp_set_if_configs: ISP_SYSTEM must be one of \ {IS_ISP_2300_SYSTEM, IS_ISP_2400_SYSTEM}" #endif block[INPUT_FORMATTER0_ID] = config_a->block_no_reqs; if (config_b != NULL) block[INPUT_FORMATTER1_ID] = config_b->block_no_reqs; for (id = (input_formatter_ID_t)0; id < N_INPUT_FORMATTER_ID; id++) { input_formatter_rst(id); input_formatter_set_fifo_blocking_mode(id, block[id]); } sh_css_sp_group.config.input_formatter.config_a = *config_a; sh_css_sp_group.config.input_formatter.a_changed = true; if (config_b != NULL) { sh_css_sp_group.config.input_formatter.config_b = *config_b; sh_css_sp_group.config.input_formatter.b_changed = true; } return; }
/************************************************************ * Static functions ************************************************************/ static void ifmtr_set_if_blocking_mode( const input_formatter_cfg_t * const config_a, const input_formatter_cfg_t * const config_b) { int i; bool block[] = { false, false, false, false }; assert(N_INPUT_FORMATTER_ID <= (sizeof(block) / sizeof(block[0]))); #if !defined(IS_ISP_2400_SYSTEM) #error "ifmtr_set_if_blocking_mode: ISP_SYSTEM must be one of \ {IS_ISP_2400_SYSTEM}" #endif block[INPUT_FORMATTER0_ID] = (bool)config_a->block_no_reqs; if (NULL != config_b) block[INPUT_FORMATTER1_ID] = (bool)config_b->block_no_reqs; /* TODO: next could cause issues when streams are started after * eachother. */ /*IF should not be reconfigured/reset from host */ if (ifmtr_set_if_blocking_mode_reset) { ifmtr_set_if_blocking_mode_reset = false; for (i = 0; i < N_INPUT_FORMATTER_ID; i++) { input_formatter_ID_t id = (input_formatter_ID_t) i; input_formatter_rst(id); input_formatter_set_fifo_blocking_mode(id, block[id]); } } return; }
/* AM: this should fill the if_configs properly. */ void sh_css_sp_set_if_configs( const input_formatter_cfg_t *config_a, const input_formatter_cfg_t *config_b, const uint8_t if_config_index ) { int i; static bool reset = true; #if defined(IS_ISP_2300_SYSTEM) bool block[N_INPUT_FORMATTER_ID] = {false, false}; #elif defined(IS_ISP_2400_SYSTEM) bool block[N_INPUT_FORMATTER_ID] = {false, false, false}; #else #error "sh_css_sp_set_if_configs: ISP_SYSTEM must be one of \ {IS_ISP_2300_SYSTEM, IS_ISP_2400_SYSTEM}" #endif if (if_config_index == SH_CSS_IF_CONFIG_NOT_NEEDED) return; assert(if_config_index <= SH_CSS_MAX_IF_CONFIGS); block[INPUT_FORMATTER0_ID] = (bool)config_a->block_no_reqs; if (config_b != NULL) block[INPUT_FORMATTER1_ID] = (bool)config_b->block_no_reqs; /* TODO: next could cause issues when streams are started after eachother IF should not be reconfigured/reset from host */ if (reset) { reset = false; for (i = 0; i < N_INPUT_FORMATTER_ID; i++) { input_formatter_ID_t id = (input_formatter_ID_t)i; input_formatter_rst(id); input_formatter_set_fifo_blocking_mode(id, block[id]); } } sh_css_sp_group.config.input_formatter.set[if_config_index].config_a = *config_a; sh_css_sp_group.config.input_formatter.a_changed = true; if (config_b != NULL) { sh_css_sp_group.config.input_formatter.set[if_config_index].config_b = *config_b; sh_css_sp_group.config.input_formatter.b_changed = true; } return; }