diff options
author | Ricardo Ribalda <ricardo.ribalda@gmail.com> | 2015-05-04 05:07:31 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-05-30 11:34:29 -0300 |
commit | b0ce23f065744ba136e6b059369f51e5ae1fb769 (patch) | |
tree | 119cd7fe0e57923048bd706d5c796bc6900fc4c2 /drivers/media/platform | |
parent | 2e5e435fb4fdcc64db49e903baddb1ea8827385e (diff) | |
download | op-kernel-dev-b0ce23f065744ba136e6b059369f51e5ae1fb769.zip op-kernel-dev-b0ce23f065744ba136e6b059369f51e5ae1fb769.tar.gz |
[media] media/vivid: Add support for Y16_BE format
Support for V4L2_PIX_FMT_Y16_BE, a 16 bit big endian greyscale format.
Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/platform')
-rw-r--r-- | drivers/media/platform/vivid/vivid-tpg.c | 9 | ||||
-rw-r--r-- | drivers/media/platform/vivid/vivid-vid-common.c | 8 |
2 files changed, 16 insertions, 1 deletions
diff --git a/drivers/media/platform/vivid/vivid-tpg.c b/drivers/media/platform/vivid/vivid-tpg.c index af4bc97..8cac0bd 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: @@ -316,6 +317,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: @@ -713,7 +715,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; @@ -900,6 +903,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 96ccd3c..45f10a7 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 }, |