Commit 2990e3db authored by Dafna Hirschfeld's avatar Dafna Hirschfeld Committed by Mauro Carvalho Chehab

media: staging: rkisp1: replace rkisp1_fmt_pix_type with v4l2_pixel_encoding

The enum rkisp1_fmt_pix_type that holds the pixel format
which is one of RGB, YUV, BAYER, can be replace by the
v4l2 enum v4l2_pixel_encoding.
Signed-off-by: default avatarDafna Hirschfeld <dafna.hirschfeld@collabora.com>
Acked-by: default avatarHelen Koike <helen.koike@collabora.com>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent dd844fb8
...@@ -87,133 +87,133 @@ static const struct rkisp1_capture_fmt_cfg rkisp1_mp_fmts[] = { ...@@ -87,133 +87,133 @@ static const struct rkisp1_capture_fmt_cfg rkisp1_mp_fmts[] = {
/* yuv422 */ /* yuv422 */
{ {
.fourcc = V4L2_PIX_FMT_YUYV, .fourcc = V4L2_PIX_FMT_YUYV,
.fmt_type = RKISP1_FMT_YUV, .fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 0, .uv_swap = 0,
.write_format = RKISP1_MI_CTRL_MP_WRITE_YUVINT, .write_format = RKISP1_MI_CTRL_MP_WRITE_YUVINT,
}, { }, {
.fourcc = V4L2_PIX_FMT_YVYU, .fourcc = V4L2_PIX_FMT_YVYU,
.fmt_type = RKISP1_FMT_YUV, .fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 1, .uv_swap = 1,
.write_format = RKISP1_MI_CTRL_MP_WRITE_YUVINT, .write_format = RKISP1_MI_CTRL_MP_WRITE_YUVINT,
}, { }, {
.fourcc = V4L2_PIX_FMT_VYUY, .fourcc = V4L2_PIX_FMT_VYUY,
.fmt_type = RKISP1_FMT_YUV, .fmt_type = V4L2_PIXEL_ENC_YUV,
.write_format = RKISP1_MI_CTRL_MP_WRITE_YUVINT, .write_format = RKISP1_MI_CTRL_MP_WRITE_YUVINT,
}, { }, {
.fourcc = V4L2_PIX_FMT_YUV422P, .fourcc = V4L2_PIX_FMT_YUV422P,
.fmt_type = RKISP1_FMT_YUV, .fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 0, .uv_swap = 0,
.write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8, .write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
}, { }, {
.fourcc = V4L2_PIX_FMT_NV16, .fourcc = V4L2_PIX_FMT_NV16,
.fmt_type = RKISP1_FMT_YUV, .fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 0, .uv_swap = 0,
.write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_SPLA, .write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_SPLA,
}, { }, {
.fourcc = V4L2_PIX_FMT_NV61, .fourcc = V4L2_PIX_FMT_NV61,
.fmt_type = RKISP1_FMT_YUV, .fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 1, .uv_swap = 1,
.write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_SPLA, .write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_SPLA,
}, { }, {
.fourcc = V4L2_PIX_FMT_YVU422M, .fourcc = V4L2_PIX_FMT_YVU422M,
.fmt_type = RKISP1_FMT_YUV, .fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 1, .uv_swap = 1,
.write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8, .write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
}, },
/* yuv420 */ /* yuv420 */
{ {
.fourcc = V4L2_PIX_FMT_NV21, .fourcc = V4L2_PIX_FMT_NV21,
.fmt_type = RKISP1_FMT_YUV, .fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 1, .uv_swap = 1,
.write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_SPLA, .write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_SPLA,
}, { }, {
.fourcc = V4L2_PIX_FMT_NV12, .fourcc = V4L2_PIX_FMT_NV12,
.fmt_type = RKISP1_FMT_YUV, .fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 0, .uv_swap = 0,
.write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_SPLA, .write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_SPLA,
}, { }, {
.fourcc = V4L2_PIX_FMT_NV21M, .fourcc = V4L2_PIX_FMT_NV21M,
.fmt_type = RKISP1_FMT_YUV, .fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 1, .uv_swap = 1,
.write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_SPLA, .write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_SPLA,
}, { }, {
.fourcc = V4L2_PIX_FMT_NV12M, .fourcc = V4L2_PIX_FMT_NV12M,
.fmt_type = RKISP1_FMT_YUV, .fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 0, .uv_swap = 0,
.write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_SPLA, .write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_SPLA,
}, { }, {
.fourcc = V4L2_PIX_FMT_YUV420, .fourcc = V4L2_PIX_FMT_YUV420,
.fmt_type = RKISP1_FMT_YUV, .fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 0, .uv_swap = 0,
.write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8, .write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
}, { }, {
.fourcc = V4L2_PIX_FMT_YVU420, .fourcc = V4L2_PIX_FMT_YVU420,
.fmt_type = RKISP1_FMT_YUV, .fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 1, .uv_swap = 1,
.write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8, .write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
}, },
/* yuv444 */ /* yuv444 */
{ {
.fourcc = V4L2_PIX_FMT_YUV444M, .fourcc = V4L2_PIX_FMT_YUV444M,
.fmt_type = RKISP1_FMT_YUV, .fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 0, .uv_swap = 0,
.write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8, .write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
}, },
/* yuv400 */ /* yuv400 */
{ {
.fourcc = V4L2_PIX_FMT_GREY, .fourcc = V4L2_PIX_FMT_GREY,
.fmt_type = RKISP1_FMT_YUV, .fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 0, .uv_swap = 0,
.write_format = RKISP1_MI_CTRL_MP_WRITE_YUVINT, .write_format = RKISP1_MI_CTRL_MP_WRITE_YUVINT,
}, },
/* raw */ /* raw */
{ {
.fourcc = V4L2_PIX_FMT_SRGGB8, .fourcc = V4L2_PIX_FMT_SRGGB8,
.fmt_type = RKISP1_FMT_BAYER, .fmt_type = V4L2_PIXEL_ENC_BAYER,
.write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8, .write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
}, { }, {
.fourcc = V4L2_PIX_FMT_SGRBG8, .fourcc = V4L2_PIX_FMT_SGRBG8,
.fmt_type = RKISP1_FMT_BAYER, .fmt_type = V4L2_PIXEL_ENC_BAYER,
.write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8, .write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
}, { }, {
.fourcc = V4L2_PIX_FMT_SGBRG8, .fourcc = V4L2_PIX_FMT_SGBRG8,
.fmt_type = RKISP1_FMT_BAYER, .fmt_type = V4L2_PIXEL_ENC_BAYER,
.write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8, .write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
}, { }, {
.fourcc = V4L2_PIX_FMT_SBGGR8, .fourcc = V4L2_PIX_FMT_SBGGR8,
.fmt_type = RKISP1_FMT_BAYER, .fmt_type = V4L2_PIXEL_ENC_BAYER,
.write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8, .write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
}, { }, {
.fourcc = V4L2_PIX_FMT_SRGGB10, .fourcc = V4L2_PIX_FMT_SRGGB10,
.fmt_type = RKISP1_FMT_BAYER, .fmt_type = V4L2_PIXEL_ENC_BAYER,
.write_format = RKISP1_MI_CTRL_MP_WRITE_RAW12, .write_format = RKISP1_MI_CTRL_MP_WRITE_RAW12,
}, { }, {
.fourcc = V4L2_PIX_FMT_SGRBG10, .fourcc = V4L2_PIX_FMT_SGRBG10,
.fmt_type = RKISP1_FMT_BAYER, .fmt_type = V4L2_PIXEL_ENC_BAYER,
.write_format = RKISP1_MI_CTRL_MP_WRITE_RAW12, .write_format = RKISP1_MI_CTRL_MP_WRITE_RAW12,
}, { }, {
.fourcc = V4L2_PIX_FMT_SGBRG10, .fourcc = V4L2_PIX_FMT_SGBRG10,
.fmt_type = RKISP1_FMT_BAYER, .fmt_type = V4L2_PIXEL_ENC_BAYER,
.write_format = RKISP1_MI_CTRL_MP_WRITE_RAW12, .write_format = RKISP1_MI_CTRL_MP_WRITE_RAW12,
}, { }, {
.fourcc = V4L2_PIX_FMT_SBGGR10, .fourcc = V4L2_PIX_FMT_SBGGR10,
.fmt_type = RKISP1_FMT_BAYER, .fmt_type = V4L2_PIXEL_ENC_BAYER,
.write_format = RKISP1_MI_CTRL_MP_WRITE_RAW12, .write_format = RKISP1_MI_CTRL_MP_WRITE_RAW12,
}, { }, {
.fourcc = V4L2_PIX_FMT_SRGGB12, .fourcc = V4L2_PIX_FMT_SRGGB12,
.fmt_type = RKISP1_FMT_BAYER, .fmt_type = V4L2_PIXEL_ENC_BAYER,
.write_format = RKISP1_MI_CTRL_MP_WRITE_RAW12, .write_format = RKISP1_MI_CTRL_MP_WRITE_RAW12,
}, { }, {
.fourcc = V4L2_PIX_FMT_SGRBG12, .fourcc = V4L2_PIX_FMT_SGRBG12,
.fmt_type = RKISP1_FMT_BAYER, .fmt_type = V4L2_PIXEL_ENC_BAYER,
.write_format = RKISP1_MI_CTRL_MP_WRITE_RAW12, .write_format = RKISP1_MI_CTRL_MP_WRITE_RAW12,
}, { }, {
.fourcc = V4L2_PIX_FMT_SGBRG12, .fourcc = V4L2_PIX_FMT_SGBRG12,
.fmt_type = RKISP1_FMT_BAYER, .fmt_type = V4L2_PIXEL_ENC_BAYER,
.write_format = RKISP1_MI_CTRL_MP_WRITE_RAW12, .write_format = RKISP1_MI_CTRL_MP_WRITE_RAW12,
}, { }, {
.fourcc = V4L2_PIX_FMT_SBGGR12, .fourcc = V4L2_PIX_FMT_SBGGR12,
.fmt_type = RKISP1_FMT_BAYER, .fmt_type = V4L2_PIXEL_ENC_BAYER,
.write_format = RKISP1_MI_CTRL_MP_WRITE_RAW12, .write_format = RKISP1_MI_CTRL_MP_WRITE_RAW12,
}, },
}; };
...@@ -222,43 +222,43 @@ static const struct rkisp1_capture_fmt_cfg rkisp1_sp_fmts[] = { ...@@ -222,43 +222,43 @@ static const struct rkisp1_capture_fmt_cfg rkisp1_sp_fmts[] = {
/* yuv422 */ /* yuv422 */
{ {
.fourcc = V4L2_PIX_FMT_YUYV, .fourcc = V4L2_PIX_FMT_YUYV,
.fmt_type = RKISP1_FMT_YUV, .fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 0, .uv_swap = 0,
.write_format = RKISP1_MI_CTRL_SP_WRITE_INT, .write_format = RKISP1_MI_CTRL_SP_WRITE_INT,
.output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV422, .output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV422,
}, { }, {
.fourcc = V4L2_PIX_FMT_YVYU, .fourcc = V4L2_PIX_FMT_YVYU,
.fmt_type = RKISP1_FMT_YUV, .fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 1, .uv_swap = 1,
.write_format = RKISP1_MI_CTRL_SP_WRITE_INT, .write_format = RKISP1_MI_CTRL_SP_WRITE_INT,
.output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV422, .output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV422,
}, { }, {
.fourcc = V4L2_PIX_FMT_VYUY, .fourcc = V4L2_PIX_FMT_VYUY,
.fmt_type = RKISP1_FMT_YUV, .fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 1, .uv_swap = 1,
.write_format = RKISP1_MI_CTRL_SP_WRITE_INT, .write_format = RKISP1_MI_CTRL_SP_WRITE_INT,
.output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV422, .output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV422,
}, { }, {
.fourcc = V4L2_PIX_FMT_YUV422P, .fourcc = V4L2_PIX_FMT_YUV422P,
.fmt_type = RKISP1_FMT_YUV, .fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 0, .uv_swap = 0,
.write_format = RKISP1_MI_CTRL_SP_WRITE_PLA, .write_format = RKISP1_MI_CTRL_SP_WRITE_PLA,
.output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV422, .output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV422,
}, { }, {
.fourcc = V4L2_PIX_FMT_NV16, .fourcc = V4L2_PIX_FMT_NV16,
.fmt_type = RKISP1_FMT_YUV, .fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 0, .uv_swap = 0,
.write_format = RKISP1_MI_CTRL_SP_WRITE_SPLA, .write_format = RKISP1_MI_CTRL_SP_WRITE_SPLA,
.output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV422, .output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV422,
}, { }, {
.fourcc = V4L2_PIX_FMT_NV61, .fourcc = V4L2_PIX_FMT_NV61,
.fmt_type = RKISP1_FMT_YUV, .fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 1, .uv_swap = 1,
.write_format = RKISP1_MI_CTRL_SP_WRITE_SPLA, .write_format = RKISP1_MI_CTRL_SP_WRITE_SPLA,
.output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV422, .output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV422,
}, { }, {
.fourcc = V4L2_PIX_FMT_YVU422M, .fourcc = V4L2_PIX_FMT_YVU422M,
.fmt_type = RKISP1_FMT_YUV, .fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 1, .uv_swap = 1,
.write_format = RKISP1_MI_CTRL_SP_WRITE_PLA, .write_format = RKISP1_MI_CTRL_SP_WRITE_PLA,
.output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV422, .output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV422,
...@@ -266,37 +266,37 @@ static const struct rkisp1_capture_fmt_cfg rkisp1_sp_fmts[] = { ...@@ -266,37 +266,37 @@ static const struct rkisp1_capture_fmt_cfg rkisp1_sp_fmts[] = {
/* yuv420 */ /* yuv420 */
{ {
.fourcc = V4L2_PIX_FMT_NV21, .fourcc = V4L2_PIX_FMT_NV21,
.fmt_type = RKISP1_FMT_YUV, .fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 1, .uv_swap = 1,
.write_format = RKISP1_MI_CTRL_SP_WRITE_SPLA, .write_format = RKISP1_MI_CTRL_SP_WRITE_SPLA,
.output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV420, .output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV420,
}, { }, {
.fourcc = V4L2_PIX_FMT_NV12, .fourcc = V4L2_PIX_FMT_NV12,
.fmt_type = RKISP1_FMT_YUV, .fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 0, .uv_swap = 0,
.write_format = RKISP1_MI_CTRL_SP_WRITE_SPLA, .write_format = RKISP1_MI_CTRL_SP_WRITE_SPLA,
.output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV420, .output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV420,
}, { }, {
.fourcc = V4L2_PIX_FMT_NV21M, .fourcc = V4L2_PIX_FMT_NV21M,
.fmt_type = RKISP1_FMT_YUV, .fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 1, .uv_swap = 1,
.write_format = RKISP1_MI_CTRL_SP_WRITE_SPLA, .write_format = RKISP1_MI_CTRL_SP_WRITE_SPLA,
.output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV420, .output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV420,
}, { }, {
.fourcc = V4L2_PIX_FMT_NV12M, .fourcc = V4L2_PIX_FMT_NV12M,
.fmt_type = RKISP1_FMT_YUV, .fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 0, .uv_swap = 0,
.write_format = RKISP1_MI_CTRL_SP_WRITE_SPLA, .write_format = RKISP1_MI_CTRL_SP_WRITE_SPLA,
.output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV420, .output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV420,
}, { }, {
.fourcc = V4L2_PIX_FMT_YUV420, .fourcc = V4L2_PIX_FMT_YUV420,
.fmt_type = RKISP1_FMT_YUV, .fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 0, .uv_swap = 0,
.write_format = RKISP1_MI_CTRL_SP_WRITE_PLA, .write_format = RKISP1_MI_CTRL_SP_WRITE_PLA,
.output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV420, .output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV420,
}, { }, {
.fourcc = V4L2_PIX_FMT_YVU420, .fourcc = V4L2_PIX_FMT_YVU420,
.fmt_type = RKISP1_FMT_YUV, .fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 1, .uv_swap = 1,
.write_format = RKISP1_MI_CTRL_SP_WRITE_PLA, .write_format = RKISP1_MI_CTRL_SP_WRITE_PLA,
.output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV420, .output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV420,
...@@ -304,7 +304,7 @@ static const struct rkisp1_capture_fmt_cfg rkisp1_sp_fmts[] = { ...@@ -304,7 +304,7 @@ static const struct rkisp1_capture_fmt_cfg rkisp1_sp_fmts[] = {
/* yuv444 */ /* yuv444 */
{ {
.fourcc = V4L2_PIX_FMT_YUV444M, .fourcc = V4L2_PIX_FMT_YUV444M,
.fmt_type = RKISP1_FMT_YUV, .fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 0, .uv_swap = 0,
.write_format = RKISP1_MI_CTRL_SP_WRITE_PLA, .write_format = RKISP1_MI_CTRL_SP_WRITE_PLA,
.output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV444, .output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV444,
...@@ -312,7 +312,7 @@ static const struct rkisp1_capture_fmt_cfg rkisp1_sp_fmts[] = { ...@@ -312,7 +312,7 @@ static const struct rkisp1_capture_fmt_cfg rkisp1_sp_fmts[] = {
/* yuv400 */ /* yuv400 */
{ {
.fourcc = V4L2_PIX_FMT_GREY, .fourcc = V4L2_PIX_FMT_GREY,
.fmt_type = RKISP1_FMT_YUV, .fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 0, .uv_swap = 0,
.write_format = RKISP1_MI_CTRL_SP_WRITE_INT, .write_format = RKISP1_MI_CTRL_SP_WRITE_INT,
.output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV400, .output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV400,
...@@ -320,17 +320,17 @@ static const struct rkisp1_capture_fmt_cfg rkisp1_sp_fmts[] = { ...@@ -320,17 +320,17 @@ static const struct rkisp1_capture_fmt_cfg rkisp1_sp_fmts[] = {
/* rgb */ /* rgb */
{ {
.fourcc = V4L2_PIX_FMT_RGB24, .fourcc = V4L2_PIX_FMT_RGB24,
.fmt_type = RKISP1_FMT_RGB, .fmt_type = V4L2_PIXEL_ENC_RGB,
.write_format = RKISP1_MI_CTRL_SP_WRITE_PLA, .write_format = RKISP1_MI_CTRL_SP_WRITE_PLA,
.output_format = RKISP1_MI_CTRL_SP_OUTPUT_RGB888, .output_format = RKISP1_MI_CTRL_SP_OUTPUT_RGB888,
}, { }, {
.fourcc = V4L2_PIX_FMT_RGB565, .fourcc = V4L2_PIX_FMT_RGB565,
.fmt_type = RKISP1_FMT_RGB, .fmt_type = V4L2_PIXEL_ENC_RGB,
.write_format = RKISP1_MI_CTRL_SP_WRITE_PLA, .write_format = RKISP1_MI_CTRL_SP_WRITE_PLA,
.output_format = RKISP1_MI_CTRL_SP_OUTPUT_RGB565, .output_format = RKISP1_MI_CTRL_SP_OUTPUT_RGB565,
}, { }, {
.fourcc = V4L2_PIX_FMT_BGR666, .fourcc = V4L2_PIX_FMT_BGR666,
.fmt_type = RKISP1_FMT_RGB, .fmt_type = V4L2_PIXEL_ENC_RGB,
.write_format = RKISP1_MI_CTRL_SP_WRITE_PLA, .write_format = RKISP1_MI_CTRL_SP_WRITE_PLA,
.output_format = RKISP1_MI_CTRL_SP_OUTPUT_RGB666, .output_format = RKISP1_MI_CTRL_SP_OUTPUT_RGB666,
}, },
...@@ -510,7 +510,7 @@ static void rkisp1_mp_enable(struct rkisp1_capture *cap) ...@@ -510,7 +510,7 @@ static void rkisp1_mp_enable(struct rkisp1_capture *cap)
rkisp1_mp_disable(cap); rkisp1_mp_disable(cap);
mi_ctrl = rkisp1_read(cap->rkisp1, RKISP1_CIF_MI_CTRL); mi_ctrl = rkisp1_read(cap->rkisp1, RKISP1_CIF_MI_CTRL);
if (isp_fmt->fmt_type == RKISP1_FMT_BAYER) if (isp_fmt->fmt_type == V4L2_PIXEL_ENC_BAYER)
mi_ctrl |= RKISP1_CIF_MI_CTRL_RAW_ENABLE; mi_ctrl |= RKISP1_CIF_MI_CTRL_RAW_ENABLE;
/* YUV */ /* YUV */
else else
......
...@@ -52,13 +52,6 @@ enum rkisp1_stream_id { ...@@ -52,13 +52,6 @@ enum rkisp1_stream_id {
RKISP1_SELFPATH, RKISP1_SELFPATH,
}; };
enum rkisp1_fmt_pix_type {
RKISP1_FMT_YUV,
RKISP1_FMT_RGB,
RKISP1_FMT_BAYER,
RKISP1_FMT_JPEG,
};
enum rkisp1_fmt_raw_pat_type { enum rkisp1_fmt_raw_pat_type {
RKISP1_RAW_RGGB = 0, RKISP1_RAW_RGGB = 0,
RKISP1_RAW_GRBG, RKISP1_RAW_GRBG,
...@@ -225,7 +218,7 @@ struct rkisp1_resizer { ...@@ -225,7 +218,7 @@ struct rkisp1_resizer {
struct media_pad pads[RKISP1_ISP_PAD_MAX]; struct media_pad pads[RKISP1_ISP_PAD_MAX];
struct v4l2_subdev_pad_config pad_cfg[RKISP1_ISP_PAD_MAX]; struct v4l2_subdev_pad_config pad_cfg[RKISP1_ISP_PAD_MAX];
const struct rkisp1_rsz_config *config; const struct rkisp1_rsz_config *config;
enum rkisp1_fmt_pix_type fmt_type; enum v4l2_pixel_encoding fmt_type;
struct mutex ops_lock; struct mutex ops_lock;
}; };
...@@ -278,7 +271,7 @@ struct rkisp1_device { ...@@ -278,7 +271,7 @@ struct rkisp1_device {
*/ */
struct rkisp1_isp_mbus_info { struct rkisp1_isp_mbus_info {
u32 mbus_code; u32 mbus_code;
enum rkisp1_fmt_pix_type fmt_type; enum v4l2_pixel_encoding fmt_type;
u32 mipi_dt; u32 mipi_dt;
u32 yuv_seq; u32 yuv_seq;
u8 bus_width; u8 bus_width;
......
...@@ -61,116 +61,116 @@ ...@@ -61,116 +61,116 @@
static const struct rkisp1_isp_mbus_info rkisp1_isp_formats[] = { static const struct rkisp1_isp_mbus_info rkisp1_isp_formats[] = {
{ {
.mbus_code = MEDIA_BUS_FMT_YUYV8_2X8, .mbus_code = MEDIA_BUS_FMT_YUYV8_2X8,
.fmt_type = RKISP1_FMT_YUV, .fmt_type = V4L2_PIXEL_ENC_YUV,
.direction = RKISP1_DIR_SRC, .direction = RKISP1_DIR_SRC,
}, { }, {
.mbus_code = MEDIA_BUS_FMT_SRGGB10_1X10, .mbus_code = MEDIA_BUS_FMT_SRGGB10_1X10,
.fmt_type = RKISP1_FMT_BAYER, .fmt_type = V4L2_PIXEL_ENC_BAYER,
.mipi_dt = RKISP1_CIF_CSI2_DT_RAW10, .mipi_dt = RKISP1_CIF_CSI2_DT_RAW10,
.bayer_pat = RKISP1_RAW_RGGB, .bayer_pat = RKISP1_RAW_RGGB,
.bus_width = 10, .bus_width = 10,
.direction = RKISP1_DIR_SINK_SRC, .direction = RKISP1_DIR_SINK_SRC,
}, { }, {
.mbus_code = MEDIA_BUS_FMT_SBGGR10_1X10, .mbus_code = MEDIA_BUS_FMT_SBGGR10_1X10,
.fmt_type = RKISP1_FMT_BAYER, .fmt_type = V4L2_PIXEL_ENC_BAYER,
.mipi_dt = RKISP1_CIF_CSI2_DT_RAW10, .mipi_dt = RKISP1_CIF_CSI2_DT_RAW10,
.bayer_pat = RKISP1_RAW_BGGR, .bayer_pat = RKISP1_RAW_BGGR,
.bus_width = 10, .bus_width = 10,
.direction = RKISP1_DIR_SINK_SRC, .direction = RKISP1_DIR_SINK_SRC,
}, { }, {
.mbus_code = MEDIA_BUS_FMT_SGBRG10_1X10, .mbus_code = MEDIA_BUS_FMT_SGBRG10_1X10,
.fmt_type = RKISP1_FMT_BAYER, .fmt_type = V4L2_PIXEL_ENC_BAYER,
.mipi_dt = RKISP1_CIF_CSI2_DT_RAW10, .mipi_dt = RKISP1_CIF_CSI2_DT_RAW10,
.bayer_pat = RKISP1_RAW_GBRG, .bayer_pat = RKISP1_RAW_GBRG,
.bus_width = 10, .bus_width = 10,
.direction = RKISP1_DIR_SINK_SRC, .direction = RKISP1_DIR_SINK_SRC,
}, { }, {
.mbus_code = MEDIA_BUS_FMT_SGRBG10_1X10, .mbus_code = MEDIA_BUS_FMT_SGRBG10_1X10,
.fmt_type = RKISP1_FMT_BAYER, .fmt_type = V4L2_PIXEL_ENC_BAYER,
.mipi_dt = RKISP1_CIF_CSI2_DT_RAW10, .mipi_dt = RKISP1_CIF_CSI2_DT_RAW10,
.bayer_pat = RKISP1_RAW_GRBG, .bayer_pat = RKISP1_RAW_GRBG,
.bus_width = 10, .bus_width = 10,
.direction = RKISP1_DIR_SINK_SRC, .direction = RKISP1_DIR_SINK_SRC,
}, { }, {
.mbus_code = MEDIA_BUS_FMT_SRGGB12_1X12, .mbus_code = MEDIA_BUS_FMT_SRGGB12_1X12,
.fmt_type = RKISP1_FMT_BAYER, .fmt_type = V4L2_PIXEL_ENC_BAYER,
.mipi_dt = RKISP1_CIF_CSI2_DT_RAW12, .mipi_dt = RKISP1_CIF_CSI2_DT_RAW12,
.bayer_pat = RKISP1_RAW_RGGB, .bayer_pat = RKISP1_RAW_RGGB,
.bus_width = 12, .bus_width = 12,
.direction = RKISP1_DIR_SINK_SRC, .direction = RKISP1_DIR_SINK_SRC,
}, { }, {
.mbus_code = MEDIA_BUS_FMT_SBGGR12_1X12, .mbus_code = MEDIA_BUS_FMT_SBGGR12_1X12,
.fmt_type = RKISP1_FMT_BAYER, .fmt_type = V4L2_PIXEL_ENC_BAYER,
.mipi_dt = RKISP1_CIF_CSI2_DT_RAW12, .mipi_dt = RKISP1_CIF_CSI2_DT_RAW12,
.bayer_pat = RKISP1_RAW_BGGR, .bayer_pat = RKISP1_RAW_BGGR,
.bus_width = 12, .bus_width = 12,
.direction = RKISP1_DIR_SINK_SRC, .direction = RKISP1_DIR_SINK_SRC,
}, { }, {
.mbus_code = MEDIA_BUS_FMT_SGBRG12_1X12, .mbus_code = MEDIA_BUS_FMT_SGBRG12_1X12,
.fmt_type = RKISP1_FMT_BAYER, .fmt_type = V4L2_PIXEL_ENC_BAYER,
.mipi_dt = RKISP1_CIF_CSI2_DT_RAW12, .mipi_dt = RKISP1_CIF_CSI2_DT_RAW12,
.bayer_pat = RKISP1_RAW_GBRG, .bayer_pat = RKISP1_RAW_GBRG,
.bus_width = 12, .bus_width = 12,
.direction = RKISP1_DIR_SINK_SRC, .direction = RKISP1_DIR_SINK_SRC,
}, { }, {
.mbus_code = MEDIA_BUS_FMT_SGRBG12_1X12, .mbus_code = MEDIA_BUS_FMT_SGRBG12_1X12,
.fmt_type = RKISP1_FMT_BAYER, .fmt_type = V4L2_PIXEL_ENC_BAYER,
.mipi_dt = RKISP1_CIF_CSI2_DT_RAW12, .mipi_dt = RKISP1_CIF_CSI2_DT_RAW12,
.bayer_pat = RKISP1_RAW_GRBG, .bayer_pat = RKISP1_RAW_GRBG,
.bus_width = 12, .bus_width = 12,
.direction = RKISP1_DIR_SINK_SRC, .direction = RKISP1_DIR_SINK_SRC,
}, { }, {
.mbus_code = MEDIA_BUS_FMT_SRGGB8_1X8, .mbus_code = MEDIA_BUS_FMT_SRGGB8_1X8,
.fmt_type = RKISP1_FMT_BAYER, .fmt_type = V4L2_PIXEL_ENC_BAYER,
.mipi_dt = RKISP1_CIF_CSI2_DT_RAW8, .mipi_dt = RKISP1_CIF_CSI2_DT_RAW8,
.bayer_pat = RKISP1_RAW_RGGB, .bayer_pat = RKISP1_RAW_RGGB,
.bus_width = 8, .bus_width = 8,
.direction = RKISP1_DIR_SINK_SRC, .direction = RKISP1_DIR_SINK_SRC,
}, { }, {
.mbus_code = MEDIA_BUS_FMT_SBGGR8_1X8, .mbus_code = MEDIA_BUS_FMT_SBGGR8_1X8,
.fmt_type = RKISP1_FMT_BAYER, .fmt_type = V4L2_PIXEL_ENC_BAYER,
.mipi_dt = RKISP1_CIF_CSI2_DT_RAW8, .mipi_dt = RKISP1_CIF_CSI2_DT_RAW8,
.bayer_pat = RKISP1_RAW_BGGR, .bayer_pat = RKISP1_RAW_BGGR,
.bus_width = 8, .bus_width = 8,
.direction = RKISP1_DIR_SINK_SRC, .direction = RKISP1_DIR_SINK_SRC,
}, { }, {
.mbus_code = MEDIA_BUS_FMT_SGBRG8_1X8, .mbus_code = MEDIA_BUS_FMT_SGBRG8_1X8,
.fmt_type = RKISP1_FMT_BAYER, .fmt_type = V4L2_PIXEL_ENC_BAYER,
.mipi_dt = RKISP1_CIF_CSI2_DT_RAW8, .mipi_dt = RKISP1_CIF_CSI2_DT_RAW8,
.bayer_pat = RKISP1_RAW_GBRG, .bayer_pat = RKISP1_RAW_GBRG,
.bus_width = 8, .bus_width = 8,
.direction = RKISP1_DIR_SINK_SRC, .direction = RKISP1_DIR_SINK_SRC,
}, { }, {
.mbus_code = MEDIA_BUS_FMT_SGRBG8_1X8, .mbus_code = MEDIA_BUS_FMT_SGRBG8_1X8,
.fmt_type = RKISP1_FMT_BAYER, .fmt_type = V4L2_PIXEL_ENC_BAYER,
.mipi_dt = RKISP1_CIF_CSI2_DT_RAW8, .mipi_dt = RKISP1_CIF_CSI2_DT_RAW8,
.bayer_pat = RKISP1_RAW_GRBG, .bayer_pat = RKISP1_RAW_GRBG,
.bus_width = 8, .bus_width = 8,
.direction = RKISP1_DIR_SINK_SRC, .direction = RKISP1_DIR_SINK_SRC,
}, { }, {
.mbus_code = MEDIA_BUS_FMT_YUYV8_1X16, .mbus_code = MEDIA_BUS_FMT_YUYV8_1X16,
.fmt_type = RKISP1_FMT_YUV, .fmt_type = V4L2_PIXEL_ENC_YUV,
.mipi_dt = RKISP1_CIF_CSI2_DT_YUV422_8b, .mipi_dt = RKISP1_CIF_CSI2_DT_YUV422_8b,
.yuv_seq = RKISP1_CIF_ISP_ACQ_PROP_YCBYCR, .yuv_seq = RKISP1_CIF_ISP_ACQ_PROP_YCBYCR,
.bus_width = 16, .bus_width = 16,
.direction = RKISP1_DIR_SINK, .direction = RKISP1_DIR_SINK,
}, { }, {
.mbus_code = MEDIA_BUS_FMT_YVYU8_1X16, .mbus_code = MEDIA_BUS_FMT_YVYU8_1X16,
.fmt_type = RKISP1_FMT_YUV, .fmt_type = V4L2_PIXEL_ENC_YUV,
.mipi_dt = RKISP1_CIF_CSI2_DT_YUV422_8b, .mipi_dt = RKISP1_CIF_CSI2_DT_YUV422_8b,
.yuv_seq = RKISP1_CIF_ISP_ACQ_PROP_YCRYCB, .yuv_seq = RKISP1_CIF_ISP_ACQ_PROP_YCRYCB,
.bus_width = 16, .bus_width = 16,
.direction = RKISP1_DIR_SINK, .direction = RKISP1_DIR_SINK,
}, { }, {
.mbus_code = MEDIA_BUS_FMT_UYVY8_1X16, .mbus_code = MEDIA_BUS_FMT_UYVY8_1X16,
.fmt_type = RKISP1_FMT_YUV, .fmt_type = V4L2_PIXEL_ENC_YUV,
.mipi_dt = RKISP1_CIF_CSI2_DT_YUV422_8b, .mipi_dt = RKISP1_CIF_CSI2_DT_YUV422_8b,
.yuv_seq = RKISP1_CIF_ISP_ACQ_PROP_CBYCRY, .yuv_seq = RKISP1_CIF_ISP_ACQ_PROP_CBYCRY,
.bus_width = 16, .bus_width = 16,
.direction = RKISP1_DIR_SINK, .direction = RKISP1_DIR_SINK,
}, { }, {
.mbus_code = MEDIA_BUS_FMT_VYUY8_1X16, .mbus_code = MEDIA_BUS_FMT_VYUY8_1X16,
.fmt_type = RKISP1_FMT_YUV, .fmt_type = V4L2_PIXEL_ENC_YUV,
.mipi_dt = RKISP1_CIF_CSI2_DT_YUV422_8b, .mipi_dt = RKISP1_CIF_CSI2_DT_YUV422_8b,
.yuv_seq = RKISP1_CIF_ISP_ACQ_PROP_CRYCBY, .yuv_seq = RKISP1_CIF_ISP_ACQ_PROP_CRYCBY,
.bus_width = 16, .bus_width = 16,
...@@ -288,9 +288,9 @@ static int rkisp1_config_isp(struct rkisp1_device *rkisp1) ...@@ -288,9 +288,9 @@ static int rkisp1_config_isp(struct rkisp1_device *rkisp1)
RKISP1_ISP_PAD_SINK_VIDEO, RKISP1_ISP_PAD_SINK_VIDEO,
V4L2_SUBDEV_FORMAT_ACTIVE); V4L2_SUBDEV_FORMAT_ACTIVE);
if (sink_fmt->fmt_type == RKISP1_FMT_BAYER) { if (sink_fmt->fmt_type == V4L2_PIXEL_ENC_BAYER) {
acq_mult = 1; acq_mult = 1;
if (src_fmt->fmt_type == RKISP1_FMT_BAYER) { if (src_fmt->fmt_type == V4L2_PIXEL_ENC_BAYER) {
if (sensor->mbus.type == V4L2_MBUS_BT656) if (sensor->mbus.type == V4L2_MBUS_BT656)
isp_ctrl = RKISP1_CIF_ISP_CTRL_ISP_MODE_RAW_PICT_ITU656; isp_ctrl = RKISP1_CIF_ISP_CTRL_ISP_MODE_RAW_PICT_ITU656;
else else
...@@ -304,7 +304,7 @@ static int rkisp1_config_isp(struct rkisp1_device *rkisp1) ...@@ -304,7 +304,7 @@ static int rkisp1_config_isp(struct rkisp1_device *rkisp1)
else else
isp_ctrl = RKISP1_CIF_ISP_CTRL_ISP_MODE_BAYER_ITU601; isp_ctrl = RKISP1_CIF_ISP_CTRL_ISP_MODE_BAYER_ITU601;
} }
} else if (sink_fmt->fmt_type == RKISP1_FMT_YUV) { } else if (sink_fmt->fmt_type == V4L2_PIXEL_ENC_YUV) {
acq_mult = 2; acq_mult = 2;
if (sensor->mbus.type == V4L2_MBUS_CSI2_DPHY) { if (sensor->mbus.type == V4L2_MBUS_CSI2_DPHY) {
isp_ctrl = RKISP1_CIF_ISP_CTRL_ISP_MODE_ITU601; isp_ctrl = RKISP1_CIF_ISP_CTRL_ISP_MODE_ITU601;
...@@ -357,7 +357,7 @@ static int rkisp1_config_isp(struct rkisp1_device *rkisp1) ...@@ -357,7 +357,7 @@ static int rkisp1_config_isp(struct rkisp1_device *rkisp1)
RKISP1_CIF_ISP_PIC_SIZE_ERROR | RKISP1_CIF_ISP_FRAME_IN; RKISP1_CIF_ISP_PIC_SIZE_ERROR | RKISP1_CIF_ISP_FRAME_IN;
rkisp1_write(rkisp1, irq_mask, RKISP1_CIF_ISP_IMSC); rkisp1_write(rkisp1, irq_mask, RKISP1_CIF_ISP_IMSC);
if (src_fmt->fmt_type == RKISP1_FMT_BAYER) { if (src_fmt->fmt_type == V4L2_PIXEL_ENC_BAYER) {
rkisp1_params_disable(&rkisp1->params); rkisp1_params_disable(&rkisp1->params);
} else { } else {
struct v4l2_mbus_framefmt *src_frm; struct v4l2_mbus_framefmt *src_frm;
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#define RKISP1_RSZ_MP_DEV_NAME RKISP1_DRIVER_NAME "_resizer_mainpath" #define RKISP1_RSZ_MP_DEV_NAME RKISP1_DRIVER_NAME "_resizer_mainpath"
#define RKISP1_DEF_FMT MEDIA_BUS_FMT_YUYV8_2X8 #define RKISP1_DEF_FMT MEDIA_BUS_FMT_YUYV8_2X8
#define RKISP1_DEF_FMT_TYPE RKISP1_FMT_YUV #define RKISP1_DEF_FMT_TYPE V4L2_PIXEL_ENC_YUV
#define RKISP1_MBUS_FMT_HDIV 2 #define RKISP1_MBUS_FMT_HDIV 2
#define RKISP1_MBUS_FMT_VDIV 1 #define RKISP1_MBUS_FMT_VDIV 1
...@@ -371,7 +371,7 @@ static void rkisp1_rsz_config(struct rkisp1_resizer *rsz, ...@@ -371,7 +371,7 @@ static void rkisp1_rsz_config(struct rkisp1_resizer *rsz,
src_fmt = rkisp1_rsz_get_pad_fmt(rsz, NULL, RKISP1_RSZ_PAD_SRC, src_fmt = rkisp1_rsz_get_pad_fmt(rsz, NULL, RKISP1_RSZ_PAD_SRC,
V4L2_SUBDEV_FORMAT_ACTIVE); V4L2_SUBDEV_FORMAT_ACTIVE);
if (rsz->fmt_type == RKISP1_FMT_BAYER) { if (rsz->fmt_type == V4L2_PIXEL_ENC_BAYER) {
rkisp1_rsz_disable(rsz, when); rkisp1_rsz_disable(rsz, when);
return; return;
} }
...@@ -384,7 +384,7 @@ static void rkisp1_rsz_config(struct rkisp1_resizer *rsz, ...@@ -384,7 +384,7 @@ static void rkisp1_rsz_config(struct rkisp1_resizer *rsz,
sink_c.width = sink_y.width / RKISP1_MBUS_FMT_HDIV; sink_c.width = sink_y.width / RKISP1_MBUS_FMT_HDIV;
sink_c.height = sink_y.height / RKISP1_MBUS_FMT_VDIV; sink_c.height = sink_y.height / RKISP1_MBUS_FMT_VDIV;
if (rsz->fmt_type == RKISP1_FMT_YUV) { if (rsz->fmt_type == V4L2_PIXEL_ENC_YUV) {
struct rkisp1_capture *cap = struct rkisp1_capture *cap =
&rsz->rkisp1->capture_devs[rsz->id]; &rsz->rkisp1->capture_devs[rsz->id];
const struct v4l2_format_info *pixfmt_info = const struct v4l2_format_info *pixfmt_info =
...@@ -498,7 +498,7 @@ static void rkisp1_rsz_set_sink_crop(struct rkisp1_resizer *rsz, ...@@ -498,7 +498,7 @@ static void rkisp1_rsz_set_sink_crop(struct rkisp1_resizer *rsz,
mbus_info = rkisp1_isp_mbus_info_get(sink_fmt->code); mbus_info = rkisp1_isp_mbus_info_get(sink_fmt->code);
if (rsz->id == RKISP1_MAINPATH && if (rsz->id == RKISP1_MAINPATH &&
mbus_info->fmt_type == RKISP1_FMT_BAYER) { mbus_info->fmt_type == V4L2_PIXEL_ENC_BAYER) {
sink_crop->left = 0; sink_crop->left = 0;
sink_crop->top = 0; sink_crop->top = 0;
sink_crop->width = sink_fmt->width; sink_crop->width = sink_fmt->width;
......
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