* [PATCH 0/3] Xilinx 8-bit color depth YCbCr 4:2:0 media bus format
@ 2017-08-09 18:27 Rohit Athavale
2017-08-09 18:27 ` [PATCH 1/3] uapi: media-bus-format: Add Xilinx specific " Rohit Athavale
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Rohit Athavale @ 2017-08-09 18:27 UTC (permalink / raw)
To: linux-media; +Cc: laurent.pinchart, hyun.kwon, Rohit Athavale
This patch set adds a vendor specific custom YCbCr 4:2:0 format. The way
Xilinx Video IP sends data over the bus makes it unrepresented by existing
media bus formats.
YCbCr 4:2:0 transmission over the bus does not slice Chroma and Luma
components over the bus width. Instead it sends sub-sampled Chroma when
present along with the Luma component, otherwise zero padded Luma only
data is sent.
The first patch (1/3) adds the format to the uapi header file.
The second patch (2/3) adds the format to the table in xilinx-vip.c.
The third patch (3/3) updates the subdev format doc file.
Rohit Athavale (3):
uapi: media-bus-format: Add Xilinx specific YCbCr 4:2:0 media bus
format
media: xilinx-vip: Add 8-bit YCbCr 4:2:0 to formats table
Documentation: subdev-formats: Add Xilinx YCbCr to Vendor specific
area
Documentation/media/uapi/v4l/subdev-formats.rst | 5 +++++
drivers/media/platform/xilinx/xilinx-vip.c | 3 +++
include/uapi/linux/media-bus-format.h | 4 +++-
3 files changed, 11 insertions(+), 1 deletion(-)
--
1.9.1
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH 1/3] uapi: media-bus-format: Add Xilinx specific YCbCr 4:2:0 media bus format 2017-08-09 18:27 [PATCH 0/3] Xilinx 8-bit color depth YCbCr 4:2:0 media bus format Rohit Athavale @ 2017-08-09 18:27 ` Rohit Athavale 2017-08-18 9:17 ` Laurent Pinchart 2017-08-09 18:27 ` [PATCH 2/3] media: xilinx-vip: Add 8-bit YCbCr 4:2:0 to formats table Rohit Athavale 2017-08-09 18:27 ` [PATCH 3/3] Documentation: subdev-formats: Add Xilinx YCbCr to Vendor specific area Rohit Athavale 2 siblings, 1 reply; 7+ messages in thread From: Rohit Athavale @ 2017-08-09 18:27 UTC (permalink / raw) To: linux-media; +Cc: laurent.pinchart, hyun.kwon, Rohit Athavale This commit adds Xilinx Video IP specific 8-bit color depth YCbCr 4:2:0 to the media bus format uapi. Signed-off-by: Rohit Athavale <rathaval@xilinx.com> --- include/uapi/linux/media-bus-format.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/media-bus-format.h b/include/uapi/linux/media-bus-format.h index ef6fb30..6f65607 100644 --- a/include/uapi/linux/media-bus-format.h +++ b/include/uapi/linux/media-bus-format.h @@ -143,10 +143,12 @@ /* JPEG compressed formats - next is 0x4002 */ #define MEDIA_BUS_FMT_JPEG_1X8 0x4001 -/* Vendor specific formats - next is 0x5002 */ +/* Vendor specific formats - next is 0x5003 */ /* S5C73M3 sensor specific interleaved UYVY and JPEG */ #define MEDIA_BUS_FMT_S5C_UYVY_JPEG_1X8 0x5001 +/* Xilinx IP Specific 8-bit YCbCr 4:2:0 */ +#define MEDIA_BUS_FMT_XLNX8_VUY420_1X24 0x5002 /* HSV - next is 0x6002 */ #define MEDIA_BUS_FMT_AHSV8888_1X32 0x6001 -- 1.9.1 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/3] uapi: media-bus-format: Add Xilinx specific YCbCr 4:2:0 media bus format 2017-08-09 18:27 ` [PATCH 1/3] uapi: media-bus-format: Add Xilinx specific " Rohit Athavale @ 2017-08-18 9:17 ` Laurent Pinchart 0 siblings, 0 replies; 7+ messages in thread From: Laurent Pinchart @ 2017-08-18 9:17 UTC (permalink / raw) To: Rohit Athavale; +Cc: linux-media, hyun.kwon, Rohit Athavale Hi Rohit, Thank you for the patch. On Wednesday 09 Aug 2017 11:27:52 Rohit Athavale wrote: > This commit adds Xilinx Video IP specific 8-bit color depth YCbCr 4:2:0 > to the media bus format uapi. > > Signed-off-by: Rohit Athavale <rathaval@xilinx.com> > --- > include/uapi/linux/media-bus-format.h | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/include/uapi/linux/media-bus-format.h > b/include/uapi/linux/media-bus-format.h index ef6fb30..6f65607 100644 > --- a/include/uapi/linux/media-bus-format.h > +++ b/include/uapi/linux/media-bus-format.h > @@ -143,10 +143,12 @@ > /* JPEG compressed formats - next is 0x4002 */ > #define MEDIA_BUS_FMT_JPEG_1X8 0x4001 > > -/* Vendor specific formats - next is 0x5002 */ > +/* Vendor specific formats - next is 0x5003 */ > > /* S5C73M3 sensor specific interleaved UYVY and JPEG */ > #define MEDIA_BUS_FMT_S5C_UYVY_JPEG_1X8 0x5001 > +/* Xilinx IP Specific 8-bit YCbCr 4:2:0 */ > +#define MEDIA_BUS_FMT_XLNX8_VUY420_1X24 0x5002 Is this really a Xilinx-specific format ? I think it would make sense to define it as a standard YUV format. > /* HSV - next is 0x6002 */ > #define MEDIA_BUS_FMT_AHSV8888_1X32 0x6001 -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/3] media: xilinx-vip: Add 8-bit YCbCr 4:2:0 to formats table 2017-08-09 18:27 [PATCH 0/3] Xilinx 8-bit color depth YCbCr 4:2:0 media bus format Rohit Athavale 2017-08-09 18:27 ` [PATCH 1/3] uapi: media-bus-format: Add Xilinx specific " Rohit Athavale @ 2017-08-09 18:27 ` Rohit Athavale 2017-08-18 9:16 ` Laurent Pinchart 2017-08-09 18:27 ` [PATCH 3/3] Documentation: subdev-formats: Add Xilinx YCbCr to Vendor specific area Rohit Athavale 2 siblings, 1 reply; 7+ messages in thread From: Rohit Athavale @ 2017-08-09 18:27 UTC (permalink / raw) To: linux-media; +Cc: laurent.pinchart, hyun.kwon, Rohit Athavale Add Xilinx YCbCr 4:2:0 to xvip formats table. This commit will allow driver to setup media pad codes to YUV 420 via DT properties. Signed-off-by: Rohit Athavale <rathaval@xilinx.com> --- drivers/media/platform/xilinx/xilinx-vip.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/media/platform/xilinx/xilinx-vip.c b/drivers/media/platform/xilinx/xilinx-vip.c index 3112591..37b80bf 100644 --- a/drivers/media/platform/xilinx/xilinx-vip.c +++ b/drivers/media/platform/xilinx/xilinx-vip.c @@ -15,6 +15,7 @@ #include <linux/clk.h> #include <linux/export.h> #include <linux/kernel.h> +#include <linux/media-bus-format.h> #include <linux/of.h> #include <linux/platform_device.h> @@ -27,6 +28,8 @@ */ static const struct xvip_video_format xvip_video_formats[] = { + { XVIP_VF_YUV_420, 8, NULL, MEDIA_BUS_FMT_XLNX8_VUY420_1X24, + 2, V4L2_PIX_FMT_NV12, "4:2:0, semi-planar, YUYV" }, { XVIP_VF_YUV_422, 8, NULL, MEDIA_BUS_FMT_UYVY8_1X16, 2, V4L2_PIX_FMT_YUYV, "4:2:2, packed, YUYV" }, { XVIP_VF_YUV_444, 8, NULL, MEDIA_BUS_FMT_VUY8_1X24, -- 1.9.1 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 2/3] media: xilinx-vip: Add 8-bit YCbCr 4:2:0 to formats table 2017-08-09 18:27 ` [PATCH 2/3] media: xilinx-vip: Add 8-bit YCbCr 4:2:0 to formats table Rohit Athavale @ 2017-08-18 9:16 ` Laurent Pinchart 0 siblings, 0 replies; 7+ messages in thread From: Laurent Pinchart @ 2017-08-18 9:16 UTC (permalink / raw) To: Rohit Athavale; +Cc: linux-media, hyun.kwon, Rohit Athavale Hi Rohit, Thank you for the patch. On Wednesday 09 Aug 2017 11:27:53 Rohit Athavale wrote: > Add Xilinx YCbCr 4:2:0 to xvip formats table. This commit > will allow driver to setup media pad codes to YUV 420 > via DT properties. > > Signed-off-by: Rohit Athavale <rathaval@xilinx.com> > --- > drivers/media/platform/xilinx/xilinx-vip.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/media/platform/xilinx/xilinx-vip.c > b/drivers/media/platform/xilinx/xilinx-vip.c index 3112591..37b80bf 100644 > --- a/drivers/media/platform/xilinx/xilinx-vip.c > +++ b/drivers/media/platform/xilinx/xilinx-vip.c > @@ -15,6 +15,7 @@ > #include <linux/clk.h> > #include <linux/export.h> > #include <linux/kernel.h> > +#include <linux/media-bus-format.h> I'm pretty sure the file is included indirectly already, so this isn't strictly needed, but it shouldn't hurt either. > #include <linux/of.h> > #include <linux/platform_device.h> > > @@ -27,6 +28,8 @@ > */ > > static const struct xvip_video_format xvip_video_formats[] = { > + { XVIP_VF_YUV_420, 8, NULL, MEDIA_BUS_FMT_XLNX8_VUY420_1X24, > + 2, V4L2_PIX_FMT_NV12, "4:2:0, semi-planar, YUYV" }, You're mapping XVIP_VF_YUV_420 to V4L2_PIX_FMT_NV12 which has an average bpp of 1.5 bytes per pixel, but you're setting bpp to 2. How does that work ? You obviously can't express a 1.5 bpp currently in the driver, so we might need to extend the xvip_video_format structure with additional fields (for instance turning bytes per pixel into bits per pixel, but we might need per-plane information too). On a side note, how does this work with VDMA ? The latest VDMA version I checked (v6.2, a while ago) didn't seem to support planar formats. Has it changed in more recent versions ? Doesn't it require changes in the xilinx-vip driver ? > { XVIP_VF_YUV_422, 8, NULL, MEDIA_BUS_FMT_UYVY8_1X16, > 2, V4L2_PIX_FMT_YUYV, "4:2:2, packed, YUYV" }, > { XVIP_VF_YUV_444, 8, NULL, MEDIA_BUS_FMT_VUY8_1X24, -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 3/3] Documentation: subdev-formats: Add Xilinx YCbCr to Vendor specific area 2017-08-09 18:27 [PATCH 0/3] Xilinx 8-bit color depth YCbCr 4:2:0 media bus format Rohit Athavale 2017-08-09 18:27 ` [PATCH 1/3] uapi: media-bus-format: Add Xilinx specific " Rohit Athavale 2017-08-09 18:27 ` [PATCH 2/3] media: xilinx-vip: Add 8-bit YCbCr 4:2:0 to formats table Rohit Athavale @ 2017-08-09 18:27 ` Rohit Athavale 2017-08-18 9:18 ` Laurent Pinchart 2 siblings, 1 reply; 7+ messages in thread From: Rohit Athavale @ 2017-08-09 18:27 UTC (permalink / raw) To: linux-media; +Cc: laurent.pinchart, hyun.kwon, Rohit Athavale This commit adds the custom Xilinx IP specific 8-bit YCbCr 4:2:0 to the custom formats area in the subdev-formats documentation. Signed-off-by: Rohit Athavale <rathaval@xilinx.com> --- Documentation/media/uapi/v4l/subdev-formats.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/media/uapi/v4l/subdev-formats.rst b/Documentation/media/uapi/v4l/subdev-formats.rst index 8e73bb0..141a837 100644 --- a/Documentation/media/uapi/v4l/subdev-formats.rst +++ b/Documentation/media/uapi/v4l/subdev-formats.rst @@ -7483,3 +7483,8 @@ formats. - 0x5001 - Interleaved raw UYVY and JPEG image format with embedded meta-data used by Samsung S3C73MX camera sensors. + * .. _MEDIA_BUS_FMT_XLNX8_VUY420_1X24: + + - MEDIA_BUS_FMT_XLNX8_VUY420_1X24 + - 0x5002 + - Xilinx IP specific 8-bit color depth YCbCr 4:2:0 used by Xilinx Video IP. -- 1.9.1 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 3/3] Documentation: subdev-formats: Add Xilinx YCbCr to Vendor specific area 2017-08-09 18:27 ` [PATCH 3/3] Documentation: subdev-formats: Add Xilinx YCbCr to Vendor specific area Rohit Athavale @ 2017-08-18 9:18 ` Laurent Pinchart 0 siblings, 0 replies; 7+ messages in thread From: Laurent Pinchart @ 2017-08-18 9:18 UTC (permalink / raw) To: Rohit Athavale; +Cc: linux-media, hyun.kwon, Rohit Athavale Hi Rohit, Thank you for the patch. On Wednesday 09 Aug 2017 11:27:54 Rohit Athavale wrote: > This commit adds the custom Xilinx IP specific 8-bit YCbCr 4:2:0 > to the custom formats area in the subdev-formats documentation. > > Signed-off-by: Rohit Athavale <rathaval@xilinx.com> > --- > Documentation/media/uapi/v4l/subdev-formats.rst | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/Documentation/media/uapi/v4l/subdev-formats.rst > b/Documentation/media/uapi/v4l/subdev-formats.rst index 8e73bb0..141a837 > 100644 > --- a/Documentation/media/uapi/v4l/subdev-formats.rst > +++ b/Documentation/media/uapi/v4l/subdev-formats.rst > @@ -7483,3 +7483,8 @@ formats. > - 0x5001 > - Interleaved raw UYVY and JPEG image format with embedded meta-data > used by Samsung S3C73MX camera sensors. > + * .. _MEDIA_BUS_FMT_XLNX8_VUY420_1X24: > + > + - MEDIA_BUS_FMT_XLNX8_VUY420_1X24 > + - 0x5002 > + - Xilinx IP specific 8-bit color depth YCbCr 4:2:0 used by Xilinx > Video IP. You need to document this format in more details, with a table explaining how bits are transferred on the bus, the same way the standard YUV formats are documented. -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2017-08-18 9:17 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2017-08-09 18:27 [PATCH 0/3] Xilinx 8-bit color depth YCbCr 4:2:0 media bus format Rohit Athavale 2017-08-09 18:27 ` [PATCH 1/3] uapi: media-bus-format: Add Xilinx specific " Rohit Athavale 2017-08-18 9:17 ` Laurent Pinchart 2017-08-09 18:27 ` [PATCH 2/3] media: xilinx-vip: Add 8-bit YCbCr 4:2:0 to formats table Rohit Athavale 2017-08-18 9:16 ` Laurent Pinchart 2017-08-09 18:27 ` [PATCH 3/3] Documentation: subdev-formats: Add Xilinx YCbCr to Vendor specific area Rohit Athavale 2017-08-18 9:18 ` Laurent Pinchart
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).