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 cb50d2f85f..4e62491753 100644 --- a/docs/en/api-reference/peripherals/isp.rst +++ b/docs/en/api-reference/peripherals/isp.rst @@ -597,6 +597,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 diff --git a/docs/zh_CN/api-reference/peripherals/isp.rst b/docs/zh_CN/api-reference/peripherals/isp.rst index 0955634607..9f90290d83 100644 --- a/docs/zh_CN/api-reference/peripherals/isp.rst +++ b/docs/zh_CN/api-reference/peripherals/isp.rst @@ -597,6 +597,10 @@ ISP 色彩控制器 调用 :cpp:func:`esp_isp_color_disable` 函数会执行相反的操作,即将驱动程序恢复到 **init** 状态。 +.. note:: + + 当 ISP DVP 外设在使用且输出颜色格式设置为 RGB 色彩空间时,摄像头驱动程序会自动启用 :ref:`isp-color` 以确保数据输出正确。在这种情况下,禁止调用 :cpp:func:`esp_isp_color_disable` 函数,否则可能导致摄像头数据混乱。 + .. _isp-ccm-config: 配置 CCM