Commit ad3b81fa authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Mauro Carvalho Chehab

[media] soc-camera: Add plane layout information to struct soc_mbus_pixelfmt

To compute the value of the v4l2_pix_format::bytesperline field, we need
information about planes layout for planar formats. The new enum
soc_mbus_layout conveys that information.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 1c0f95ee
...@@ -627,6 +627,7 @@ static const struct soc_mbus_pixelfmt isi_camera_formats[] = { ...@@ -627,6 +627,7 @@ static const struct soc_mbus_pixelfmt isi_camera_formats[] = {
.bits_per_sample = 8, .bits_per_sample = 8,
.packing = SOC_MBUS_PACKING_2X8_PADHI, .packing = SOC_MBUS_PACKING_2X8_PADHI,
.order = SOC_MBUS_ORDER_LE, .order = SOC_MBUS_ORDER_LE,
.layout = SOC_MBUS_LAYOUT_PACKED,
}, },
}; };
......
...@@ -637,12 +637,14 @@ static const struct soc_mbus_pixelfmt mx3_camera_formats[] = { ...@@ -637,12 +637,14 @@ static const struct soc_mbus_pixelfmt mx3_camera_formats[] = {
.bits_per_sample = 8, .bits_per_sample = 8,
.packing = SOC_MBUS_PACKING_NONE, .packing = SOC_MBUS_PACKING_NONE,
.order = SOC_MBUS_ORDER_LE, .order = SOC_MBUS_ORDER_LE,
.layout = SOC_MBUS_LAYOUT_PACKED,
}, { }, {
.fourcc = V4L2_PIX_FMT_GREY, .fourcc = V4L2_PIX_FMT_GREY,
.name = "Monochrome 8 bit", .name = "Monochrome 8 bit",
.bits_per_sample = 8, .bits_per_sample = 8,
.packing = SOC_MBUS_PACKING_NONE, .packing = SOC_MBUS_PACKING_NONE,
.order = SOC_MBUS_ORDER_LE, .order = SOC_MBUS_ORDER_LE,
.layout = SOC_MBUS_LAYOUT_PACKED,
}, },
}; };
......
...@@ -989,6 +989,7 @@ static const struct soc_mbus_lookup omap1_cam_formats[] = { ...@@ -989,6 +989,7 @@ static const struct soc_mbus_lookup omap1_cam_formats[] = {
.bits_per_sample = 8, .bits_per_sample = 8,
.packing = SOC_MBUS_PACKING_2X8_PADHI, .packing = SOC_MBUS_PACKING_2X8_PADHI,
.order = SOC_MBUS_ORDER_BE, .order = SOC_MBUS_ORDER_BE,
.layout = SOC_MBUS_LAYOUT_PACKED,
}, },
}, { }, {
.code = V4L2_MBUS_FMT_VYUY8_2X8, .code = V4L2_MBUS_FMT_VYUY8_2X8,
...@@ -998,6 +999,7 @@ static const struct soc_mbus_lookup omap1_cam_formats[] = { ...@@ -998,6 +999,7 @@ static const struct soc_mbus_lookup omap1_cam_formats[] = {
.bits_per_sample = 8, .bits_per_sample = 8,
.packing = SOC_MBUS_PACKING_2X8_PADHI, .packing = SOC_MBUS_PACKING_2X8_PADHI,
.order = SOC_MBUS_ORDER_BE, .order = SOC_MBUS_ORDER_BE,
.layout = SOC_MBUS_LAYOUT_PACKED,
}, },
}, { }, {
.code = V4L2_MBUS_FMT_YUYV8_2X8, .code = V4L2_MBUS_FMT_YUYV8_2X8,
...@@ -1007,6 +1009,7 @@ static const struct soc_mbus_lookup omap1_cam_formats[] = { ...@@ -1007,6 +1009,7 @@ static const struct soc_mbus_lookup omap1_cam_formats[] = {
.bits_per_sample = 8, .bits_per_sample = 8,
.packing = SOC_MBUS_PACKING_2X8_PADHI, .packing = SOC_MBUS_PACKING_2X8_PADHI,
.order = SOC_MBUS_ORDER_BE, .order = SOC_MBUS_ORDER_BE,
.layout = SOC_MBUS_LAYOUT_PACKED,
}, },
}, { }, {
.code = V4L2_MBUS_FMT_YVYU8_2X8, .code = V4L2_MBUS_FMT_YVYU8_2X8,
...@@ -1016,6 +1019,7 @@ static const struct soc_mbus_lookup omap1_cam_formats[] = { ...@@ -1016,6 +1019,7 @@ static const struct soc_mbus_lookup omap1_cam_formats[] = {
.bits_per_sample = 8, .bits_per_sample = 8,
.packing = SOC_MBUS_PACKING_2X8_PADHI, .packing = SOC_MBUS_PACKING_2X8_PADHI,
.order = SOC_MBUS_ORDER_BE, .order = SOC_MBUS_ORDER_BE,
.layout = SOC_MBUS_LAYOUT_PACKED,
}, },
}, { }, {
.code = V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE, .code = V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE,
...@@ -1025,6 +1029,7 @@ static const struct soc_mbus_lookup omap1_cam_formats[] = { ...@@ -1025,6 +1029,7 @@ static const struct soc_mbus_lookup omap1_cam_formats[] = {
.bits_per_sample = 8, .bits_per_sample = 8,
.packing = SOC_MBUS_PACKING_2X8_PADHI, .packing = SOC_MBUS_PACKING_2X8_PADHI,
.order = SOC_MBUS_ORDER_BE, .order = SOC_MBUS_ORDER_BE,
.layout = SOC_MBUS_LAYOUT_PACKED,
}, },
}, { }, {
.code = V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE, .code = V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE,
...@@ -1034,6 +1039,7 @@ static const struct soc_mbus_lookup omap1_cam_formats[] = { ...@@ -1034,6 +1039,7 @@ static const struct soc_mbus_lookup omap1_cam_formats[] = {
.bits_per_sample = 8, .bits_per_sample = 8,
.packing = SOC_MBUS_PACKING_2X8_PADHI, .packing = SOC_MBUS_PACKING_2X8_PADHI,
.order = SOC_MBUS_ORDER_BE, .order = SOC_MBUS_ORDER_BE,
.layout = SOC_MBUS_LAYOUT_PACKED,
}, },
}, { }, {
.code = V4L2_MBUS_FMT_RGB565_2X8_BE, .code = V4L2_MBUS_FMT_RGB565_2X8_BE,
...@@ -1043,6 +1049,7 @@ static const struct soc_mbus_lookup omap1_cam_formats[] = { ...@@ -1043,6 +1049,7 @@ static const struct soc_mbus_lookup omap1_cam_formats[] = {
.bits_per_sample = 8, .bits_per_sample = 8,
.packing = SOC_MBUS_PACKING_2X8_PADHI, .packing = SOC_MBUS_PACKING_2X8_PADHI,
.order = SOC_MBUS_ORDER_BE, .order = SOC_MBUS_ORDER_BE,
.layout = SOC_MBUS_LAYOUT_PACKED,
}, },
}, { }, {
.code = V4L2_MBUS_FMT_RGB565_2X8_LE, .code = V4L2_MBUS_FMT_RGB565_2X8_LE,
...@@ -1052,6 +1059,7 @@ static const struct soc_mbus_lookup omap1_cam_formats[] = { ...@@ -1052,6 +1059,7 @@ static const struct soc_mbus_lookup omap1_cam_formats[] = {
.bits_per_sample = 8, .bits_per_sample = 8,
.packing = SOC_MBUS_PACKING_2X8_PADHI, .packing = SOC_MBUS_PACKING_2X8_PADHI,
.order = SOC_MBUS_ORDER_BE, .order = SOC_MBUS_ORDER_BE,
.layout = SOC_MBUS_LAYOUT_PACKED,
}, },
}, },
}; };
......
...@@ -1234,6 +1234,7 @@ static const struct soc_mbus_pixelfmt pxa_camera_formats[] = { ...@@ -1234,6 +1234,7 @@ static const struct soc_mbus_pixelfmt pxa_camera_formats[] = {
.bits_per_sample = 8, .bits_per_sample = 8,
.packing = SOC_MBUS_PACKING_2X8_PADHI, .packing = SOC_MBUS_PACKING_2X8_PADHI,
.order = SOC_MBUS_ORDER_LE, .order = SOC_MBUS_ORDER_LE,
.layout = SOC_MBUS_LAYOUT_PLANAR_2Y_U_V,
}, },
}; };
......
...@@ -955,24 +955,28 @@ static const struct soc_mbus_pixelfmt sh_mobile_ceu_formats[] = { ...@@ -955,24 +955,28 @@ static const struct soc_mbus_pixelfmt sh_mobile_ceu_formats[] = {
.bits_per_sample = 8, .bits_per_sample = 8,
.packing = SOC_MBUS_PACKING_1_5X8, .packing = SOC_MBUS_PACKING_1_5X8,
.order = SOC_MBUS_ORDER_LE, .order = SOC_MBUS_ORDER_LE,
.layout = SOC_MBUS_LAYOUT_PLANAR_2Y_C,
}, { }, {
.fourcc = V4L2_PIX_FMT_NV21, .fourcc = V4L2_PIX_FMT_NV21,
.name = "NV21", .name = "NV21",
.bits_per_sample = 8, .bits_per_sample = 8,
.packing = SOC_MBUS_PACKING_1_5X8, .packing = SOC_MBUS_PACKING_1_5X8,
.order = SOC_MBUS_ORDER_LE, .order = SOC_MBUS_ORDER_LE,
.layout = SOC_MBUS_LAYOUT_PLANAR_2Y_C,
}, { }, {
.fourcc = V4L2_PIX_FMT_NV16, .fourcc = V4L2_PIX_FMT_NV16,
.name = "NV16", .name = "NV16",
.bits_per_sample = 8, .bits_per_sample = 8,
.packing = SOC_MBUS_PACKING_2X8_PADHI, .packing = SOC_MBUS_PACKING_2X8_PADHI,
.order = SOC_MBUS_ORDER_LE, .order = SOC_MBUS_ORDER_LE,
.layout = SOC_MBUS_LAYOUT_PLANAR_Y_C,
}, { }, {
.fourcc = V4L2_PIX_FMT_NV61, .fourcc = V4L2_PIX_FMT_NV61,
.name = "NV61", .name = "NV61",
.bits_per_sample = 8, .bits_per_sample = 8,
.packing = SOC_MBUS_PACKING_2X8_PADHI, .packing = SOC_MBUS_PACKING_2X8_PADHI,
.order = SOC_MBUS_ORDER_LE, .order = SOC_MBUS_ORDER_LE,
.layout = SOC_MBUS_LAYOUT_PLANAR_Y_C,
}, },
}; };
......
...@@ -24,6 +24,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { ...@@ -24,6 +24,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
.bits_per_sample = 8, .bits_per_sample = 8,
.packing = SOC_MBUS_PACKING_2X8_PADHI, .packing = SOC_MBUS_PACKING_2X8_PADHI,
.order = SOC_MBUS_ORDER_LE, .order = SOC_MBUS_ORDER_LE,
.layout = SOC_MBUS_LAYOUT_PACKED,
}, },
}, { }, {
.code = V4L2_MBUS_FMT_YVYU8_2X8, .code = V4L2_MBUS_FMT_YVYU8_2X8,
...@@ -33,6 +34,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { ...@@ -33,6 +34,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
.bits_per_sample = 8, .bits_per_sample = 8,
.packing = SOC_MBUS_PACKING_2X8_PADHI, .packing = SOC_MBUS_PACKING_2X8_PADHI,
.order = SOC_MBUS_ORDER_LE, .order = SOC_MBUS_ORDER_LE,
.layout = SOC_MBUS_LAYOUT_PACKED,
}, },
}, { }, {
.code = V4L2_MBUS_FMT_UYVY8_2X8, .code = V4L2_MBUS_FMT_UYVY8_2X8,
...@@ -42,6 +44,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { ...@@ -42,6 +44,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
.bits_per_sample = 8, .bits_per_sample = 8,
.packing = SOC_MBUS_PACKING_2X8_PADHI, .packing = SOC_MBUS_PACKING_2X8_PADHI,
.order = SOC_MBUS_ORDER_LE, .order = SOC_MBUS_ORDER_LE,
.layout = SOC_MBUS_LAYOUT_PACKED,
}, },
}, { }, {
.code = V4L2_MBUS_FMT_VYUY8_2X8, .code = V4L2_MBUS_FMT_VYUY8_2X8,
...@@ -51,6 +54,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { ...@@ -51,6 +54,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
.bits_per_sample = 8, .bits_per_sample = 8,
.packing = SOC_MBUS_PACKING_2X8_PADHI, .packing = SOC_MBUS_PACKING_2X8_PADHI,
.order = SOC_MBUS_ORDER_LE, .order = SOC_MBUS_ORDER_LE,
.layout = SOC_MBUS_LAYOUT_PACKED,
}, },
}, { }, {
.code = V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE, .code = V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE,
...@@ -60,6 +64,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { ...@@ -60,6 +64,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
.bits_per_sample = 8, .bits_per_sample = 8,
.packing = SOC_MBUS_PACKING_2X8_PADHI, .packing = SOC_MBUS_PACKING_2X8_PADHI,
.order = SOC_MBUS_ORDER_LE, .order = SOC_MBUS_ORDER_LE,
.layout = SOC_MBUS_LAYOUT_PACKED,
}, },
}, { }, {
.code = V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE, .code = V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE,
...@@ -69,6 +74,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { ...@@ -69,6 +74,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
.bits_per_sample = 8, .bits_per_sample = 8,
.packing = SOC_MBUS_PACKING_2X8_PADHI, .packing = SOC_MBUS_PACKING_2X8_PADHI,
.order = SOC_MBUS_ORDER_LE, .order = SOC_MBUS_ORDER_LE,
.layout = SOC_MBUS_LAYOUT_PACKED,
}, },
}, { }, {
.code = V4L2_MBUS_FMT_RGB565_2X8_LE, .code = V4L2_MBUS_FMT_RGB565_2X8_LE,
...@@ -78,6 +84,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { ...@@ -78,6 +84,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
.bits_per_sample = 8, .bits_per_sample = 8,
.packing = SOC_MBUS_PACKING_2X8_PADHI, .packing = SOC_MBUS_PACKING_2X8_PADHI,
.order = SOC_MBUS_ORDER_LE, .order = SOC_MBUS_ORDER_LE,
.layout = SOC_MBUS_LAYOUT_PACKED,
}, },
}, { }, {
.code = V4L2_MBUS_FMT_RGB565_2X8_BE, .code = V4L2_MBUS_FMT_RGB565_2X8_BE,
...@@ -87,6 +94,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { ...@@ -87,6 +94,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
.bits_per_sample = 8, .bits_per_sample = 8,
.packing = SOC_MBUS_PACKING_2X8_PADHI, .packing = SOC_MBUS_PACKING_2X8_PADHI,
.order = SOC_MBUS_ORDER_LE, .order = SOC_MBUS_ORDER_LE,
.layout = SOC_MBUS_LAYOUT_PACKED,
}, },
}, { }, {
.code = V4L2_MBUS_FMT_SBGGR8_1X8, .code = V4L2_MBUS_FMT_SBGGR8_1X8,
...@@ -96,6 +104,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { ...@@ -96,6 +104,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
.bits_per_sample = 8, .bits_per_sample = 8,
.packing = SOC_MBUS_PACKING_NONE, .packing = SOC_MBUS_PACKING_NONE,
.order = SOC_MBUS_ORDER_LE, .order = SOC_MBUS_ORDER_LE,
.layout = SOC_MBUS_LAYOUT_PACKED,
}, },
}, { }, {
.code = V4L2_MBUS_FMT_SBGGR10_1X10, .code = V4L2_MBUS_FMT_SBGGR10_1X10,
...@@ -105,6 +114,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { ...@@ -105,6 +114,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
.bits_per_sample = 10, .bits_per_sample = 10,
.packing = SOC_MBUS_PACKING_EXTEND16, .packing = SOC_MBUS_PACKING_EXTEND16,
.order = SOC_MBUS_ORDER_LE, .order = SOC_MBUS_ORDER_LE,
.layout = SOC_MBUS_LAYOUT_PACKED,
}, },
}, { }, {
.code = V4L2_MBUS_FMT_Y8_1X8, .code = V4L2_MBUS_FMT_Y8_1X8,
...@@ -114,6 +124,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { ...@@ -114,6 +124,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
.bits_per_sample = 8, .bits_per_sample = 8,
.packing = SOC_MBUS_PACKING_NONE, .packing = SOC_MBUS_PACKING_NONE,
.order = SOC_MBUS_ORDER_LE, .order = SOC_MBUS_ORDER_LE,
.layout = SOC_MBUS_LAYOUT_PACKED,
}, },
}, { }, {
.code = V4L2_MBUS_FMT_Y10_1X10, .code = V4L2_MBUS_FMT_Y10_1X10,
...@@ -123,6 +134,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { ...@@ -123,6 +134,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
.bits_per_sample = 10, .bits_per_sample = 10,
.packing = SOC_MBUS_PACKING_EXTEND16, .packing = SOC_MBUS_PACKING_EXTEND16,
.order = SOC_MBUS_ORDER_LE, .order = SOC_MBUS_ORDER_LE,
.layout = SOC_MBUS_LAYOUT_PACKED,
}, },
}, { }, {
.code = V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_LE, .code = V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_LE,
...@@ -132,6 +144,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { ...@@ -132,6 +144,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
.bits_per_sample = 8, .bits_per_sample = 8,
.packing = SOC_MBUS_PACKING_2X8_PADHI, .packing = SOC_MBUS_PACKING_2X8_PADHI,
.order = SOC_MBUS_ORDER_LE, .order = SOC_MBUS_ORDER_LE,
.layout = SOC_MBUS_LAYOUT_PACKED,
}, },
}, { }, {
.code = V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_LE, .code = V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_LE,
...@@ -141,6 +154,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { ...@@ -141,6 +154,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
.bits_per_sample = 8, .bits_per_sample = 8,
.packing = SOC_MBUS_PACKING_2X8_PADLO, .packing = SOC_MBUS_PACKING_2X8_PADLO,
.order = SOC_MBUS_ORDER_LE, .order = SOC_MBUS_ORDER_LE,
.layout = SOC_MBUS_LAYOUT_PACKED,
}, },
}, { }, {
.code = V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_BE, .code = V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_BE,
...@@ -150,6 +164,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { ...@@ -150,6 +164,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
.bits_per_sample = 8, .bits_per_sample = 8,
.packing = SOC_MBUS_PACKING_2X8_PADHI, .packing = SOC_MBUS_PACKING_2X8_PADHI,
.order = SOC_MBUS_ORDER_BE, .order = SOC_MBUS_ORDER_BE,
.layout = SOC_MBUS_LAYOUT_PACKED,
}, },
}, { }, {
.code = V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_BE, .code = V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_BE,
...@@ -159,6 +174,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { ...@@ -159,6 +174,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
.bits_per_sample = 8, .bits_per_sample = 8,
.packing = SOC_MBUS_PACKING_2X8_PADLO, .packing = SOC_MBUS_PACKING_2X8_PADLO,
.order = SOC_MBUS_ORDER_BE, .order = SOC_MBUS_ORDER_BE,
.layout = SOC_MBUS_LAYOUT_PACKED,
}, },
}, { }, {
.code = V4L2_MBUS_FMT_JPEG_1X8, .code = V4L2_MBUS_FMT_JPEG_1X8,
...@@ -168,6 +184,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { ...@@ -168,6 +184,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
.bits_per_sample = 8, .bits_per_sample = 8,
.packing = SOC_MBUS_PACKING_VARIABLE, .packing = SOC_MBUS_PACKING_VARIABLE,
.order = SOC_MBUS_ORDER_LE, .order = SOC_MBUS_ORDER_LE,
.layout = SOC_MBUS_LAYOUT_PACKED,
}, },
}, { }, {
.code = V4L2_MBUS_FMT_RGB444_2X8_PADHI_BE, .code = V4L2_MBUS_FMT_RGB444_2X8_PADHI_BE,
...@@ -177,6 +194,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { ...@@ -177,6 +194,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
.bits_per_sample = 8, .bits_per_sample = 8,
.packing = SOC_MBUS_PACKING_2X8_PADHI, .packing = SOC_MBUS_PACKING_2X8_PADHI,
.order = SOC_MBUS_ORDER_BE, .order = SOC_MBUS_ORDER_BE,
.layout = SOC_MBUS_LAYOUT_PACKED,
}, },
}, { }, {
.code = V4L2_MBUS_FMT_YUYV8_1_5X8, .code = V4L2_MBUS_FMT_YUYV8_1_5X8,
...@@ -186,6 +204,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { ...@@ -186,6 +204,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
.bits_per_sample = 8, .bits_per_sample = 8,
.packing = SOC_MBUS_PACKING_1_5X8, .packing = SOC_MBUS_PACKING_1_5X8,
.order = SOC_MBUS_ORDER_LE, .order = SOC_MBUS_ORDER_LE,
.layout = SOC_MBUS_LAYOUT_PACKED,
}, },
}, { }, {
.code = V4L2_MBUS_FMT_YVYU8_1_5X8, .code = V4L2_MBUS_FMT_YVYU8_1_5X8,
...@@ -195,6 +214,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { ...@@ -195,6 +214,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
.bits_per_sample = 8, .bits_per_sample = 8,
.packing = SOC_MBUS_PACKING_1_5X8, .packing = SOC_MBUS_PACKING_1_5X8,
.order = SOC_MBUS_ORDER_LE, .order = SOC_MBUS_ORDER_LE,
.layout = SOC_MBUS_LAYOUT_PACKED,
}, },
}, { }, {
.code = V4L2_MBUS_FMT_UYVY8_1X16, .code = V4L2_MBUS_FMT_UYVY8_1X16,
...@@ -204,6 +224,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { ...@@ -204,6 +224,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
.bits_per_sample = 16, .bits_per_sample = 16,
.packing = SOC_MBUS_PACKING_EXTEND16, .packing = SOC_MBUS_PACKING_EXTEND16,
.order = SOC_MBUS_ORDER_LE, .order = SOC_MBUS_ORDER_LE,
.layout = SOC_MBUS_LAYOUT_PACKED,
}, },
}, { }, {
.code = V4L2_MBUS_FMT_VYUY8_1X16, .code = V4L2_MBUS_FMT_VYUY8_1X16,
...@@ -213,6 +234,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { ...@@ -213,6 +234,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
.bits_per_sample = 16, .bits_per_sample = 16,
.packing = SOC_MBUS_PACKING_EXTEND16, .packing = SOC_MBUS_PACKING_EXTEND16,
.order = SOC_MBUS_ORDER_LE, .order = SOC_MBUS_ORDER_LE,
.layout = SOC_MBUS_LAYOUT_PACKED,
}, },
}, { }, {
.code = V4L2_MBUS_FMT_YUYV8_1X16, .code = V4L2_MBUS_FMT_YUYV8_1X16,
...@@ -222,6 +244,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { ...@@ -222,6 +244,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
.bits_per_sample = 16, .bits_per_sample = 16,
.packing = SOC_MBUS_PACKING_EXTEND16, .packing = SOC_MBUS_PACKING_EXTEND16,
.order = SOC_MBUS_ORDER_LE, .order = SOC_MBUS_ORDER_LE,
.layout = SOC_MBUS_LAYOUT_PACKED,
}, },
}, { }, {
.code = V4L2_MBUS_FMT_YVYU8_1X16, .code = V4L2_MBUS_FMT_YVYU8_1X16,
...@@ -231,6 +254,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { ...@@ -231,6 +254,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
.bits_per_sample = 16, .bits_per_sample = 16,
.packing = SOC_MBUS_PACKING_EXTEND16, .packing = SOC_MBUS_PACKING_EXTEND16,
.order = SOC_MBUS_ORDER_LE, .order = SOC_MBUS_ORDER_LE,
.layout = SOC_MBUS_LAYOUT_PACKED,
}, },
}, { }, {
.code = V4L2_MBUS_FMT_SGRBG8_1X8, .code = V4L2_MBUS_FMT_SGRBG8_1X8,
...@@ -240,6 +264,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { ...@@ -240,6 +264,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
.bits_per_sample = 8, .bits_per_sample = 8,
.packing = SOC_MBUS_PACKING_NONE, .packing = SOC_MBUS_PACKING_NONE,
.order = SOC_MBUS_ORDER_LE, .order = SOC_MBUS_ORDER_LE,
.layout = SOC_MBUS_LAYOUT_PACKED,
}, },
}, { }, {
.code = V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8, .code = V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8,
...@@ -249,6 +274,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { ...@@ -249,6 +274,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
.bits_per_sample = 8, .bits_per_sample = 8,
.packing = SOC_MBUS_PACKING_NONE, .packing = SOC_MBUS_PACKING_NONE,
.order = SOC_MBUS_ORDER_LE, .order = SOC_MBUS_ORDER_LE,
.layout = SOC_MBUS_LAYOUT_PACKED,
}, },
}, { }, {
.code = V4L2_MBUS_FMT_SGBRG10_1X10, .code = V4L2_MBUS_FMT_SGBRG10_1X10,
...@@ -258,6 +284,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { ...@@ -258,6 +284,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
.bits_per_sample = 10, .bits_per_sample = 10,
.packing = SOC_MBUS_PACKING_EXTEND16, .packing = SOC_MBUS_PACKING_EXTEND16,
.order = SOC_MBUS_ORDER_LE, .order = SOC_MBUS_ORDER_LE,
.layout = SOC_MBUS_LAYOUT_PACKED,
}, },
}, { }, {
.code = V4L2_MBUS_FMT_SGRBG10_1X10, .code = V4L2_MBUS_FMT_SGRBG10_1X10,
...@@ -267,6 +294,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { ...@@ -267,6 +294,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
.bits_per_sample = 10, .bits_per_sample = 10,
.packing = SOC_MBUS_PACKING_EXTEND16, .packing = SOC_MBUS_PACKING_EXTEND16,
.order = SOC_MBUS_ORDER_LE, .order = SOC_MBUS_ORDER_LE,
.layout = SOC_MBUS_LAYOUT_PACKED,
}, },
}, { }, {
.code = V4L2_MBUS_FMT_SRGGB10_1X10, .code = V4L2_MBUS_FMT_SRGGB10_1X10,
...@@ -276,6 +304,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { ...@@ -276,6 +304,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
.bits_per_sample = 10, .bits_per_sample = 10,
.packing = SOC_MBUS_PACKING_EXTEND16, .packing = SOC_MBUS_PACKING_EXTEND16,
.order = SOC_MBUS_ORDER_LE, .order = SOC_MBUS_ORDER_LE,
.layout = SOC_MBUS_LAYOUT_PACKED,
}, },
}, { }, {
.code = V4L2_MBUS_FMT_SBGGR12_1X12, .code = V4L2_MBUS_FMT_SBGGR12_1X12,
...@@ -285,6 +314,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { ...@@ -285,6 +314,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
.bits_per_sample = 12, .bits_per_sample = 12,
.packing = SOC_MBUS_PACKING_EXTEND16, .packing = SOC_MBUS_PACKING_EXTEND16,
.order = SOC_MBUS_ORDER_LE, .order = SOC_MBUS_ORDER_LE,
.layout = SOC_MBUS_LAYOUT_PACKED,
}, },
}, { }, {
.code = V4L2_MBUS_FMT_SGBRG12_1X12, .code = V4L2_MBUS_FMT_SGBRG12_1X12,
...@@ -294,6 +324,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { ...@@ -294,6 +324,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
.bits_per_sample = 12, .bits_per_sample = 12,
.packing = SOC_MBUS_PACKING_EXTEND16, .packing = SOC_MBUS_PACKING_EXTEND16,
.order = SOC_MBUS_ORDER_LE, .order = SOC_MBUS_ORDER_LE,
.layout = SOC_MBUS_LAYOUT_PACKED,
}, },
}, { }, {
.code = V4L2_MBUS_FMT_SGRBG12_1X12, .code = V4L2_MBUS_FMT_SGRBG12_1X12,
...@@ -303,6 +334,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { ...@@ -303,6 +334,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
.bits_per_sample = 12, .bits_per_sample = 12,
.packing = SOC_MBUS_PACKING_EXTEND16, .packing = SOC_MBUS_PACKING_EXTEND16,
.order = SOC_MBUS_ORDER_LE, .order = SOC_MBUS_ORDER_LE,
.layout = SOC_MBUS_LAYOUT_PACKED,
}, },
}, { }, {
.code = V4L2_MBUS_FMT_SRGGB12_1X12, .code = V4L2_MBUS_FMT_SRGGB12_1X12,
...@@ -312,6 +344,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = { ...@@ -312,6 +344,7 @@ static const struct soc_mbus_lookup mbus_fmt[] = {
.bits_per_sample = 12, .bits_per_sample = 12,
.packing = SOC_MBUS_PACKING_EXTEND16, .packing = SOC_MBUS_PACKING_EXTEND16,
.order = SOC_MBUS_ORDER_LE, .order = SOC_MBUS_ORDER_LE,
.layout = SOC_MBUS_LAYOUT_PACKED,
}, },
}, },
}; };
......
...@@ -46,6 +46,24 @@ enum soc_mbus_order { ...@@ -46,6 +46,24 @@ enum soc_mbus_order {
SOC_MBUS_ORDER_BE, SOC_MBUS_ORDER_BE,
}; };
/**
* enum soc_mbus_layout - planes layout in memory
* @SOC_MBUS_LAYOUT_PACKED: color components packed
* @SOC_MBUS_LAYOUT_PLANAR_2Y_U_V: YUV components stored in 3 planes (4:2:2)
* @SOC_MBUS_LAYOUT_PLANAR_2Y_C: YUV components stored in a luma and a
* chroma plane (C plane is half the size
* of Y plane)
* @SOC_MBUS_LAYOUT_PLANAR_Y_C: YUV components stored in a luma and a
* chroma plane (C plane is the same size
* as Y plane)
*/
enum soc_mbus_layout {
SOC_MBUS_LAYOUT_PACKED = 0,
SOC_MBUS_LAYOUT_PLANAR_2Y_U_V,
SOC_MBUS_LAYOUT_PLANAR_2Y_C,
SOC_MBUS_LAYOUT_PLANAR_Y_C,
};
/** /**
* struct soc_mbus_pixelfmt - Data format on the media bus * struct soc_mbus_pixelfmt - Data format on the media bus
* @name: Name of the format * @name: Name of the format
...@@ -60,6 +78,7 @@ struct soc_mbus_pixelfmt { ...@@ -60,6 +78,7 @@ struct soc_mbus_pixelfmt {
u32 fourcc; u32 fourcc;
enum soc_mbus_packing packing; enum soc_mbus_packing packing;
enum soc_mbus_order order; enum soc_mbus_order order;
enum soc_mbus_layout layout;
u8 bits_per_sample; u8 bits_per_sample;
}; };
......
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