mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 10:58:48 +09:00
media: rockchip: isp: enum formats for different isp version
Change-Id: I05b11d39855ec87ed4d97b432a8bdbc39a95128a Signed-off-by: Cai YiWei <cyw@rock-chips.com>
This commit is contained in:
@@ -455,349 +455,7 @@ int rkisp_stream_frame_start(struct rkisp_device *dev, u32 isp_mis)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct capture_fmt mp_fmts[] = {
|
||||
/* yuv422 */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_UYVY,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 16 },
|
||||
.cplanes = 1,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUVINT,
|
||||
.output_format = ISP32_MI_OUTPUT_YUV422,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_YUV422P,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 4, 4 },
|
||||
.cplanes = 3,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
|
||||
.output_format = ISP32_MI_OUTPUT_YUV422,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV16,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_SPLA,
|
||||
.output_format = ISP32_MI_OUTPUT_YUV422,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV61,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_SPLA,
|
||||
.output_format = ISP32_MI_OUTPUT_YUV422,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_YUV422M,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 8, 8 },
|
||||
.cplanes = 3,
|
||||
.mplanes = 3,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
|
||||
.output_format = ISP32_MI_OUTPUT_YUV422,
|
||||
},
|
||||
/* yuv420 */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_NV21,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_SPLA,
|
||||
.output_format = ISP32_MI_OUTPUT_YUV420,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV12,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_SPLA,
|
||||
.output_format = ISP32_MI_OUTPUT_YUV420,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV21M,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 2,
|
||||
.uv_swap = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_SPLA,
|
||||
.output_format = ISP32_MI_OUTPUT_YUV420,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV12M,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 2,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_SPLA,
|
||||
.output_format = ISP32_MI_OUTPUT_YUV420,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_YUV420,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 8, 8 },
|
||||
.cplanes = 3,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
|
||||
.output_format = ISP32_MI_OUTPUT_YUV420,
|
||||
},
|
||||
/* yuv444 */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_YUV444M,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 8, 8 },
|
||||
.cplanes = 3,
|
||||
.mplanes = 3,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
|
||||
.output_format = 0,
|
||||
},
|
||||
/* raw */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_SRGGB8,
|
||||
.fmt_type = FMT_BAYER,
|
||||
.bpp = { 8 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
|
||||
.output_format = 0,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_SGRBG8,
|
||||
.fmt_type = FMT_BAYER,
|
||||
.bpp = { 8 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
|
||||
.output_format = 0,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_SGBRG8,
|
||||
.fmt_type = FMT_BAYER,
|
||||
.bpp = { 8 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
|
||||
.output_format = 0,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_SBGGR8,
|
||||
.fmt_type = FMT_BAYER,
|
||||
.bpp = { 8 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
|
||||
.output_format = 0,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_SRGGB10,
|
||||
.fmt_type = FMT_BAYER,
|
||||
.bpp = { 10 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_RAW12,
|
||||
.output_format = 0,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_SGRBG10,
|
||||
.fmt_type = FMT_BAYER,
|
||||
.bpp = { 10 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_RAW12,
|
||||
.output_format = 0,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_SGBRG10,
|
||||
.fmt_type = FMT_BAYER,
|
||||
.bpp = { 10 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_RAW12,
|
||||
.output_format = 0,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_SBGGR10,
|
||||
.fmt_type = FMT_BAYER,
|
||||
.bpp = { 10 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_RAW12,
|
||||
.output_format = 0,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_SRGGB12,
|
||||
.fmt_type = FMT_BAYER,
|
||||
.bpp = { 12 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_RAW12,
|
||||
.output_format = 0,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_SGRBG12,
|
||||
.fmt_type = FMT_BAYER,
|
||||
.bpp = { 12 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_RAW12,
|
||||
.output_format = 0,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_SGBRG12,
|
||||
.fmt_type = FMT_BAYER,
|
||||
.bpp = { 12 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_RAW12,
|
||||
.output_format = 0,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_SBGGR12,
|
||||
.fmt_type = FMT_BAYER,
|
||||
.bpp = { 12 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_RAW12,
|
||||
.output_format = 0,
|
||||
},
|
||||
};
|
||||
|
||||
static const struct capture_fmt sp_fmts[] = {
|
||||
/* yuv422 */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_UYVY,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 16 },
|
||||
.cplanes = 1,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_INT,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV422,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_YUV422P,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 8, 8 },
|
||||
.cplanes = 3,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_PLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV422,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV16,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_SPLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV422,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV61,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 1,
|
||||
.write_format = MI_CTRL_SP_WRITE_SPLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV422,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_YUV422M,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 8, 8 },
|
||||
.cplanes = 3,
|
||||
.mplanes = 3,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_PLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV422,
|
||||
},
|
||||
/* yuv420 */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_NV21,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 1,
|
||||
.write_format = MI_CTRL_SP_WRITE_SPLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV420,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV12,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_SPLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV420,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV21M,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 2,
|
||||
.uv_swap = 1,
|
||||
.write_format = MI_CTRL_SP_WRITE_SPLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV420,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV12M,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 2,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_SPLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV420,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_YUV420,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 8, 8 },
|
||||
.cplanes = 3,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_PLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV420,
|
||||
},
|
||||
/* yuv444 */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_YUV444M,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 8, 8 },
|
||||
.cplanes = 3,
|
||||
.mplanes = 3,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_PLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV444,
|
||||
},
|
||||
/* yuv400 */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_GREY,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8 },
|
||||
.cplanes = 1,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_PLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV400,
|
||||
},
|
||||
/* rgb */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_XBGR32,
|
||||
.fmt_type = FMT_RGB,
|
||||
.bpp = { 32 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_SP_WRITE_PLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_RGB888,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_RGB565,
|
||||
.fmt_type = FMT_RGB,
|
||||
.bpp = { 16 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_SP_WRITE_PLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_RGB565,
|
||||
},
|
||||
/* fbcg */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_FBCG,
|
||||
.fmt_type = FMT_FBCGAIN,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 2,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_SPLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV420,
|
||||
}
|
||||
};
|
||||
|
||||
struct stream_config rkisp_mp_stream_config = {
|
||||
.fmts = mp_fmts,
|
||||
.fmt_size = ARRAY_SIZE(mp_fmts),
|
||||
/* constraints */
|
||||
.max_rsz_width = STREAM_MAX_MP_RSZ_OUTPUT_WIDTH,
|
||||
.max_rsz_height = STREAM_MAX_MP_RSZ_OUTPUT_HEIGHT,
|
||||
@@ -854,8 +512,6 @@ struct stream_config rkisp_mp_stream_config = {
|
||||
};
|
||||
|
||||
struct stream_config rkisp_sp_stream_config = {
|
||||
.fmts = sp_fmts,
|
||||
.fmt_size = ARRAY_SIZE(sp_fmts),
|
||||
/* constraints */
|
||||
.max_rsz_width = STREAM_MAX_SP_RSZ_OUTPUT_WIDTH,
|
||||
.max_rsz_height = STREAM_MAX_SP_RSZ_OUTPUT_HEIGHT,
|
||||
@@ -1629,11 +1285,37 @@ static int rkisp_enum_fmt_vid_cap_mplane(struct file *file, void *priv,
|
||||
{
|
||||
struct rkisp_stream *stream = video_drvdata(file);
|
||||
const struct capture_fmt *fmt = NULL;
|
||||
struct rkisp_device *dev = stream->ispdev;
|
||||
struct ispsd_in_fmt *isp_in_fmt = &dev->isp_sdev.in_fmt;
|
||||
struct ispsd_out_fmt *isp_out_fmt = &dev->isp_sdev.out_fmt;
|
||||
int ret = -EINVAL;
|
||||
|
||||
/* only one output format for raw */
|
||||
if (isp_out_fmt->fmt_type == FMT_BAYER ||
|
||||
stream->id == RKISP_STREAM_DMATX0 ||
|
||||
stream->id == RKISP_STREAM_DMATX1 ||
|
||||
stream->id == RKISP_STREAM_DMATX2 ||
|
||||
stream->id == RKISP_STREAM_DMATX3) {
|
||||
u32 pixelformat = rkisp_mbus_pixelcode_to_v4l2(isp_in_fmt->mbus_code);
|
||||
|
||||
if (f->index == 0) {
|
||||
fmt = find_fmt(stream, pixelformat);
|
||||
if (fmt) {
|
||||
f->pixelformat = pixelformat;
|
||||
ret = 0;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (f->index >= stream->config->fmt_size)
|
||||
return -EINVAL;
|
||||
|
||||
fmt = &stream->config->fmts[f->index];
|
||||
/* only output yuv format */
|
||||
if (isp_out_fmt->fmt_type == FMT_YUV && fmt->fmt_type == FMT_BAYER)
|
||||
return -EINVAL;
|
||||
|
||||
f->pixelformat = fmt->fourcc;
|
||||
switch (f->pixelformat) {
|
||||
case V4L2_PIX_FMT_FBC2:
|
||||
|
||||
@@ -19,6 +19,312 @@ static int mi_frame_end(struct rkisp_stream *stream);
|
||||
static void rkisp_buf_queue(struct vb2_buffer *vb);
|
||||
static int rkisp_create_dummy_buf(struct rkisp_stream *stream);
|
||||
|
||||
static const struct capture_fmt mp_fmts[] = {
|
||||
/* yuv422 */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_YUYV,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 16 },
|
||||
.cplanes = 1,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUVINT,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_YUV422P,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 4, 4 },
|
||||
.cplanes = 3,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV16,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_SPLA,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV61,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_SPLA,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_YUV422M,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 8, 8 },
|
||||
.cplanes = 3,
|
||||
.mplanes = 3,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
|
||||
},
|
||||
/* yuv420 */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_NV21,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_SPLA,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV12,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_SPLA,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV21M,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 2,
|
||||
.uv_swap = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_SPLA,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV12M,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 2,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_SPLA,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_YUV420,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 8, 8 },
|
||||
.cplanes = 3,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
|
||||
},
|
||||
/* yuv444 */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_YUV444M,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 8, 8 },
|
||||
.cplanes = 3,
|
||||
.mplanes = 3,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
|
||||
},
|
||||
/* raw */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_SRGGB8,
|
||||
.fmt_type = FMT_BAYER,
|
||||
.bpp = { 8 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_SGRBG8,
|
||||
.fmt_type = FMT_BAYER,
|
||||
.bpp = { 8 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_SGBRG8,
|
||||
.fmt_type = FMT_BAYER,
|
||||
.bpp = { 8 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_SBGGR8,
|
||||
.fmt_type = FMT_BAYER,
|
||||
.bpp = { 8 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_SRGGB10,
|
||||
.fmt_type = FMT_BAYER,
|
||||
.bpp = { 10 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_RAW12,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_SGRBG10,
|
||||
.fmt_type = FMT_BAYER,
|
||||
.bpp = { 10 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_RAW12,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_SGBRG10,
|
||||
.fmt_type = FMT_BAYER,
|
||||
.bpp = { 10 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_RAW12,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_SBGGR10,
|
||||
.fmt_type = FMT_BAYER,
|
||||
.bpp = { 10 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_RAW12,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_SRGGB12,
|
||||
.fmt_type = FMT_BAYER,
|
||||
.bpp = { 12 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_RAW12,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_SGRBG12,
|
||||
.fmt_type = FMT_BAYER,
|
||||
.bpp = { 12 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_RAW12,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_SGBRG12,
|
||||
.fmt_type = FMT_BAYER,
|
||||
.bpp = { 12 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_RAW12,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_SBGGR12,
|
||||
.fmt_type = FMT_BAYER,
|
||||
.bpp = { 12 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_RAW12,
|
||||
},
|
||||
};
|
||||
|
||||
static const struct capture_fmt sp_fmts[] = {
|
||||
/* yuv422 */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_YUYV,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 16 },
|
||||
.cplanes = 1,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_INT,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV422,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_YUV422P,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 8, 8 },
|
||||
.cplanes = 3,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_PLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV422,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV16,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_SPLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV422,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV61,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 1,
|
||||
.write_format = MI_CTRL_SP_WRITE_SPLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV422,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_YUV422M,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 8, 8 },
|
||||
.cplanes = 3,
|
||||
.mplanes = 3,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_PLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV422,
|
||||
},
|
||||
/* yuv420 */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_NV21,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 1,
|
||||
.write_format = MI_CTRL_SP_WRITE_SPLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV420,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV12,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_SPLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV420,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV21M,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 2,
|
||||
.uv_swap = 1,
|
||||
.write_format = MI_CTRL_SP_WRITE_SPLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV420,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV12M,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 2,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_SPLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV420,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_YUV420,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 8, 8 },
|
||||
.cplanes = 3,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_PLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV420,
|
||||
},
|
||||
/* yuv444 */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_YUV444M,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 8, 8 },
|
||||
.cplanes = 3,
|
||||
.mplanes = 3,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_PLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV444,
|
||||
},
|
||||
/* yuv400 */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_GREY,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8 },
|
||||
.cplanes = 1,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_PLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV400,
|
||||
},
|
||||
/* rgb */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_XBGR32,
|
||||
.fmt_type = FMT_RGB,
|
||||
.bpp = { 32 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_SP_WRITE_PLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_RGB888,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_RGB565,
|
||||
.fmt_type = FMT_RGB,
|
||||
.bpp = { 16 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_SP_WRITE_PLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_RGB565,
|
||||
}
|
||||
};
|
||||
|
||||
/* configure dual-crop unit */
|
||||
static int rkisp_stream_config_dcrop(struct rkisp_stream *stream, bool async)
|
||||
{
|
||||
@@ -860,12 +1166,16 @@ static int rkisp_stream_init(struct rkisp_device *dev, u32 id)
|
||||
sizeof(vdev->name));
|
||||
stream->ops = &rkisp_sp_streams_ops;
|
||||
stream->config = &rkisp_sp_stream_config;
|
||||
stream->config->fmts = sp_fmts;
|
||||
stream->config->fmt_size = ARRAY_SIZE(sp_fmts);
|
||||
break;
|
||||
default:
|
||||
strlcpy(vdev->name, MP_VDEV_NAME,
|
||||
sizeof(vdev->name));
|
||||
stream->ops = &rkisp_mp_streams_ops;
|
||||
stream->config = &rkisp_mp_stream_config;
|
||||
stream->config->fmts = mp_fmts;
|
||||
stream->config->fmt_size = ARRAY_SIZE(mp_fmts);
|
||||
}
|
||||
|
||||
node = vdev_to_node(vdev);
|
||||
|
||||
@@ -18,6 +18,345 @@
|
||||
static int mi_frame_end(struct rkisp_stream *stream);
|
||||
static void rkisp_buf_queue(struct vb2_buffer *vb);
|
||||
|
||||
static const struct capture_fmt mp_fmts[] = {
|
||||
/* yuv422 */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_UYVY,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 16 },
|
||||
.cplanes = 1,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUVINT,
|
||||
.output_format = ISP32_MI_OUTPUT_YUV422,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_YUV422P,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 4, 4 },
|
||||
.cplanes = 3,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
|
||||
.output_format = ISP32_MI_OUTPUT_YUV422,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV16,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_SPLA,
|
||||
.output_format = ISP32_MI_OUTPUT_YUV422,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV61,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_SPLA,
|
||||
.output_format = ISP32_MI_OUTPUT_YUV422,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_YUV422M,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 8, 8 },
|
||||
.cplanes = 3,
|
||||
.mplanes = 3,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
|
||||
.output_format = ISP32_MI_OUTPUT_YUV422,
|
||||
},
|
||||
/* yuv420 */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_NV21,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_SPLA,
|
||||
.output_format = ISP32_MI_OUTPUT_YUV420,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV12,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_SPLA,
|
||||
.output_format = ISP32_MI_OUTPUT_YUV420,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV21M,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 2,
|
||||
.uv_swap = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_SPLA,
|
||||
.output_format = ISP32_MI_OUTPUT_YUV420,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV12M,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 2,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_SPLA,
|
||||
.output_format = ISP32_MI_OUTPUT_YUV420,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_YUV420,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 8, 8 },
|
||||
.cplanes = 3,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
|
||||
.output_format = ISP32_MI_OUTPUT_YUV420,
|
||||
},
|
||||
/* yuv444 */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_YUV444M,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 8, 8 },
|
||||
.cplanes = 3,
|
||||
.mplanes = 3,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
|
||||
.output_format = 0,
|
||||
},
|
||||
/* raw */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_SRGGB8,
|
||||
.fmt_type = FMT_BAYER,
|
||||
.bpp = { 8 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
|
||||
.output_format = 0,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_SGRBG8,
|
||||
.fmt_type = FMT_BAYER,
|
||||
.bpp = { 8 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
|
||||
.output_format = 0,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_SGBRG8,
|
||||
.fmt_type = FMT_BAYER,
|
||||
.bpp = { 8 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
|
||||
.output_format = 0,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_SBGGR8,
|
||||
.fmt_type = FMT_BAYER,
|
||||
.bpp = { 8 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
|
||||
.output_format = 0,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_SRGGB10,
|
||||
.fmt_type = FMT_BAYER,
|
||||
.bpp = { 10 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_RAW12,
|
||||
.output_format = 0,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_SGRBG10,
|
||||
.fmt_type = FMT_BAYER,
|
||||
.bpp = { 10 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_RAW12,
|
||||
.output_format = 0,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_SGBRG10,
|
||||
.fmt_type = FMT_BAYER,
|
||||
.bpp = { 10 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_RAW12,
|
||||
.output_format = 0,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_SBGGR10,
|
||||
.fmt_type = FMT_BAYER,
|
||||
.bpp = { 10 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_RAW12,
|
||||
.output_format = 0,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_SRGGB12,
|
||||
.fmt_type = FMT_BAYER,
|
||||
.bpp = { 12 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_RAW12,
|
||||
.output_format = 0,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_SGRBG12,
|
||||
.fmt_type = FMT_BAYER,
|
||||
.bpp = { 12 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_RAW12,
|
||||
.output_format = 0,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_SGBRG12,
|
||||
.fmt_type = FMT_BAYER,
|
||||
.bpp = { 12 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_RAW12,
|
||||
.output_format = 0,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_SBGGR12,
|
||||
.fmt_type = FMT_BAYER,
|
||||
.bpp = { 12 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_RAW12,
|
||||
.output_format = 0,
|
||||
},
|
||||
};
|
||||
|
||||
static const struct capture_fmt sp_fmts[] = {
|
||||
/* yuv422 */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_UYVY,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 16 },
|
||||
.cplanes = 1,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_INT,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV422,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_YUV422P,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 8, 8 },
|
||||
.cplanes = 3,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_PLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV422,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV16,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_SPLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV422,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV61,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 1,
|
||||
.write_format = MI_CTRL_SP_WRITE_SPLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV422,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_YUV422M,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 8, 8 },
|
||||
.cplanes = 3,
|
||||
.mplanes = 3,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_PLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV422,
|
||||
},
|
||||
/* yuv420 */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_NV21,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 1,
|
||||
.write_format = MI_CTRL_SP_WRITE_SPLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV420,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV12,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_SPLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV420,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV21M,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 2,
|
||||
.uv_swap = 1,
|
||||
.write_format = MI_CTRL_SP_WRITE_SPLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV420,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV12M,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 2,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_SPLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV420,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_YUV420,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 8, 8 },
|
||||
.cplanes = 3,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_PLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV420,
|
||||
},
|
||||
/* yuv444 */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_YUV444M,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 8, 8 },
|
||||
.cplanes = 3,
|
||||
.mplanes = 3,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_PLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV444,
|
||||
},
|
||||
/* yuv400 */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_GREY,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8 },
|
||||
.cplanes = 1,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_PLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV400,
|
||||
},
|
||||
/* rgb */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_XBGR32,
|
||||
.fmt_type = FMT_RGB,
|
||||
.bpp = { 32 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_SP_WRITE_PLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_RGB888,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_RGB565,
|
||||
.fmt_type = FMT_RGB,
|
||||
.bpp = { 16 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_SP_WRITE_PLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_RGB565,
|
||||
},
|
||||
/* fbcg */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_FBCG,
|
||||
.fmt_type = FMT_FBCGAIN,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 2,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_SPLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV420,
|
||||
}
|
||||
};
|
||||
static const struct capture_fmt dmatx_fmts[] = {
|
||||
/* raw */
|
||||
{
|
||||
@@ -1655,6 +1994,8 @@ static int rkisp_stream_init(struct rkisp_device *dev, u32 id)
|
||||
sizeof(vdev->name));
|
||||
stream->ops = &rkisp_sp_streams_ops;
|
||||
stream->config = &rkisp_sp_stream_config;
|
||||
stream->config->fmts = sp_fmts;
|
||||
stream->config->fmt_size = ARRAY_SIZE(sp_fmts);
|
||||
break;
|
||||
case RKISP_STREAM_DMATX0:
|
||||
strlcpy(vdev->name, DMATX0_VDEV_NAME,
|
||||
@@ -1685,6 +2026,8 @@ static int rkisp_stream_init(struct rkisp_device *dev, u32 id)
|
||||
sizeof(vdev->name));
|
||||
stream->ops = &rkisp_mp_streams_ops;
|
||||
stream->config = &rkisp_mp_stream_config;
|
||||
stream->config->fmts = mp_fmts;
|
||||
stream->config->fmt_size = ARRAY_SIZE(mp_fmts);
|
||||
}
|
||||
|
||||
node = vdev_to_node(vdev);
|
||||
|
||||
@@ -18,6 +18,345 @@
|
||||
static int mi_frame_end(struct rkisp_stream *stream);
|
||||
static void rkisp_buf_queue(struct vb2_buffer *vb);
|
||||
|
||||
static const struct capture_fmt mp_fmts[] = {
|
||||
/* yuv422 */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_UYVY,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 16 },
|
||||
.cplanes = 1,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUVINT,
|
||||
.output_format = ISP32_MI_OUTPUT_YUV422,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_YUV422P,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 4, 4 },
|
||||
.cplanes = 3,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
|
||||
.output_format = ISP32_MI_OUTPUT_YUV422,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV16,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_SPLA,
|
||||
.output_format = ISP32_MI_OUTPUT_YUV422,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV61,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_SPLA,
|
||||
.output_format = ISP32_MI_OUTPUT_YUV422,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_YUV422M,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 8, 8 },
|
||||
.cplanes = 3,
|
||||
.mplanes = 3,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
|
||||
.output_format = ISP32_MI_OUTPUT_YUV422,
|
||||
},
|
||||
/* yuv420 */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_NV21,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_SPLA,
|
||||
.output_format = ISP32_MI_OUTPUT_YUV420,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV12,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_SPLA,
|
||||
.output_format = ISP32_MI_OUTPUT_YUV420,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV21M,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 2,
|
||||
.uv_swap = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_SPLA,
|
||||
.output_format = ISP32_MI_OUTPUT_YUV420,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV12M,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 2,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_SPLA,
|
||||
.output_format = ISP32_MI_OUTPUT_YUV420,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_YUV420,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 8, 8 },
|
||||
.cplanes = 3,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
|
||||
.output_format = ISP32_MI_OUTPUT_YUV420,
|
||||
},
|
||||
/* yuv444 */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_YUV444M,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 8, 8 },
|
||||
.cplanes = 3,
|
||||
.mplanes = 3,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
|
||||
.output_format = 0,
|
||||
},
|
||||
/* raw */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_SRGGB8,
|
||||
.fmt_type = FMT_BAYER,
|
||||
.bpp = { 8 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
|
||||
.output_format = 0,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_SGRBG8,
|
||||
.fmt_type = FMT_BAYER,
|
||||
.bpp = { 8 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
|
||||
.output_format = 0,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_SGBRG8,
|
||||
.fmt_type = FMT_BAYER,
|
||||
.bpp = { 8 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
|
||||
.output_format = 0,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_SBGGR8,
|
||||
.fmt_type = FMT_BAYER,
|
||||
.bpp = { 8 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
|
||||
.output_format = 0,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_SRGGB10,
|
||||
.fmt_type = FMT_BAYER,
|
||||
.bpp = { 10 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_RAW12,
|
||||
.output_format = 0,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_SGRBG10,
|
||||
.fmt_type = FMT_BAYER,
|
||||
.bpp = { 10 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_RAW12,
|
||||
.output_format = 0,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_SGBRG10,
|
||||
.fmt_type = FMT_BAYER,
|
||||
.bpp = { 10 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_RAW12,
|
||||
.output_format = 0,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_SBGGR10,
|
||||
.fmt_type = FMT_BAYER,
|
||||
.bpp = { 10 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_RAW12,
|
||||
.output_format = 0,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_SRGGB12,
|
||||
.fmt_type = FMT_BAYER,
|
||||
.bpp = { 12 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_RAW12,
|
||||
.output_format = 0,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_SGRBG12,
|
||||
.fmt_type = FMT_BAYER,
|
||||
.bpp = { 12 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_RAW12,
|
||||
.output_format = 0,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_SGBRG12,
|
||||
.fmt_type = FMT_BAYER,
|
||||
.bpp = { 12 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_RAW12,
|
||||
.output_format = 0,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_SBGGR12,
|
||||
.fmt_type = FMT_BAYER,
|
||||
.bpp = { 12 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_RAW12,
|
||||
.output_format = 0,
|
||||
},
|
||||
};
|
||||
|
||||
static const struct capture_fmt sp_fmts[] = {
|
||||
/* yuv422 */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_UYVY,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 16 },
|
||||
.cplanes = 1,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_INT,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV422,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_YUV422P,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 8, 8 },
|
||||
.cplanes = 3,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_PLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV422,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV16,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_SPLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV422,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV61,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 1,
|
||||
.write_format = MI_CTRL_SP_WRITE_SPLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV422,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_YUV422M,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 8, 8 },
|
||||
.cplanes = 3,
|
||||
.mplanes = 3,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_PLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV422,
|
||||
},
|
||||
/* yuv420 */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_NV21,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 1,
|
||||
.write_format = MI_CTRL_SP_WRITE_SPLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV420,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV12,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_SPLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV420,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV21M,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 2,
|
||||
.uv_swap = 1,
|
||||
.write_format = MI_CTRL_SP_WRITE_SPLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV420,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV12M,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 2,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_SPLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV420,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_YUV420,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 8, 8 },
|
||||
.cplanes = 3,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_PLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV420,
|
||||
},
|
||||
/* yuv444 */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_YUV444M,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 8, 8 },
|
||||
.cplanes = 3,
|
||||
.mplanes = 3,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_PLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV444,
|
||||
},
|
||||
/* yuv400 */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_GREY,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8 },
|
||||
.cplanes = 1,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_PLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV400,
|
||||
},
|
||||
/* rgb */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_XBGR32,
|
||||
.fmt_type = FMT_RGB,
|
||||
.bpp = { 32 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_SP_WRITE_PLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_RGB888,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_RGB565,
|
||||
.fmt_type = FMT_RGB,
|
||||
.bpp = { 16 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_SP_WRITE_PLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_RGB565,
|
||||
},
|
||||
/* fbcg */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_FBCG,
|
||||
.fmt_type = FMT_FBCGAIN,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 2,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_SPLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV420,
|
||||
}
|
||||
};
|
||||
static const struct capture_fmt dmatx_fmts[] = {
|
||||
/* raw */
|
||||
{
|
||||
@@ -1449,6 +1788,8 @@ static int rkisp_stream_init(struct rkisp_device *dev, u32 id)
|
||||
sizeof(vdev->name));
|
||||
stream->ops = &rkisp_sp_streams_ops;
|
||||
stream->config = &rkisp_sp_stream_config;
|
||||
stream->config->fmts = sp_fmts;
|
||||
stream->config->fmt_size = ARRAY_SIZE(sp_fmts);
|
||||
break;
|
||||
case RKISP_STREAM_DMATX0:
|
||||
strlcpy(vdev->name, DMATX0_VDEV_NAME,
|
||||
@@ -1473,6 +1814,8 @@ static int rkisp_stream_init(struct rkisp_device *dev, u32 id)
|
||||
sizeof(vdev->name));
|
||||
stream->ops = &rkisp_mp_streams_ops;
|
||||
stream->config = &rkisp_mp_stream_config;
|
||||
stream->config->fmts = mp_fmts;
|
||||
stream->config->fmt_size = ARRAY_SIZE(mp_fmts);
|
||||
}
|
||||
|
||||
node = vdev_to_node(vdev);
|
||||
|
||||
@@ -17,6 +17,173 @@
|
||||
|
||||
static int mi_frame_end(struct rkisp_stream *stream);
|
||||
|
||||
static const struct capture_fmt mp_fmts[] = {
|
||||
/* yuv422 */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_UYVY,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 16 },
|
||||
.cplanes = 1,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUVINT,
|
||||
.output_format = ISP32_MI_OUTPUT_YUV422,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV16,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_SPLA,
|
||||
.output_format = ISP32_MI_OUTPUT_YUV422,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV61,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_SPLA,
|
||||
.output_format = ISP32_MI_OUTPUT_YUV422,
|
||||
},
|
||||
/* yuv420 */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_NV21,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_SPLA,
|
||||
.output_format = ISP32_MI_OUTPUT_YUV420,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV12,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_SPLA,
|
||||
.output_format = ISP32_MI_OUTPUT_YUV420,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV21M,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 2,
|
||||
.uv_swap = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_SPLA,
|
||||
.output_format = ISP32_MI_OUTPUT_YUV420,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV12M,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 2,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_SPLA,
|
||||
.output_format = ISP32_MI_OUTPUT_YUV420,
|
||||
},
|
||||
};
|
||||
|
||||
static const struct capture_fmt sp_fmts[] = {
|
||||
/* yuv422 */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_UYVY,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 16 },
|
||||
.cplanes = 1,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_INT,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV422,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV16,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_SPLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV422,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV61,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 1,
|
||||
.write_format = MI_CTRL_SP_WRITE_SPLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV422,
|
||||
},
|
||||
/* yuv420 */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_NV21,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 1,
|
||||
.write_format = MI_CTRL_SP_WRITE_SPLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV420,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV12,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_SPLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV420,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV21M,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 2,
|
||||
.uv_swap = 1,
|
||||
.write_format = MI_CTRL_SP_WRITE_SPLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV420,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV12M,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 2,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_SPLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV420,
|
||||
},
|
||||
/* yuv400 */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_GREY,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8 },
|
||||
.cplanes = 1,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_PLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV400,
|
||||
},
|
||||
/* rgb */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_XBGR32,
|
||||
.fmt_type = FMT_RGB,
|
||||
.bpp = { 32 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_SP_WRITE_PLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_RGB888,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_RGB565,
|
||||
.fmt_type = FMT_RGB,
|
||||
.bpp = { 16 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_SP_WRITE_PLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_RGB565,
|
||||
},
|
||||
};
|
||||
|
||||
static const struct capture_fmt fbc_fmts[] = {
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_FBC0,
|
||||
@@ -1316,6 +1483,8 @@ static int rkisp_stream_init(struct rkisp_device *dev, u32 id)
|
||||
strscpy(vdev->name, SP_VDEV_NAME, sizeof(vdev->name));
|
||||
stream->ops = &rkisp_sp_streams_ops;
|
||||
stream->config = &rkisp_sp_stream_config;
|
||||
stream->config->fmts = sp_fmts;
|
||||
stream->config->fmt_size = ARRAY_SIZE(sp_fmts);
|
||||
break;
|
||||
case RKISP_STREAM_FBC:
|
||||
strscpy(vdev->name, FBC_VDEV_NAME, sizeof(vdev->name));
|
||||
@@ -1336,6 +1505,8 @@ static int rkisp_stream_init(struct rkisp_device *dev, u32 id)
|
||||
strscpy(vdev->name, MP_VDEV_NAME, sizeof(vdev->name));
|
||||
stream->ops = &rkisp_mp_streams_ops;
|
||||
stream->config = &rkisp_mp_stream_config;
|
||||
stream->config->fmts = mp_fmts;
|
||||
stream->config->fmt_size = ARRAY_SIZE(mp_fmts);
|
||||
if (dev->br_dev.linked)
|
||||
stream->linked = false;
|
||||
}
|
||||
|
||||
@@ -28,6 +28,184 @@ static int mi_frame_end(struct rkisp_stream *stream);
|
||||
static int mi_frame_start(struct rkisp_stream *stream, u32 mis);
|
||||
static int rkisp_create_dummy_buf(struct rkisp_stream *stream);
|
||||
|
||||
static const struct capture_fmt mp_fmts[] = {
|
||||
/* yuv422 */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_UYVY,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 16 },
|
||||
.cplanes = 1,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUVINT,
|
||||
.output_format = ISP32_MI_OUTPUT_YUV422,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV16,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_SPLA,
|
||||
.output_format = ISP32_MI_OUTPUT_YUV422,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV61,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_SPLA,
|
||||
.output_format = ISP32_MI_OUTPUT_YUV422,
|
||||
},
|
||||
/* yuv420 */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_NV21,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_SPLA,
|
||||
.output_format = ISP32_MI_OUTPUT_YUV420,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV12,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_SPLA,
|
||||
.output_format = ISP32_MI_OUTPUT_YUV420,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV21M,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 2,
|
||||
.uv_swap = 1,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_SPLA,
|
||||
.output_format = ISP32_MI_OUTPUT_YUV420,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV12M,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 2,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_MP_WRITE_YUV_SPLA,
|
||||
.output_format = ISP32_MI_OUTPUT_YUV420,
|
||||
},
|
||||
};
|
||||
|
||||
static const struct capture_fmt sp_fmts[] = {
|
||||
/* yuv422 */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_UYVY,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 16 },
|
||||
.cplanes = 1,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_INT,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV422,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV16,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_SPLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV422,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV61,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 1,
|
||||
.write_format = MI_CTRL_SP_WRITE_SPLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV422,
|
||||
},
|
||||
/* yuv420 */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_NV21,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 1,
|
||||
.write_format = MI_CTRL_SP_WRITE_SPLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV420,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV12,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_SPLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV420,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV21M,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 2,
|
||||
.uv_swap = 1,
|
||||
.write_format = MI_CTRL_SP_WRITE_SPLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV420,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_NV12M,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 2,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_SPLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV420,
|
||||
},
|
||||
/* yuv400 */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_GREY,
|
||||
.fmt_type = FMT_YUV,
|
||||
.bpp = { 8 },
|
||||
.cplanes = 1,
|
||||
.mplanes = 1,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_PLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV400,
|
||||
},
|
||||
/* rgb */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_XBGR32,
|
||||
.fmt_type = FMT_RGB,
|
||||
.bpp = { 32 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_SP_WRITE_PLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_RGB888,
|
||||
}, {
|
||||
.fourcc = V4L2_PIX_FMT_RGB565,
|
||||
.fmt_type = FMT_RGB,
|
||||
.bpp = { 16 },
|
||||
.mplanes = 1,
|
||||
.write_format = MI_CTRL_SP_WRITE_PLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_RGB565,
|
||||
},
|
||||
/* fbcg */
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_FBCG,
|
||||
.fmt_type = FMT_FBCGAIN,
|
||||
.bpp = { 8, 16 },
|
||||
.cplanes = 2,
|
||||
.mplanes = 2,
|
||||
.uv_swap = 0,
|
||||
.write_format = MI_CTRL_SP_WRITE_SPLA,
|
||||
.output_format = MI_CTRL_SP_OUTPUT_YUV420,
|
||||
}
|
||||
};
|
||||
|
||||
static const struct capture_fmt bp_fmts[] = {
|
||||
{
|
||||
.fourcc = V4L2_PIX_FMT_UYVY,
|
||||
@@ -1602,6 +1780,8 @@ static int rkisp_stream_init(struct rkisp_device *dev, u32 id)
|
||||
strscpy(vdev->name, SP_VDEV_NAME, sizeof(vdev->name));
|
||||
stream->ops = &rkisp_sp_streams_ops;
|
||||
stream->config = &rkisp_sp_stream_config;
|
||||
stream->config->fmts = sp_fmts;
|
||||
stream->config->fmt_size = ARRAY_SIZE(sp_fmts);
|
||||
break;
|
||||
case RKISP_STREAM_BP:
|
||||
strscpy(vdev->name, BP_VDEV_NAME, sizeof(vdev->name));
|
||||
@@ -1636,6 +1816,8 @@ static int rkisp_stream_init(struct rkisp_device *dev, u32 id)
|
||||
stream->ops = &rkisp_mp_streams_ops;
|
||||
stream->config = &rkisp_mp_stream_config;
|
||||
stream->conn_id = RKISP_STREAM_MPDS;
|
||||
stream->config->fmts = mp_fmts;
|
||||
stream->config->fmt_size = ARRAY_SIZE(mp_fmts);
|
||||
}
|
||||
|
||||
rockit_isp_ops.rkisp_stream_start = rkisp_stream_start;
|
||||
|
||||
Reference in New Issue
Block a user