fix(isp): isp_dvp raw->rgb needs a workaround

This commit is contained in:
Song Ruo Jing 2024-12-10 14:39:47 +08:00
parent 1363754c19
commit c05603d4a0
4 changed files with 16 additions and 4 deletions

View File

@ -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;

View File

@ -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:

View File

@ -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

View File

@ -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