Commit 8f1ff543 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

[media] vivid: add support for [A|X]RGB555X

Only RGB555X was supported, add support for the other two variants.
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 9e1b73cf
...@@ -197,6 +197,8 @@ bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc) ...@@ -197,6 +197,8 @@ bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc)
case V4L2_PIX_FMT_XRGB555: case V4L2_PIX_FMT_XRGB555:
case V4L2_PIX_FMT_ARGB555: case V4L2_PIX_FMT_ARGB555:
case V4L2_PIX_FMT_RGB555X: case V4L2_PIX_FMT_RGB555X:
case V4L2_PIX_FMT_XRGB555X:
case V4L2_PIX_FMT_ARGB555X:
case V4L2_PIX_FMT_RGB24: case V4L2_PIX_FMT_RGB24:
case V4L2_PIX_FMT_BGR24: case V4L2_PIX_FMT_BGR24:
case V4L2_PIX_FMT_RGB32: case V4L2_PIX_FMT_RGB32:
...@@ -274,6 +276,8 @@ bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc) ...@@ -274,6 +276,8 @@ bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc)
case V4L2_PIX_FMT_XRGB555: case V4L2_PIX_FMT_XRGB555:
case V4L2_PIX_FMT_ARGB555: case V4L2_PIX_FMT_ARGB555:
case V4L2_PIX_FMT_RGB555X: case V4L2_PIX_FMT_RGB555X:
case V4L2_PIX_FMT_XRGB555X:
case V4L2_PIX_FMT_ARGB555X:
case V4L2_PIX_FMT_YUYV: case V4L2_PIX_FMT_YUYV:
case V4L2_PIX_FMT_UYVY: case V4L2_PIX_FMT_UYVY:
case V4L2_PIX_FMT_YVYU: case V4L2_PIX_FMT_YVYU:
...@@ -718,6 +722,8 @@ static void precalculate_color(struct tpg_data *tpg, int k) ...@@ -718,6 +722,8 @@ static void precalculate_color(struct tpg_data *tpg, int k)
case V4L2_PIX_FMT_XRGB555: case V4L2_PIX_FMT_XRGB555:
case V4L2_PIX_FMT_ARGB555: case V4L2_PIX_FMT_ARGB555:
case V4L2_PIX_FMT_RGB555X: case V4L2_PIX_FMT_RGB555X:
case V4L2_PIX_FMT_XRGB555X:
case V4L2_PIX_FMT_ARGB555X:
r >>= 7; r >>= 7;
g >>= 7; g >>= 7;
b >>= 7; b >>= 7;
...@@ -885,6 +891,10 @@ static void gen_twopix(struct tpg_data *tpg, ...@@ -885,6 +891,10 @@ static void gen_twopix(struct tpg_data *tpg,
buf[0][offset + 1] = (alpha & 0x80) | (r_y << 2) | (g_u >> 3); buf[0][offset + 1] = (alpha & 0x80) | (r_y << 2) | (g_u >> 3);
break; break;
case V4L2_PIX_FMT_RGB555X: case V4L2_PIX_FMT_RGB555X:
case V4L2_PIX_FMT_XRGB555X:
alpha = 0;
/* fall through */
case V4L2_PIX_FMT_ARGB555X:
buf[0][offset] = (alpha & 0x80) | (r_y << 2) | (g_u >> 3); buf[0][offset] = (alpha & 0x80) | (r_y << 2) | (g_u >> 3);
buf[0][offset + 1] = (g_u << 5) | b_v; buf[0][offset + 1] = (g_u << 5) | b_v;
break; break;
......
...@@ -230,7 +230,23 @@ struct vivid_fmt vivid_formats[] = { ...@@ -230,7 +230,23 @@ struct vivid_fmt vivid_formats[] = {
.bit_depth = { 16 }, .bit_depth = { 16 },
.planes = 1, .planes = 1,
.buffers = 1, .buffers = 1,
.can_do_overlay = true, },
{
.name = "XRGB555 (BE)",
.fourcc = V4L2_PIX_FMT_XRGB555X, /* xrrrrrgg gggbbbbb */
.vdownsampling = { 1 },
.bit_depth = { 16 },
.planes = 1,
.buffers = 1,
},
{
.name = "ARGB555 (BE)",
.fourcc = V4L2_PIX_FMT_ARGB555X, /* arrrrrgg gggbbbbb */
.vdownsampling = { 1 },
.bit_depth = { 16 },
.planes = 1,
.buffers = 1,
.alpha_mask = 0x0080,
}, },
{ {
.name = "RGB24 (LE)", .name = "RGB24 (LE)",
......
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