Commit debfa496 authored by Eugen Hristev's avatar Eugen Hristev Committed by Mauro Carvalho Chehab

media: atmel: atmel-isc-base: add support for more formats and additional pipeline modules

Add support for additional formats supported by newer pipelines, and for
additional pipeline modules.
Signed-off-by: default avatarEugen Hristev <eugen.hristev@microchip.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 0baf7a32
...@@ -855,6 +855,8 @@ static int isc_try_validate_formats(struct isc_device *isc) ...@@ -855,6 +855,8 @@ static int isc_try_validate_formats(struct isc_device *isc)
case V4L2_PIX_FMT_YUV420: case V4L2_PIX_FMT_YUV420:
case V4L2_PIX_FMT_YUV422P: case V4L2_PIX_FMT_YUV422P:
case V4L2_PIX_FMT_YUYV: case V4L2_PIX_FMT_YUYV:
case V4L2_PIX_FMT_UYVY:
case V4L2_PIX_FMT_VYUY:
ret = 0; ret = 0;
yuv = true; yuv = true;
break; break;
...@@ -869,6 +871,7 @@ static int isc_try_validate_formats(struct isc_device *isc) ...@@ -869,6 +871,7 @@ static int isc_try_validate_formats(struct isc_device *isc)
break; break;
case V4L2_PIX_FMT_GREY: case V4L2_PIX_FMT_GREY:
case V4L2_PIX_FMT_Y10: case V4L2_PIX_FMT_Y10:
case V4L2_PIX_FMT_Y16:
ret = 0; ret = 0;
grey = true; grey = true;
break; break;
...@@ -899,6 +902,8 @@ static int isc_try_validate_formats(struct isc_device *isc) ...@@ -899,6 +902,8 @@ static int isc_try_validate_formats(struct isc_device *isc)
*/ */
static int isc_try_configure_rlp_dma(struct isc_device *isc, bool direct_dump) static int isc_try_configure_rlp_dma(struct isc_device *isc, bool direct_dump)
{ {
isc->try_config.rlp_cfg_mode = 0;
switch (isc->try_config.fourcc) { switch (isc->try_config.fourcc) {
case V4L2_PIX_FMT_SBGGR8: case V4L2_PIX_FMT_SBGGR8:
case V4L2_PIX_FMT_SGBRG8: case V4L2_PIX_FMT_SGBRG8:
...@@ -965,7 +970,19 @@ static int isc_try_configure_rlp_dma(struct isc_device *isc, bool direct_dump) ...@@ -965,7 +970,19 @@ static int isc_try_configure_rlp_dma(struct isc_device *isc, bool direct_dump)
isc->try_config.bpp = 16; isc->try_config.bpp = 16;
break; break;
case V4L2_PIX_FMT_YUYV: case V4L2_PIX_FMT_YUYV:
isc->try_config.rlp_cfg_mode = ISC_RLP_CFG_MODE_YYCC; isc->try_config.rlp_cfg_mode = ISC_RLP_CFG_MODE_YCYC | ISC_RLP_CFG_YMODE_YUYV;
isc->try_config.dcfg_imode = ISC_DCFG_IMODE_PACKED32;
isc->try_config.dctrl_dview = ISC_DCTRL_DVIEW_PACKED;
isc->try_config.bpp = 16;
break;
case V4L2_PIX_FMT_UYVY:
isc->try_config.rlp_cfg_mode = ISC_RLP_CFG_MODE_YCYC | ISC_RLP_CFG_YMODE_UYVY;
isc->try_config.dcfg_imode = ISC_DCFG_IMODE_PACKED32;
isc->try_config.dctrl_dview = ISC_DCTRL_DVIEW_PACKED;
isc->try_config.bpp = 16;
break;
case V4L2_PIX_FMT_VYUY:
isc->try_config.rlp_cfg_mode = ISC_RLP_CFG_MODE_YCYC | ISC_RLP_CFG_YMODE_VYUY;
isc->try_config.dcfg_imode = ISC_DCFG_IMODE_PACKED32; isc->try_config.dcfg_imode = ISC_DCFG_IMODE_PACKED32;
isc->try_config.dctrl_dview = ISC_DCTRL_DVIEW_PACKED; isc->try_config.dctrl_dview = ISC_DCTRL_DVIEW_PACKED;
isc->try_config.bpp = 16; isc->try_config.bpp = 16;
...@@ -976,8 +993,11 @@ static int isc_try_configure_rlp_dma(struct isc_device *isc, bool direct_dump) ...@@ -976,8 +993,11 @@ static int isc_try_configure_rlp_dma(struct isc_device *isc, bool direct_dump)
isc->try_config.dctrl_dview = ISC_DCTRL_DVIEW_PACKED; isc->try_config.dctrl_dview = ISC_DCTRL_DVIEW_PACKED;
isc->try_config.bpp = 8; isc->try_config.bpp = 8;
break; break;
case V4L2_PIX_FMT_Y16:
isc->try_config.rlp_cfg_mode = ISC_RLP_CFG_MODE_DATY10 | ISC_RLP_CFG_LSH;
fallthrough;
case V4L2_PIX_FMT_Y10: case V4L2_PIX_FMT_Y10:
isc->try_config.rlp_cfg_mode = ISC_RLP_CFG_MODE_DATY10; isc->try_config.rlp_cfg_mode |= ISC_RLP_CFG_MODE_DATY10;
isc->try_config.dcfg_imode = ISC_DCFG_IMODE_PACKED16; isc->try_config.dcfg_imode = ISC_DCFG_IMODE_PACKED16;
isc->try_config.dctrl_dview = ISC_DCTRL_DVIEW_PACKED; isc->try_config.dctrl_dview = ISC_DCTRL_DVIEW_PACKED;
isc->try_config.bpp = 16; isc->try_config.bpp = 16;
...@@ -1011,7 +1031,8 @@ static int isc_try_configure_pipeline(struct isc_device *isc) ...@@ -1011,7 +1031,8 @@ static int isc_try_configure_pipeline(struct isc_device *isc)
/* if sensor format is RAW, we convert inside ISC */ /* if sensor format is RAW, we convert inside ISC */
if (ISC_IS_FORMAT_RAW(isc->try_config.sd_format->mbus_code)) { if (ISC_IS_FORMAT_RAW(isc->try_config.sd_format->mbus_code)) {
isc->try_config.bits_pipeline = CFA_ENABLE | isc->try_config.bits_pipeline = CFA_ENABLE |
WB_ENABLE | GAM_ENABLES; WB_ENABLE | GAM_ENABLES | DPC_BLCENABLE |
CC_ENABLE;
} else { } else {
isc->try_config.bits_pipeline = 0x0; isc->try_config.bits_pipeline = 0x0;
} }
...@@ -1020,8 +1041,9 @@ static int isc_try_configure_pipeline(struct isc_device *isc) ...@@ -1020,8 +1041,9 @@ static int isc_try_configure_pipeline(struct isc_device *isc)
/* if sensor format is RAW, we convert inside ISC */ /* if sensor format is RAW, we convert inside ISC */
if (ISC_IS_FORMAT_RAW(isc->try_config.sd_format->mbus_code)) { if (ISC_IS_FORMAT_RAW(isc->try_config.sd_format->mbus_code)) {
isc->try_config.bits_pipeline = CFA_ENABLE | isc->try_config.bits_pipeline = CFA_ENABLE |
CSC_ENABLE | WB_ENABLE | GAM_ENABLES | CSC_ENABLE | GAM_ENABLES | WB_ENABLE |
SUB420_ENABLE | SUB422_ENABLE | CBC_ENABLE; SUB420_ENABLE | SUB422_ENABLE | CBC_ENABLE |
DPC_BLCENABLE;
} else { } else {
isc->try_config.bits_pipeline = 0x0; isc->try_config.bits_pipeline = 0x0;
} }
...@@ -1031,33 +1053,39 @@ static int isc_try_configure_pipeline(struct isc_device *isc) ...@@ -1031,33 +1053,39 @@ static int isc_try_configure_pipeline(struct isc_device *isc)
if (ISC_IS_FORMAT_RAW(isc->try_config.sd_format->mbus_code)) { if (ISC_IS_FORMAT_RAW(isc->try_config.sd_format->mbus_code)) {
isc->try_config.bits_pipeline = CFA_ENABLE | isc->try_config.bits_pipeline = CFA_ENABLE |
CSC_ENABLE | WB_ENABLE | GAM_ENABLES | CSC_ENABLE | WB_ENABLE | GAM_ENABLES |
SUB422_ENABLE | CBC_ENABLE; SUB422_ENABLE | CBC_ENABLE | DPC_BLCENABLE;
} else { } else {
isc->try_config.bits_pipeline = 0x0; isc->try_config.bits_pipeline = 0x0;
} }
break; break;
case V4L2_PIX_FMT_YUYV: case V4L2_PIX_FMT_YUYV:
case V4L2_PIX_FMT_UYVY:
case V4L2_PIX_FMT_VYUY:
/* if sensor format is RAW, we convert inside ISC */ /* if sensor format is RAW, we convert inside ISC */
if (ISC_IS_FORMAT_RAW(isc->try_config.sd_format->mbus_code)) { if (ISC_IS_FORMAT_RAW(isc->try_config.sd_format->mbus_code)) {
isc->try_config.bits_pipeline = CFA_ENABLE | isc->try_config.bits_pipeline = CFA_ENABLE |
CSC_ENABLE | WB_ENABLE | GAM_ENABLES | CSC_ENABLE | WB_ENABLE | GAM_ENABLES |
SUB422_ENABLE | CBC_ENABLE; SUB422_ENABLE | CBC_ENABLE | DPC_BLCENABLE;
} else { } else {
isc->try_config.bits_pipeline = 0x0; isc->try_config.bits_pipeline = 0x0;
} }
break; break;
case V4L2_PIX_FMT_GREY: case V4L2_PIX_FMT_GREY:
if (ISC_IS_FORMAT_RAW(isc->try_config.sd_format->mbus_code)) { case V4L2_PIX_FMT_Y16:
/* if sensor format is RAW, we convert inside ISC */ /* if sensor format is RAW, we convert inside ISC */
if (ISC_IS_FORMAT_RAW(isc->try_config.sd_format->mbus_code)) {
isc->try_config.bits_pipeline = CFA_ENABLE | isc->try_config.bits_pipeline = CFA_ENABLE |
CSC_ENABLE | WB_ENABLE | GAM_ENABLES | CSC_ENABLE | WB_ENABLE | GAM_ENABLES |
CBC_ENABLE; CBC_ENABLE | DPC_BLCENABLE;
} else { } else {
isc->try_config.bits_pipeline = 0x0; isc->try_config.bits_pipeline = 0x0;
} }
break; break;
default: default:
isc->try_config.bits_pipeline = 0x0; if (ISC_IS_FORMAT_RAW(isc->try_config.sd_format->mbus_code))
isc->try_config.bits_pipeline = WB_ENABLE | DPC_BLCENABLE;
else
isc->try_config.bits_pipeline = 0x0;
} }
/* Tune the pipeline to product specific */ /* Tune the pipeline to product specific */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment