diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2015-03-12 11:08:01 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-04-03 03:03:31 +0300 |
commit | 8f1ff5435d314d607504964f13593a074e8efac9 (patch) | |
tree | beda83043760538a129643fbdd193ff8529e42e5 /drivers/media/platform/vivid/vivid-tpg.c | |
parent | 9e1b73cfed2e28061810221467aa3bdd5284cc83 (diff) | |
download | linux-8f1ff5435d314d607504964f13593a074e8efac9.tar.xz |
[media] vivid: add support for [A|X]RGB555X
Only RGB555X was supported, add support for the other two variants.
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/vivid/vivid-tpg.c')
-rw-r--r-- | drivers/media/platform/vivid/vivid-tpg.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/media/platform/vivid/vivid-tpg.c b/drivers/media/platform/vivid/vivid-tpg.c index fe546e976b7f..a906cc5a0331 100644 --- a/drivers/media/platform/vivid/vivid-tpg.c +++ b/drivers/media/platform/vivid/vivid-tpg.c @@ -197,6 +197,8 @@ bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc) case V4L2_PIX_FMT_XRGB555: case V4L2_PIX_FMT_ARGB555: case V4L2_PIX_FMT_RGB555X: + case V4L2_PIX_FMT_XRGB555X: + case V4L2_PIX_FMT_ARGB555X: case V4L2_PIX_FMT_RGB24: case V4L2_PIX_FMT_BGR24: case V4L2_PIX_FMT_RGB32: @@ -274,6 +276,8 @@ bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc) case V4L2_PIX_FMT_XRGB555: case V4L2_PIX_FMT_ARGB555: case V4L2_PIX_FMT_RGB555X: + case V4L2_PIX_FMT_XRGB555X: + case V4L2_PIX_FMT_ARGB555X: case V4L2_PIX_FMT_YUYV: case V4L2_PIX_FMT_UYVY: case V4L2_PIX_FMT_YVYU: @@ -718,6 +722,8 @@ static void precalculate_color(struct tpg_data *tpg, int k) case V4L2_PIX_FMT_XRGB555: case V4L2_PIX_FMT_ARGB555: case V4L2_PIX_FMT_RGB555X: + case V4L2_PIX_FMT_XRGB555X: + case V4L2_PIX_FMT_ARGB555X: r >>= 7; g >>= 7; b >>= 7; @@ -885,6 +891,10 @@ static void gen_twopix(struct tpg_data *tpg, buf[0][offset + 1] = (alpha & 0x80) | (r_y << 2) | (g_u >> 3); break; 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 + 1] = (g_u << 5) | b_v; break; |