diff --git a/components/esp_driver_isp/src/isp_core.c b/components/esp_driver_isp/src/isp_core.c index f964aaa1cc..89fe6d79f1 100644 --- a/components/esp_driver_isp/src/isp_core.c +++ b/components/esp_driver_isp/src/isp_core.c @@ -145,6 +145,10 @@ esp_err_t esp_isp_new_processor(const esp_isp_processor_cfg_t *proc_config, isp_ isp_ll_yuv_set_range(proc->hal.hw, proc_config->yuv_range); } + if (out_color_format.color_space == COLOR_SPACE_RGB && proc_config->input_data_source == ISP_INPUT_DATA_SOURCE_DVP) { + isp_ll_color_enable(proc->hal.hw, true); // workaround for DIG-474 + } + proc->in_color_format = in_color_format; proc->out_color_format = out_color_format; proc->h_res = proc_config->h_res; diff --git a/components/hal/esp32p4/include/hal/isp_ll.h b/components/hal/esp32p4/include/hal/isp_ll.h index bcb5312d07..00712b1256 100644 --- a/components/hal/esp32p4/include/hal/isp_ll.h +++ b/components/hal/esp32p4/include/hal/isp_ll.h @@ -396,15 +396,15 @@ static inline bool isp_ll_set_output_data_color_format(isp_dev_t *hw, color_spac case COLOR_PIXEL_RGB888: hw->cntl.isp_out_type = 2; hw->cntl.demosaic_en = 1; - hw->cntl.rgb2yuv_en = 0; - hw->cntl.yuv2rgb_en = 0; + hw->cntl.rgb2yuv_en = 1; + hw->cntl.yuv2rgb_en = 1; valid = true; break; case COLOR_PIXEL_RGB565: hw->cntl.isp_out_type = 4; hw->cntl.demosaic_en = 1; - hw->cntl.rgb2yuv_en = 0; - hw->cntl.yuv2rgb_en = 0; + hw->cntl.rgb2yuv_en = 1; + hw->cntl.yuv2rgb_en = 1; valid = true; break; default: diff --git a/docs/en/api-reference/peripherals/isp.rst b/docs/en/api-reference/peripherals/isp.rst index 33d6ea2b7e..6ce6c57008 100644 --- a/docs/en/api-reference/peripherals/isp.rst +++ b/docs/en/api-reference/peripherals/isp.rst @@ -589,6 +589,10 @@ After calling :cpp:func:`esp_isp_color_configure`, you need to enable the ISP co Calling :cpp:func:`esp_isp_color_disable` does the opposite, that is, put the driver back to the **init** state. +.. note:: + + When the ISP DVP peripheral is used with the output color format set to the RGB color space, :ref:`isp-color` is automatically enabled in the camera driver to ensure correct data output. The function :cpp:func:`esp_isp_color_disable` should never be called in this case, otherwise it may result in disarrayed camera data. + .. _isp-ccm-config: Configure CCM