* [PATCH 0/4] Add support for V4L2_PIX_FMT_Y16_BE
@ 2015-05-04 8:07 Ricardo Ribalda Delgado
2015-05-04 8:07 ` [PATCH 2/4] media/v4l2-core: " Ricardo Ribalda Delgado
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Ricardo Ribalda Delgado @ 2015-05-04 8:07 UTC (permalink / raw)
To: Hans Verkuil, Mauro Carvalho Chehab, Laurent Pinchart,
Sakari Ailus, Ramakrishnan Muthukrishnan,
linux-media-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-api-u79uwXL29TY76Z2rM5mHXA
Cc: Ricardo Ribalda Delgado
New pixel format type Y16_BE (16 bits greyscale big-endian).
Once I get the fist feedback on this patch I will send the patches for
v4lconvert and qv4l2.
Thanks
Ricardo Ribalda Delgado (4):
media/vivid: Add support for Y16 format
media/v4l2-core: Add support for V4L2_PIX_FMT_Y16_BE
media/vivid: Add support for Y16_BE format
media/vivid: Code cleanout
drivers/media/platform/vivid/vivid-tpg.c | 20 ++++++++++++++++----
drivers/media/platform/vivid/vivid-vid-common.c | 16 ++++++++++++++++
drivers/media/v4l2-core/v4l2-ioctl.c | 1 +
include/uapi/linux/videodev2.h | 1 +
4 files changed, 34 insertions(+), 4 deletions(-)
--
2.1.4
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH 2/4] media/v4l2-core: Add support for V4L2_PIX_FMT_Y16_BE 2015-05-04 8:07 [PATCH 0/4] Add support for V4L2_PIX_FMT_Y16_BE Ricardo Ribalda Delgado @ 2015-05-04 8:07 ` Ricardo Ribalda Delgado 2015-05-04 8:07 ` [PATCH 3/4] media/vivid: Add support for Y16_BE format Ricardo Ribalda Delgado [not found] ` <1430726852-11715-1-git-send-email-ricardo.ribalda-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 2 siblings, 0 replies; 7+ messages in thread From: Ricardo Ribalda Delgado @ 2015-05-04 8:07 UTC (permalink / raw) To: Hans Verkuil, Mauro Carvalho Chehab, Laurent Pinchart, Sakari Ailus, Ramakrishnan Muthukrishnan, linux-media, linux-kernel, linux-api Cc: Ricardo Ribalda Delgado 16 bit greyscale format, structured in Big Endian. Such a format can be converted into a PMN image just by adding a header. Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> --- drivers/media/v4l2-core/v4l2-ioctl.c | 1 + include/uapi/linux/videodev2.h | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c index 14766029bf49..136df7ccfedc 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -1146,6 +1146,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt) case V4L2_PIX_FMT_Y10: descr = "10-bit Greyscale"; break; case V4L2_PIX_FMT_Y12: descr = "12-bit Greyscale"; break; case V4L2_PIX_FMT_Y16: descr = "16-bit Greyscale"; break; + case V4L2_PIX_FMT_Y16_BE: descr = "16-bit Greyscale BE"; break; case V4L2_PIX_FMT_Y10BPACK: descr = "10-bit Greyscale (Packed)"; break; case V4L2_PIX_FMT_PAL8: descr = "8-bit Palette"; break; case V4L2_PIX_FMT_UV8: descr = "8-bit Chrominance UV 4-4"; break; diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index fa376f7666ba..3f01d7bbbc77 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -404,6 +404,7 @@ struct v4l2_pix_format { #define V4L2_PIX_FMT_Y10 v4l2_fourcc('Y', '1', '0', ' ') /* 10 Greyscale */ #define V4L2_PIX_FMT_Y12 v4l2_fourcc('Y', '1', '2', ' ') /* 12 Greyscale */ #define V4L2_PIX_FMT_Y16 v4l2_fourcc('Y', '1', '6', ' ') /* 16 Greyscale */ +#define V4L2_PIX_FMT_Y16_BE v4l2_fourcc_be('Y', '1', '6', ' ') /* 16 Greyscale BE */ /* Grey bit-packed formats */ #define V4L2_PIX_FMT_Y10BPACK v4l2_fourcc('Y', '1', '0', 'B') /* 10 Greyscale bit-packed */ -- 2.1.4 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/4] media/vivid: Add support for Y16_BE format 2015-05-04 8:07 [PATCH 0/4] Add support for V4L2_PIX_FMT_Y16_BE Ricardo Ribalda Delgado 2015-05-04 8:07 ` [PATCH 2/4] media/v4l2-core: " Ricardo Ribalda Delgado @ 2015-05-04 8:07 ` Ricardo Ribalda Delgado [not found] ` <1430726852-11715-1-git-send-email-ricardo.ribalda-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 2 siblings, 0 replies; 7+ messages in thread From: Ricardo Ribalda Delgado @ 2015-05-04 8:07 UTC (permalink / raw) To: Hans Verkuil, Mauro Carvalho Chehab, Laurent Pinchart, Sakari Ailus, Ramakrishnan Muthukrishnan, linux-media, linux-kernel, linux-api Cc: Ricardo Ribalda Delgado Support for V4L2_PIX_FMT_Y16_BE, a 16 bit big endian greyscale format. Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> --- drivers/media/platform/vivid/vivid-tpg.c | 9 ++++++++- drivers/media/platform/vivid/vivid-vid-common.c | 8 ++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/vivid/vivid-tpg.c b/drivers/media/platform/vivid/vivid-tpg.c index 9e50303a19c5..2e5129a6bc2f 100644 --- a/drivers/media/platform/vivid/vivid-tpg.c +++ b/drivers/media/platform/vivid/vivid-tpg.c @@ -221,6 +221,7 @@ bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc) case V4L2_PIX_FMT_ABGR32: case V4L2_PIX_FMT_GREY: case V4L2_PIX_FMT_Y16: + case V4L2_PIX_FMT_Y16_BE: tpg->is_yuv = false; break; case V4L2_PIX_FMT_YUV444: @@ -315,6 +316,7 @@ bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc) case V4L2_PIX_FMT_YUV555: case V4L2_PIX_FMT_YUV565: case V4L2_PIX_FMT_Y16: + case V4L2_PIX_FMT_Y16_BE: tpg->twopixelsize[0] = 2 * 2; break; case V4L2_PIX_FMT_RGB24: @@ -715,7 +717,8 @@ static void precalculate_color(struct tpg_data *tpg, int k) b <<= 4; } if (tpg->qual == TPG_QUAL_GRAY || tpg->fourcc == V4L2_PIX_FMT_GREY || - tpg->fourcc == V4L2_PIX_FMT_Y16) { + tpg->fourcc == V4L2_PIX_FMT_Y16 || + tpg->fourcc == V4L2_PIX_FMT_Y16_BE) { /* Rec. 709 Luma function */ /* (0.2126, 0.7152, 0.0722) * (255 * 256) */ r = g = b = (13879 * r + 46688 * g + 4713 * b) >> 16; @@ -902,6 +905,10 @@ static void gen_twopix(struct tpg_data *tpg, buf[0][offset] = 0; buf[0][offset+1] = r_y; break; + case V4L2_PIX_FMT_Y16_BE: + buf[0][offset] = r_y; + buf[0][offset+1] = 0; + break; case V4L2_PIX_FMT_YUV422P: case V4L2_PIX_FMT_YUV420: case V4L2_PIX_FMT_YUV420M: diff --git a/drivers/media/platform/vivid/vivid-vid-common.c b/drivers/media/platform/vivid/vivid-vid-common.c index 96ccd3c38dd2..45f10a7f9b46 100644 --- a/drivers/media/platform/vivid/vivid-vid-common.c +++ b/drivers/media/platform/vivid/vivid-vid-common.c @@ -197,6 +197,14 @@ struct vivid_fmt vivid_formats[] = { .buffers = 1, }, { + .fourcc = V4L2_PIX_FMT_Y16_BE, + .vdownsampling = { 1 }, + .bit_depth = { 16 }, + .is_yuv = true, + .planes = 1, + .buffers = 1, + }, + { .fourcc = V4L2_PIX_FMT_RGB332, /* rrrgggbb */ .vdownsampling = { 1 }, .bit_depth = { 8 }, -- 2.1.4 ^ permalink raw reply related [flat|nested] 7+ messages in thread
[parent not found: <1430726852-11715-1-git-send-email-ricardo.ribalda-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>]
* [PATCH 1/4] media/vivid: Add support for Y16 format [not found] ` <1430726852-11715-1-git-send-email-ricardo.ribalda-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> @ 2015-05-04 8:07 ` Ricardo Ribalda Delgado 2015-05-04 8:07 ` [PATCH 4/4] media/vivid: Code cleanout Ricardo Ribalda Delgado 2015-05-18 19:26 ` [PATCH 0/4] Add support for V4L2_PIX_FMT_Y16_BE Mauro Carvalho Chehab 2 siblings, 0 replies; 7+ messages in thread From: Ricardo Ribalda Delgado @ 2015-05-04 8:07 UTC (permalink / raw) To: Hans Verkuil, Mauro Carvalho Chehab, Laurent Pinchart, Sakari Ailus, Ramakrishnan Muthukrishnan, linux-media-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA, linux-api-u79uwXL29TY76Z2rM5mHXA Cc: Ricardo Ribalda Delgado Support for V4L2_PIX_FMT_Y16, a 16 bit greyscale format. Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> --- drivers/media/platform/vivid/vivid-tpg.c | 9 ++++++++- drivers/media/platform/vivid/vivid-vid-common.c | 8 ++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/vivid/vivid-tpg.c b/drivers/media/platform/vivid/vivid-tpg.c index 4df755aa7e48..9e50303a19c5 100644 --- a/drivers/media/platform/vivid/vivid-tpg.c +++ b/drivers/media/platform/vivid/vivid-tpg.c @@ -220,6 +220,7 @@ bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc) case V4L2_PIX_FMT_ARGB32: case V4L2_PIX_FMT_ABGR32: case V4L2_PIX_FMT_GREY: + case V4L2_PIX_FMT_Y16: tpg->is_yuv = false; break; case V4L2_PIX_FMT_YUV444: @@ -313,6 +314,7 @@ bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc) case V4L2_PIX_FMT_YUV444: case V4L2_PIX_FMT_YUV555: case V4L2_PIX_FMT_YUV565: + case V4L2_PIX_FMT_Y16: tpg->twopixelsize[0] = 2 * 2; break; case V4L2_PIX_FMT_RGB24: @@ -712,7 +714,8 @@ static void precalculate_color(struct tpg_data *tpg, int k) g <<= 4; b <<= 4; } - if (tpg->qual == TPG_QUAL_GRAY || tpg->fourcc == V4L2_PIX_FMT_GREY) { + if (tpg->qual == TPG_QUAL_GRAY || tpg->fourcc == V4L2_PIX_FMT_GREY || + tpg->fourcc == V4L2_PIX_FMT_Y16) { /* Rec. 709 Luma function */ /* (0.2126, 0.7152, 0.0722) * (255 * 256) */ r = g = b = (13879 * r + 46688 * g + 4713 * b) >> 16; @@ -895,6 +898,10 @@ static void gen_twopix(struct tpg_data *tpg, case V4L2_PIX_FMT_GREY: buf[0][offset] = r_y; break; + case V4L2_PIX_FMT_Y16: + buf[0][offset] = 0; + buf[0][offset+1] = r_y; + break; case V4L2_PIX_FMT_YUV422P: case V4L2_PIX_FMT_YUV420: case V4L2_PIX_FMT_YUV420M: diff --git a/drivers/media/platform/vivid/vivid-vid-common.c b/drivers/media/platform/vivid/vivid-vid-common.c index 6ba874420485..96ccd3c38dd2 100644 --- a/drivers/media/platform/vivid/vivid-vid-common.c +++ b/drivers/media/platform/vivid/vivid-vid-common.c @@ -189,6 +189,14 @@ struct vivid_fmt vivid_formats[] = { .buffers = 1, }, { + .fourcc = V4L2_PIX_FMT_Y16, + .vdownsampling = { 1 }, + .bit_depth = { 16 }, + .is_yuv = true, + .planes = 1, + .buffers = 1, + }, + { .fourcc = V4L2_PIX_FMT_RGB332, /* rrrgggbb */ .vdownsampling = { 1 }, .bit_depth = { 8 }, -- 2.1.4 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 4/4] media/vivid: Code cleanout [not found] ` <1430726852-11715-1-git-send-email-ricardo.ribalda-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 2015-05-04 8:07 ` [PATCH 1/4] media/vivid: Add support for Y16 format Ricardo Ribalda Delgado @ 2015-05-04 8:07 ` Ricardo Ribalda Delgado 2015-05-18 19:26 ` [PATCH 0/4] Add support for V4L2_PIX_FMT_Y16_BE Mauro Carvalho Chehab 2 siblings, 0 replies; 7+ messages in thread From: Ricardo Ribalda Delgado @ 2015-05-04 8:07 UTC (permalink / raw) To: Hans Verkuil, Mauro Carvalho Chehab, Laurent Pinchart, Sakari Ailus, Ramakrishnan Muthukrishnan, linux-media-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA, linux-api-u79uwXL29TY76Z2rM5mHXA Cc: Ricardo Ribalda Delgado Remove code duplication by merging two cases in a switch. Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> --- drivers/media/platform/vivid/vivid-tpg.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/media/platform/vivid/vivid-tpg.c b/drivers/media/platform/vivid/vivid-tpg.c index 2e5129a6bc2f..8cac0bdefd9a 100644 --- a/drivers/media/platform/vivid/vivid-tpg.c +++ b/drivers/media/platform/vivid/vivid-tpg.c @@ -294,6 +294,7 @@ bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc) } switch (fourcc) { + case V4L2_PIX_FMT_GREY: case V4L2_PIX_FMT_RGB332: tpg->twopixelsize[0] = 2; break; @@ -333,9 +334,6 @@ bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc) case V4L2_PIX_FMT_YUV32: tpg->twopixelsize[0] = 2 * 4; break; - case V4L2_PIX_FMT_GREY: - tpg->twopixelsize[0] = 2; - break; case V4L2_PIX_FMT_NV12: case V4L2_PIX_FMT_NV21: case V4L2_PIX_FMT_NV12M: -- 2.1.4 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 0/4] Add support for V4L2_PIX_FMT_Y16_BE [not found] ` <1430726852-11715-1-git-send-email-ricardo.ribalda-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 2015-05-04 8:07 ` [PATCH 1/4] media/vivid: Add support for Y16 format Ricardo Ribalda Delgado 2015-05-04 8:07 ` [PATCH 4/4] media/vivid: Code cleanout Ricardo Ribalda Delgado @ 2015-05-18 19:26 ` Mauro Carvalho Chehab [not found] ` <20150518162657.031a86fc-+RedX5hVuTR+urZeOPWqwQ@public.gmane.org> 2 siblings, 1 reply; 7+ messages in thread From: Mauro Carvalho Chehab @ 2015-05-18 19:26 UTC (permalink / raw) To: Ricardo Ribalda Delgado, Hans Verkuil Cc: Laurent Pinchart, Sakari Ailus, Ramakrishnan Muthukrishnan, linux-media-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA, linux-api-u79uwXL29TY76Z2rM5mHXA Em Mon, 4 May 2015 10:07:28 +0200 Ricardo Ribalda Delgado <ricardo.ribalda-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> escreveu: > New pixel format type Y16_BE (16 bits greyscale big-endian). > > Once I get the fist feedback on this patch I will send the patches for > v4lconvert and qv4l2. Hmm... Error: no ID for constraint linkend: V4L2-PIX-FMT-Y16-BE. Where's the documentation for this new format? Regards, Mauro > > > Thanks > > Ricardo Ribalda Delgado (4): > media/vivid: Add support for Y16 format > media/v4l2-core: Add support for V4L2_PIX_FMT_Y16_BE > media/vivid: Add support for Y16_BE format > media/vivid: Code cleanout > > drivers/media/platform/vivid/vivid-tpg.c | 20 ++++++++++++++++---- > drivers/media/platform/vivid/vivid-vid-common.c | 16 ++++++++++++++++ > drivers/media/v4l2-core/v4l2-ioctl.c | 1 + > include/uapi/linux/videodev2.h | 1 + > 4 files changed, 34 insertions(+), 4 deletions(-) > ^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <20150518162657.031a86fc-+RedX5hVuTR+urZeOPWqwQ@public.gmane.org>]
* Re: [PATCH 0/4] Add support for V4L2_PIX_FMT_Y16_BE [not found] ` <20150518162657.031a86fc-+RedX5hVuTR+urZeOPWqwQ@public.gmane.org> @ 2015-05-18 19:31 ` Ricardo Ribalda Delgado 0 siblings, 0 replies; 7+ messages in thread From: Ricardo Ribalda Delgado @ 2015-05-18 19:31 UTC (permalink / raw) To: Mauro Carvalho Chehab Cc: Hans Verkuil, Laurent Pinchart, Sakari Ailus, Ramakrishnan Muthukrishnan, linux-media, LKML, linux-api-u79uwXL29TY76Z2rM5mHXA Hello Mauro it is here https://patchwork.linuxtv.org/patch/29669/ Thanks! On Mon, May 18, 2015 at 9:26 PM, Mauro Carvalho Chehab <mchehab-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org> wrote: > Em Mon, 4 May 2015 10:07:28 +0200 > Ricardo Ribalda Delgado <ricardo.ribalda-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> escreveu: > >> New pixel format type Y16_BE (16 bits greyscale big-endian). >> >> Once I get the fist feedback on this patch I will send the patches for >> v4lconvert and qv4l2. > > Hmm... > > Error: no ID for constraint linkend: V4L2-PIX-FMT-Y16-BE. > > Where's the documentation for this new format? > > Regards, > Mauro > > >> >> >> Thanks >> >> Ricardo Ribalda Delgado (4): >> media/vivid: Add support for Y16 format >> media/v4l2-core: Add support for V4L2_PIX_FMT_Y16_BE >> media/vivid: Add support for Y16_BE format >> media/vivid: Code cleanout >> >> drivers/media/platform/vivid/vivid-tpg.c | 20 ++++++++++++++++---- >> drivers/media/platform/vivid/vivid-vid-common.c | 16 ++++++++++++++++ >> drivers/media/v4l2-core/v4l2-ioctl.c | 1 + >> include/uapi/linux/videodev2.h | 1 + >> 4 files changed, 34 insertions(+), 4 deletions(-) >> -- Ricardo Ribalda ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2015-05-18 19:31 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-04 8:07 [PATCH 0/4] Add support for V4L2_PIX_FMT_Y16_BE Ricardo Ribalda Delgado
2015-05-04 8:07 ` [PATCH 2/4] media/v4l2-core: " Ricardo Ribalda Delgado
2015-05-04 8:07 ` [PATCH 3/4] media/vivid: Add support for Y16_BE format Ricardo Ribalda Delgado
[not found] ` <1430726852-11715-1-git-send-email-ricardo.ribalda-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-05-04 8:07 ` [PATCH 1/4] media/vivid: Add support for Y16 format Ricardo Ribalda Delgado
2015-05-04 8:07 ` [PATCH 4/4] media/vivid: Code cleanout Ricardo Ribalda Delgado
2015-05-18 19:26 ` [PATCH 0/4] Add support for V4L2_PIX_FMT_Y16_BE Mauro Carvalho Chehab
[not found] ` <20150518162657.031a86fc-+RedX5hVuTR+urZeOPWqwQ@public.gmane.org>
2015-05-18 19:31 ` Ricardo Ribalda Delgado
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox