mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 10:58:48 +09:00
media: rockchip: isp: rawrd format sync with isp input format change
Change-Id: Ic37ab5c9f4a712b2ab2232ad4c91ba2d7a415612 Signed-off-by: Cai YiWei <cyw@rock-chips.com>
This commit is contained in:
@@ -470,7 +470,7 @@ static int _set_pipeline_default_fmt(struct rkisp_device *dev, bool is_init)
|
||||
struct v4l2_subdev *isp;
|
||||
struct v4l2_subdev_format fmt;
|
||||
struct v4l2_subdev_selection sel;
|
||||
u32 i, width, height, code;
|
||||
u32 width, height, code;
|
||||
|
||||
memset(&sel, 0, sizeof(sel));
|
||||
memset(&fmt, 0, sizeof(fmt));
|
||||
@@ -551,14 +551,6 @@ static int _set_pipeline_default_fmt(struct rkisp_device *dev, bool is_init)
|
||||
}
|
||||
|
||||
if (dev->isp_ver == ISP_V30) {
|
||||
struct v4l2_pix_format_mplane pixm = {
|
||||
.width = width,
|
||||
.height = height,
|
||||
.pixelformat = rkisp_mbus_pixelcode_to_v4l2(code),
|
||||
};
|
||||
|
||||
for (i = RKISP_STREAM_RAWRD0; i <= RKISP_STREAM_RAWRD2; i++)
|
||||
rkisp_dmarx_set_fmt(&dev->dmarx_dev.stream[i], pixm);
|
||||
rkisp_set_stream_def_fmt(dev, RKISP_STREAM_FBC,
|
||||
width, height, V4L2_PIX_FMT_FBC0);
|
||||
#ifdef RKISP_STREAM_BP_EN
|
||||
@@ -567,25 +559,13 @@ static int _set_pipeline_default_fmt(struct rkisp_device *dev, bool is_init)
|
||||
#endif
|
||||
}
|
||||
|
||||
if (dev->isp_ver == ISP_V32 ||
|
||||
dev->isp_ver == ISP_V32_L ||
|
||||
dev->isp_ver == ISP_V39) {
|
||||
struct v4l2_pix_format_mplane pixm = {
|
||||
.width = width,
|
||||
.height = height,
|
||||
.pixelformat = rkisp_mbus_pixelcode_to_v4l2(code),
|
||||
};
|
||||
|
||||
rkisp_dmarx_set_fmt(&dev->dmarx_dev.stream[RKISP_STREAM_RAWRD0], pixm);
|
||||
rkisp_dmarx_set_fmt(&dev->dmarx_dev.stream[RKISP_STREAM_RAWRD2], pixm);
|
||||
if (dev->isp_ver == ISP_V32) {
|
||||
rkisp_set_stream_def_fmt(dev, RKISP_STREAM_BP,
|
||||
width, height, V4L2_PIX_FMT_NV12);
|
||||
rkisp_set_stream_def_fmt(dev, RKISP_STREAM_MPDS,
|
||||
width / 4, height / 4, V4L2_PIX_FMT_NV12);
|
||||
rkisp_set_stream_def_fmt(dev, RKISP_STREAM_BPDS,
|
||||
width / 4, height / 4, V4L2_PIX_FMT_NV12);
|
||||
}
|
||||
if (dev->isp_ver == ISP_V32) {
|
||||
rkisp_set_stream_def_fmt(dev, RKISP_STREAM_BP,
|
||||
width, height, V4L2_PIX_FMT_NV12);
|
||||
rkisp_set_stream_def_fmt(dev, RKISP_STREAM_MPDS,
|
||||
width / 4, height / 4, V4L2_PIX_FMT_NV12);
|
||||
rkisp_set_stream_def_fmt(dev, RKISP_STREAM_BPDS,
|
||||
width / 4, height / 4, V4L2_PIX_FMT_NV12);
|
||||
}
|
||||
if (dev->isp_ver == ISP_V39)
|
||||
rkisp_set_stream_def_fmt(dev, RKISP_STREAM_LDC, width, height, V4L2_PIX_FMT_NV12);
|
||||
|
||||
@@ -2621,6 +2621,7 @@ static int rkisp_isp_sd_set_fmt(struct v4l2_subdev *sd,
|
||||
}
|
||||
|
||||
if (fmt->pad == RKISP_ISP_PAD_SINK) {
|
||||
struct v4l2_pix_format_mplane pixm = { 0 };
|
||||
const struct ispsd_in_fmt *in_fmt;
|
||||
|
||||
in_fmt = find_in_fmt(mf->code);
|
||||
@@ -2631,6 +2632,14 @@ static int rkisp_isp_sd_set_fmt(struct v4l2_subdev *sd,
|
||||
|
||||
isp_sd->in_fmt = *in_fmt;
|
||||
isp_sd->in_frm = *mf;
|
||||
/* rawrd video format with isp input format change */
|
||||
pixm.width = mf->width;
|
||||
pixm.height = mf->height;
|
||||
pixm.pixelformat = rkisp_mbus_pixelcode_to_v4l2(mf->code);
|
||||
rkisp_dmarx_set_fmt(&isp_dev->dmarx_dev.stream[RKISP_STREAM_RAWRD0], pixm);
|
||||
rkisp_dmarx_set_fmt(&isp_dev->dmarx_dev.stream[RKISP_STREAM_RAWRD2], pixm);
|
||||
if (isp_dev->isp_ver == ISP_V20 || isp_dev->isp_ver == ISP_V30)
|
||||
rkisp_dmarx_set_fmt(&isp_dev->dmarx_dev.stream[RKISP_STREAM_RAWRD1], pixm);
|
||||
} else if (fmt->pad == RKISP_ISP_PAD_SOURCE_PATH) {
|
||||
const struct ispsd_out_fmt *out_fmt;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user