mirror of
https://github.com/espressif/esp-idf.git
synced 2026-06-04 20:26:38 +03:00
fix(isp): Fix isp build error in single core
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -39,12 +39,12 @@ static esp_err_t s_isp_claim_ae_controller(isp_proc_handle_t isp_proc, isp_ae_ct
|
||||
assert(isp_proc && ae_ctlr);
|
||||
|
||||
esp_err_t ret = ESP_ERR_NOT_FOUND;
|
||||
portENTER_CRITICAL(&isp_proc->spinlock);
|
||||
esp_os_enter_critical(&isp_proc->spinlock);
|
||||
if (!isp_proc->ae_ctlr) {
|
||||
isp_proc->ae_ctlr = ae_ctlr;
|
||||
ret = ESP_OK;
|
||||
}
|
||||
portEXIT_CRITICAL(&isp_proc->spinlock);
|
||||
esp_os_exit_critical(&isp_proc->spinlock);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -52,9 +52,9 @@ static esp_err_t s_isp_claim_ae_controller(isp_proc_handle_t isp_proc, isp_ae_ct
|
||||
static void s_isp_declaim_ae_controller(isp_ae_ctlr_t ae_ctlr)
|
||||
{
|
||||
if (ae_ctlr && ae_ctlr->isp_proc) {
|
||||
portENTER_CRITICAL(&ae_ctlr->isp_proc->spinlock);
|
||||
esp_os_enter_critical(&ae_ctlr->isp_proc->spinlock);
|
||||
ae_ctlr->isp_proc->ae_ctlr = NULL;
|
||||
portEXIT_CRITICAL(&ae_ctlr->isp_proc->spinlock);
|
||||
esp_os_exit_critical(&ae_ctlr->isp_proc->spinlock);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -37,7 +37,7 @@ static esp_err_t s_isp_claim_af_controller(isp_proc_handle_t isp_proc, isp_af_ct
|
||||
assert(isp_proc && af_ctlr);
|
||||
|
||||
bool found = false;
|
||||
portENTER_CRITICAL(&isp_proc->spinlock);
|
||||
esp_os_enter_critical(&isp_proc->spinlock);
|
||||
for (int i = 0; i < SOC_ISP_AF_CTLR_NUMS; i++) {
|
||||
found = !isp_proc->af_ctlr[i];
|
||||
if (found) {
|
||||
@@ -47,7 +47,7 @@ static esp_err_t s_isp_claim_af_controller(isp_proc_handle_t isp_proc, isp_af_ct
|
||||
break;
|
||||
}
|
||||
}
|
||||
portEXIT_CRITICAL(&isp_proc->spinlock);
|
||||
esp_os_exit_critical(&isp_proc->spinlock);
|
||||
|
||||
if (!found) {
|
||||
return ESP_ERR_NOT_FOUND;
|
||||
@@ -59,9 +59,9 @@ static void s_isp_declaim_af_controller(isp_af_ctlr_t af_ctlr)
|
||||
{
|
||||
assert(af_ctlr && af_ctlr->isp_proc);
|
||||
|
||||
portENTER_CRITICAL(&af_ctlr->isp_proc->spinlock);
|
||||
esp_os_enter_critical(&af_ctlr->isp_proc->spinlock);
|
||||
af_ctlr->isp_proc->af_ctlr[af_ctlr->id] = NULL;
|
||||
portEXIT_CRITICAL(&af_ctlr->isp_proc->spinlock);
|
||||
esp_os_exit_critical(&af_ctlr->isp_proc->spinlock);
|
||||
}
|
||||
|
||||
static void s_isp_af_free_controller(isp_af_ctlr_t af_ctlr)
|
||||
|
||||
@@ -35,12 +35,12 @@ static esp_err_t s_isp_claim_awb_controller(isp_proc_handle_t isp_proc, isp_awb_
|
||||
assert(isp_proc && awb_ctlr);
|
||||
|
||||
esp_err_t ret = ESP_ERR_NOT_FOUND;
|
||||
portENTER_CRITICAL(&isp_proc->spinlock);
|
||||
esp_os_enter_critical(&isp_proc->spinlock);
|
||||
if (!isp_proc->awb_ctlr) {
|
||||
isp_proc->awb_ctlr = awb_ctlr;
|
||||
ret = ESP_OK;
|
||||
}
|
||||
portEXIT_CRITICAL(&isp_proc->spinlock);
|
||||
esp_os_exit_critical(&isp_proc->spinlock);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -48,9 +48,9 @@ static esp_err_t s_isp_claim_awb_controller(isp_proc_handle_t isp_proc, isp_awb_
|
||||
static void s_isp_declaim_awb_controller(isp_awb_ctlr_t awb_ctlr)
|
||||
{
|
||||
if (awb_ctlr && awb_ctlr->isp_proc) {
|
||||
portENTER_CRITICAL(&awb_ctlr->isp_proc->spinlock);
|
||||
esp_os_enter_critical(&awb_ctlr->isp_proc->spinlock);
|
||||
awb_ctlr->isp_proc->awb_ctlr = NULL;
|
||||
portEXIT_CRITICAL(&awb_ctlr->isp_proc->spinlock);
|
||||
esp_os_exit_critical(&awb_ctlr->isp_proc->spinlock);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,11 +34,11 @@ esp_err_t esp_isp_ccm_configure(isp_proc_handle_t proc, const esp_isp_ccm_config
|
||||
|
||||
bool ret = true;
|
||||
bool valid = false;
|
||||
portENTER_CRITICAL(&proc->spinlock);
|
||||
esp_os_enter_critical(&proc->spinlock);
|
||||
isp_ll_ccm_set_clk_ctrl_mode(proc->hal.hw, ISP_LL_PIPELINE_CLK_CTRL_AUTO);
|
||||
ret = isp_hal_ccm_set_matrix(&proc->hal, ccm_cfg->saturation, ccm_cfg->matrix);
|
||||
valid = isp_ll_shadow_update_ccm(proc->hal.hw);
|
||||
portEXIT_CRITICAL(&proc->spinlock);
|
||||
esp_os_exit_critical(&proc->spinlock);
|
||||
ESP_RETURN_ON_FALSE(ret, ESP_ERR_INVALID_ARG, TAG, "invalid argument: ccm matrix contain NaN or out of range");
|
||||
ESP_RETURN_ON_FALSE(valid, ESP_ERR_INVALID_STATE, TAG, "failed to update ccm shadow register");
|
||||
|
||||
@@ -51,9 +51,9 @@ esp_err_t esp_isp_ccm_enable(isp_proc_handle_t proc)
|
||||
isp_fsm_t expected_fsm = ISP_FSM_INIT;
|
||||
ESP_RETURN_ON_FALSE(atomic_compare_exchange_strong(&proc->ccm_fsm, &expected_fsm, ISP_FSM_ENABLE), ESP_ERR_INVALID_STATE, TAG, "ccm is enabled already");
|
||||
|
||||
portENTER_CRITICAL(&proc->spinlock);
|
||||
esp_os_enter_critical(&proc->spinlock);
|
||||
isp_ll_ccm_enable(proc->hal.hw, true);
|
||||
portEXIT_CRITICAL(&proc->spinlock);
|
||||
esp_os_exit_critical(&proc->spinlock);
|
||||
|
||||
return ESP_OK;
|
||||
}
|
||||
@@ -64,9 +64,9 @@ esp_err_t esp_isp_ccm_disable(isp_proc_handle_t proc)
|
||||
isp_fsm_t expected_fsm = ISP_FSM_ENABLE;
|
||||
ESP_RETURN_ON_FALSE(atomic_compare_exchange_strong(&proc->ccm_fsm, &expected_fsm, ISP_FSM_INIT), ESP_ERR_INVALID_STATE, TAG, "ccm isn't enabled yet");
|
||||
|
||||
portENTER_CRITICAL(&proc->spinlock);
|
||||
esp_os_enter_critical(&proc->spinlock);
|
||||
isp_ll_ccm_enable(proc->hal.hw, false);
|
||||
portEXIT_CRITICAL(&proc->spinlock);
|
||||
esp_os_exit_critical(&proc->spinlock);
|
||||
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ esp_err_t esp_isp_new_processor(const esp_isp_processor_cfg_t *proc_config, isp_
|
||||
atomic_init(&proc->lsc_fsm, ISP_FSM_INIT);
|
||||
atomic_init(&proc->sharpen_fsm, ISP_FSM_INIT);
|
||||
atomic_init(&proc->wbg_fsm, ISP_FSM_INIT);
|
||||
proc->spinlock = (portMUX_TYPE)portMUX_INITIALIZER_UNLOCKED;
|
||||
INIT_CRIT_SECTION_LOCK_RUNTIME(&proc->spinlock);
|
||||
|
||||
//Input & Output color format
|
||||
color_space_pixel_format_t in_color_format = {
|
||||
@@ -279,9 +279,9 @@ static void IRAM_ATTR s_isp_isr_dispatcher(void *arg)
|
||||
bool do_dispatch = false;
|
||||
//Deal with hw events
|
||||
if (af_events) {
|
||||
portENTER_CRITICAL_ISR(&proc->spinlock);
|
||||
esp_os_enter_critical_isr(&proc->spinlock);
|
||||
do_dispatch = proc->isr_users.af_isr_added;
|
||||
portEXIT_CRITICAL_ISR(&proc->spinlock);
|
||||
esp_os_exit_critical_isr(&proc->spinlock);
|
||||
|
||||
if (do_dispatch) {
|
||||
need_yield |= esp_isp_af_isr(proc, af_events);
|
||||
@@ -289,9 +289,9 @@ static void IRAM_ATTR s_isp_isr_dispatcher(void *arg)
|
||||
do_dispatch = false;
|
||||
}
|
||||
if (awb_events) {
|
||||
portENTER_CRITICAL_ISR(&proc->spinlock);
|
||||
esp_os_enter_critical_isr(&proc->spinlock);
|
||||
do_dispatch = proc->isr_users.awb_isr_added;
|
||||
portEXIT_CRITICAL_ISR(&proc->spinlock);
|
||||
esp_os_exit_critical_isr(&proc->spinlock);
|
||||
|
||||
if (do_dispatch) {
|
||||
need_yield |= esp_isp_awb_isr(proc, awb_events);
|
||||
@@ -299,9 +299,9 @@ static void IRAM_ATTR s_isp_isr_dispatcher(void *arg)
|
||||
do_dispatch = false;
|
||||
}
|
||||
if (ae_events) {
|
||||
portENTER_CRITICAL_ISR(&proc->spinlock);
|
||||
esp_os_enter_critical_isr(&proc->spinlock);
|
||||
do_dispatch = proc->isr_users.ae_isr_added;
|
||||
portEXIT_CRITICAL_ISR(&proc->spinlock);
|
||||
esp_os_exit_critical_isr(&proc->spinlock);
|
||||
|
||||
if (do_dispatch) {
|
||||
need_yield |= esp_isp_ae_isr(proc, ae_events);
|
||||
@@ -309,9 +309,9 @@ static void IRAM_ATTR s_isp_isr_dispatcher(void *arg)
|
||||
do_dispatch = false;
|
||||
}
|
||||
if (sharp_events) {
|
||||
portENTER_CRITICAL_ISR(&proc->spinlock);
|
||||
esp_os_enter_critical_isr(&proc->spinlock);
|
||||
do_dispatch = proc->isr_users.sharp_isr_added;
|
||||
portEXIT_CRITICAL_ISR(&proc->spinlock);
|
||||
esp_os_exit_critical_isr(&proc->spinlock);
|
||||
|
||||
if (do_dispatch) {
|
||||
need_yield |= esp_isp_sharpen_isr(proc, sharp_events);
|
||||
@@ -319,9 +319,9 @@ static void IRAM_ATTR s_isp_isr_dispatcher(void *arg)
|
||||
do_dispatch = false;
|
||||
}
|
||||
if (hist_events) {
|
||||
portENTER_CRITICAL_ISR(&proc->spinlock);
|
||||
esp_os_enter_critical_isr(&proc->spinlock);
|
||||
do_dispatch = proc->isr_users.hist_isr_added;
|
||||
portEXIT_CRITICAL_ISR(&proc->spinlock);
|
||||
esp_os_exit_critical_isr(&proc->spinlock);
|
||||
|
||||
if (do_dispatch) {
|
||||
need_yield |= esp_isp_hist_isr(proc, hist_events);
|
||||
@@ -339,7 +339,7 @@ esp_err_t esp_isp_register_isr(isp_proc_handle_t proc, isp_submodule_t submodule
|
||||
ESP_RETURN_ON_FALSE(proc, ESP_ERR_INVALID_ARG, TAG, "invalid argument: null pointer");
|
||||
|
||||
bool do_alloc = false;
|
||||
portENTER_CRITICAL(&proc->spinlock);
|
||||
esp_os_enter_critical(&proc->spinlock);
|
||||
proc->isr_ref_counts++;
|
||||
if (proc->isr_ref_counts == 1) {
|
||||
assert(!proc->intr_hdl);
|
||||
@@ -365,7 +365,7 @@ esp_err_t esp_isp_register_isr(isp_proc_handle_t proc, isp_submodule_t submodule
|
||||
default:
|
||||
assert(false);
|
||||
}
|
||||
portEXIT_CRITICAL(&proc->spinlock);
|
||||
esp_os_exit_critical(&proc->spinlock);
|
||||
|
||||
if (do_alloc) {
|
||||
|
||||
@@ -389,7 +389,7 @@ esp_err_t esp_isp_deregister_isr(isp_proc_handle_t proc, isp_submodule_t submodu
|
||||
ESP_RETURN_ON_FALSE(proc, ESP_ERR_INVALID_ARG, TAG, "invalid argument: null pointer");
|
||||
|
||||
bool do_free = false;
|
||||
portENTER_CRITICAL(&proc->spinlock);
|
||||
esp_os_enter_critical(&proc->spinlock);
|
||||
proc->isr_ref_counts--;
|
||||
assert(proc->isr_ref_counts >= 0);
|
||||
if (proc->isr_ref_counts == 0) {
|
||||
@@ -416,7 +416,7 @@ esp_err_t esp_isp_deregister_isr(isp_proc_handle_t proc, isp_submodule_t submodu
|
||||
default:
|
||||
assert(false);
|
||||
}
|
||||
portEXIT_CRITICAL(&proc->spinlock);
|
||||
esp_os_exit_critical(&proc->spinlock);
|
||||
|
||||
if (do_free) {
|
||||
esp_intr_disable(proc->intr_hdl);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -61,9 +61,9 @@ esp_err_t esp_isp_gamma_enable(isp_proc_handle_t proc)
|
||||
isp_fsm_t expected_fsm = ISP_FSM_INIT;
|
||||
ESP_RETURN_ON_FALSE(atomic_compare_exchange_strong(&proc->gamma_fsm, &expected_fsm, ISP_FSM_ENABLE), ESP_ERR_INVALID_STATE, TAG, "gamma is enabled already");
|
||||
|
||||
portENTER_CRITICAL(&proc->spinlock);
|
||||
esp_os_enter_critical(&proc->spinlock);
|
||||
isp_ll_gamma_enable(proc->hal.hw, true);
|
||||
portEXIT_CRITICAL(&proc->spinlock);
|
||||
esp_os_exit_critical(&proc->spinlock);
|
||||
|
||||
return ESP_OK;
|
||||
}
|
||||
@@ -74,9 +74,9 @@ esp_err_t esp_isp_gamma_disable(isp_proc_handle_t proc)
|
||||
isp_fsm_t expected_fsm = ISP_FSM_ENABLE;
|
||||
ESP_RETURN_ON_FALSE(atomic_compare_exchange_strong(&proc->gamma_fsm, &expected_fsm, ISP_FSM_INIT), ESP_ERR_INVALID_STATE, TAG, "gamma is disabled already");
|
||||
|
||||
portENTER_CRITICAL(&proc->spinlock);
|
||||
esp_os_enter_critical(&proc->spinlock);
|
||||
isp_ll_gamma_enable(proc->hal.hw, false);
|
||||
portEXIT_CRITICAL(&proc->spinlock);
|
||||
esp_os_exit_critical(&proc->spinlock);
|
||||
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -35,12 +35,12 @@ static esp_err_t s_isp_claim_hist_controller(isp_proc_handle_t isp_proc, isp_his
|
||||
assert(isp_proc && hist_ctlr);
|
||||
|
||||
bool found = false;
|
||||
portENTER_CRITICAL(&isp_proc->spinlock);
|
||||
esp_os_enter_critical(&isp_proc->spinlock);
|
||||
if (!isp_proc->hist_ctlr) {
|
||||
isp_proc->hist_ctlr = hist_ctlr;
|
||||
found = true;
|
||||
}
|
||||
portEXIT_CRITICAL(&isp_proc->spinlock);
|
||||
esp_os_exit_critical(&isp_proc->spinlock);
|
||||
|
||||
if (!found) {
|
||||
return ESP_ERR_NOT_FOUND;
|
||||
@@ -51,9 +51,9 @@ static esp_err_t s_isp_claim_hist_controller(isp_proc_handle_t isp_proc, isp_his
|
||||
static void s_isp_declaim_hist_controller(isp_hist_ctlr_t hist_ctlr)
|
||||
{
|
||||
if (hist_ctlr && hist_ctlr->isp_proc) {
|
||||
portENTER_CRITICAL(&hist_ctlr->isp_proc->spinlock);
|
||||
esp_os_enter_critical(&hist_ctlr->isp_proc->spinlock);
|
||||
hist_ctlr->isp_proc->hist_ctlr = NULL;
|
||||
portEXIT_CRITICAL(&hist_ctlr->isp_proc->spinlock);
|
||||
esp_os_exit_critical(&hist_ctlr->isp_proc->spinlock);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
1
tools/test_apps/system/build_test/sdkconfig.ci.unicore
Normal file
1
tools/test_apps/system/build_test/sdkconfig.ci.unicore
Normal file
@@ -0,0 +1 @@
|
||||
CONFIG_FREERTOS_UNICORE=y
|
||||
Reference in New Issue
Block a user