Commit 68cd4e9f authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

[media] vivid: add support for BGR666

Add support for the four byte BGR666 format.
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent f234a76e
......@@ -200,6 +200,7 @@ bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc)
case V4L2_PIX_FMT_RGB555X:
case V4L2_PIX_FMT_XRGB555X:
case V4L2_PIX_FMT_ARGB555X:
case V4L2_PIX_FMT_BGR666:
case V4L2_PIX_FMT_RGB24:
case V4L2_PIX_FMT_BGR24:
case V4L2_PIX_FMT_RGB32:
......@@ -299,6 +300,7 @@ bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc)
case V4L2_PIX_FMT_BGR24:
tpg->twopixelsize[0] = 2 * 3;
break;
case V4L2_PIX_FMT_BGR666:
case V4L2_PIX_FMT_RGB32:
case V4L2_PIX_FMT_BGR32:
case V4L2_PIX_FMT_XRGB32:
......@@ -749,6 +751,11 @@ static void precalculate_color(struct tpg_data *tpg, int k)
g >>= 7;
b >>= 7;
break;
case V4L2_PIX_FMT_BGR666:
r >>= 6;
g >>= 6;
b >>= 6;
break;
default:
r >>= 4;
g >>= 4;
......@@ -944,6 +951,12 @@ static void gen_twopix(struct tpg_data *tpg,
buf[0][offset + 1] = g_u;
buf[0][offset + 2] = r_y;
break;
case V4L2_PIX_FMT_BGR666:
buf[0][offset] = (b_v << 2) | (g_u >> 4);
buf[0][offset + 1] = (g_u << 4) | (r_y >> 2);
buf[0][offset + 2] = r_y << 6;
buf[0][offset + 3] = 0;
break;
case V4L2_PIX_FMT_RGB32:
case V4L2_PIX_FMT_XRGB32:
alpha = 0;
......
......@@ -290,6 +290,14 @@ struct vivid_fmt vivid_formats[] = {
.planes = 1,
.buffers = 1,
},
{
.name = "BGR666",
.fourcc = V4L2_PIX_FMT_BGR666, /* bbbbbbgg ggggrrrr rrxxxxxx */
.vdownsampling = { 1 },
.bit_depth = { 32 },
.planes = 1,
.buffers = 1,
},
{
.name = "RGB32 (LE)",
.fourcc = V4L2_PIX_FMT_RGB32, /* xrgb */
......
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