Re: [PATCH 3/8] soc-camera: Add plane layout information to struct soc_mbus_pixelfmt
On Wed, 25 Jan 2012, Laurent Pinchart wrote: To compute the number of bytes per line according to the V4L2 specification, we need information about planes layout for planar formats. The new enum soc_mbus_layout convey that information. Maybe it is better to call that value not the number of bytes per line according to the V4L2 specification, but rather the value of the .bytesperline field? Also, conveys seems a better fit to me:-) Thanks Guennadi --- Guennadi Liakhovetski, Ph.D. Freelance Open-Source Software Developer http://www.open-technology.de/ -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 3/8] soc-camera: Add plane layout information to struct soc_mbus_pixelfmt
One more question: On Wed, 25 Jan 2012, Laurent Pinchart wrote: To compute the number of bytes per line according to the V4L2 specification, we need information about planes layout for planar formats. The new enum soc_mbus_layout convey that information. Signed-off-by: Laurent Pinchart laurent.pinch...@ideasonboard.com --- drivers/media/video/atmel-isi.c|1 + drivers/media/video/mx3_camera.c |2 + drivers/media/video/omap1_camera.c |8 ++ drivers/media/video/pxa_camera.c |1 + drivers/media/video/sh_mobile_ceu_camera.c |4 +++ drivers/media/video/soc_mediabus.c | 33 include/media/soc_mediabus.h | 19 7 files changed, 68 insertions(+), 0 deletions(-) [snip] diff --git a/include/media/soc_mediabus.h b/include/media/soc_mediabus.h index 73f1e7e..18b0864 100644 --- a/include/media/soc_mediabus.h +++ b/include/media/soc_mediabus.h @@ -47,6 +47,24 @@ enum soc_mbus_order { }; /** + * enum soc_mbus_layout - planes layout in memory + * @SOC_MBUS_LAYOUT_PACKED: color components packed + * @SOC_MBUS_LAYOUT_PLANAR_Y_U_V:YUV components stored in 3 planes + * @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_Y_U_V, Shouldn't we call this SOC_MBUS_LAYOUT_PLANAR_2Y_U_V? Thanks Guennadi --- Guennadi Liakhovetski, Ph.D. Freelance Open-Source Software Developer http://www.open-technology.de/ -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 3/8] soc-camera: Add plane layout information to struct soc_mbus_pixelfmt
Hi Guennadi, On Thursday 26 January 2012 16:38:31 Guennadi Liakhovetski wrote: On Wed, 25 Jan 2012, Laurent Pinchart wrote: To compute the number of bytes per line according to the V4L2 specification, we need information about planes layout for planar formats. The new enum soc_mbus_layout convey that information. Maybe it is better to call that value not the number of bytes per line according to the V4L2 specification, but rather the value of the .bytesperline field? Also, conveys seems a better fit to me:-) OK. I'll change that. -- Regards, Laurent Pinchart -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 3/8] soc-camera: Add plane layout information to struct soc_mbus_pixelfmt
Hi Guennadi, On Thursday 26 January 2012 17:01:15 Guennadi Liakhovetski wrote: One more question: On Wed, 25 Jan 2012, Laurent Pinchart wrote: To compute the number of bytes per line according to the V4L2 specification, we need information about planes layout for planar formats. The new enum soc_mbus_layout convey that information. Signed-off-by: Laurent Pinchart laurent.pinch...@ideasonboard.com --- drivers/media/video/atmel-isi.c|1 + drivers/media/video/mx3_camera.c |2 + drivers/media/video/omap1_camera.c |8 ++ drivers/media/video/pxa_camera.c |1 + drivers/media/video/sh_mobile_ceu_camera.c |4 +++ drivers/media/video/soc_mediabus.c | 33 include/media/soc_mediabus.h | 19 7 files changed, 68 insertions(+), 0 deletions(-) [snip] diff --git a/include/media/soc_mediabus.h b/include/media/soc_mediabus.h index 73f1e7e..18b0864 100644 --- a/include/media/soc_mediabus.h +++ b/include/media/soc_mediabus.h @@ -47,6 +47,24 @@ enum soc_mbus_order { }; /** + * enum soc_mbus_layout - planes layout in memory + * @SOC_MBUS_LAYOUT_PACKED:color components packed + * @SOC_MBUS_LAYOUT_PLANAR_Y_U_V: YUV components stored in 3 planes + * @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_Y_U_V, Shouldn't we call this SOC_MBUS_LAYOUT_PLANAR_2Y_U_V? I'll change that. -- Regards, Laurent Pinchart -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 3/8] soc-camera: Add plane layout information to struct soc_mbus_pixelfmt
To compute the number of bytes per line according to the V4L2 specification, we need information about planes layout for planar formats. The new enum soc_mbus_layout convey that information. Signed-off-by: Laurent Pinchart laurent.pinch...@ideasonboard.com --- drivers/media/video/atmel-isi.c|1 + drivers/media/video/mx3_camera.c |2 + drivers/media/video/omap1_camera.c |8 ++ drivers/media/video/pxa_camera.c |1 + drivers/media/video/sh_mobile_ceu_camera.c |4 +++ drivers/media/video/soc_mediabus.c | 33 include/media/soc_mediabus.h | 19 7 files changed, 68 insertions(+), 0 deletions(-) diff --git a/drivers/media/video/atmel-isi.c b/drivers/media/video/atmel-isi.c index 73f8d05..e104b19 100644 --- a/drivers/media/video/atmel-isi.c +++ b/drivers/media/video/atmel-isi.c @@ -624,6 +624,7 @@ static const struct soc_mbus_pixelfmt isi_camera_formats[] = { .bits_per_sample= 8, .packing= SOC_MBUS_PACKING_2X8_PADHI, .order = SOC_MBUS_ORDER_LE, + .layout = SOC_MBUS_LAYOUT_PACKED, }, }; diff --git a/drivers/media/video/mx3_camera.c b/drivers/media/video/mx3_camera.c index c68f07e..813323c 100644 --- a/drivers/media/video/mx3_camera.c +++ b/drivers/media/video/mx3_camera.c @@ -637,12 +637,14 @@ static const struct soc_mbus_pixelfmt mx3_camera_formats[] = { .bits_per_sample= 8, .packing= SOC_MBUS_PACKING_NONE, .order = SOC_MBUS_ORDER_LE, + .layout = SOC_MBUS_LAYOUT_PACKED, }, { .fourcc = V4L2_PIX_FMT_GREY, .name = Monochrome 8 bit, .bits_per_sample= 8, .packing= SOC_MBUS_PACKING_NONE, .order = SOC_MBUS_ORDER_LE, + .layout = SOC_MBUS_LAYOUT_PACKED, }, }; diff --git a/drivers/media/video/omap1_camera.c b/drivers/media/video/omap1_camera.c index cebe4bf..76752e5 100644 --- a/drivers/media/video/omap1_camera.c +++ b/drivers/media/video/omap1_camera.c @@ -989,6 +989,7 @@ static const struct soc_mbus_lookup omap1_cam_formats[] = { .bits_per_sample= 8, .packing= SOC_MBUS_PACKING_2X8_PADHI, .order = SOC_MBUS_ORDER_BE, + .layout = SOC_MBUS_LAYOUT_PACKED, }, }, { .code = V4L2_MBUS_FMT_VYUY8_2X8, @@ -998,6 +999,7 @@ static const struct soc_mbus_lookup omap1_cam_formats[] = { .bits_per_sample= 8, .packing= SOC_MBUS_PACKING_2X8_PADHI, .order = SOC_MBUS_ORDER_BE, + .layout = SOC_MBUS_LAYOUT_PACKED, }, }, { .code = V4L2_MBUS_FMT_YUYV8_2X8, @@ -1007,6 +1009,7 @@ static const struct soc_mbus_lookup omap1_cam_formats[] = { .bits_per_sample= 8, .packing= SOC_MBUS_PACKING_2X8_PADHI, .order = SOC_MBUS_ORDER_BE, + .layout = SOC_MBUS_LAYOUT_PACKED, }, }, { .code = V4L2_MBUS_FMT_YVYU8_2X8, @@ -1016,6 +1019,7 @@ static const struct soc_mbus_lookup omap1_cam_formats[] = { .bits_per_sample= 8, .packing= SOC_MBUS_PACKING_2X8_PADHI, .order = SOC_MBUS_ORDER_BE, + .layout = SOC_MBUS_LAYOUT_PACKED, }, }, { .code = V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE, @@ -1025,6 +1029,7 @@ static const struct soc_mbus_lookup omap1_cam_formats[] = { .bits_per_sample= 8, .packing= SOC_MBUS_PACKING_2X8_PADHI, .order = SOC_MBUS_ORDER_BE, + .layout = SOC_MBUS_LAYOUT_PACKED, }, }, { .code = V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE, @@ -1034,6 +1039,7 @@ static const struct soc_mbus_lookup omap1_cam_formats[] = { .bits_per_sample= 8, .packing= SOC_MBUS_PACKING_2X8_PADHI, .order = SOC_MBUS_ORDER_BE, + .layout = SOC_MBUS_LAYOUT_PACKED, }, }, { .code = V4L2_MBUS_FMT_RGB565_2X8_BE, @@ -1043,6 +1049,7 @@ static const struct soc_mbus_lookup omap1_cam_formats[] = { .bits_per_sample= 8, .packing= SOC_MBUS_PACKING_2X8_PADHI, .order = SOC_MBUS_ORDER_BE, + .layout =