diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2015-03-13 04:36:08 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-04-02 20:05:37 -0400 |
commit | 68cd4e9f21d9d3b868f78eb3a85165229cb4f024 (patch) | |
tree | 28c5eb39c207e89f9ab8abf049a580bf212e308b /drivers/media/platform | |
parent | f234a76e10e700a01ad473358921bc695b6ef5c9 (diff) |
[media] vivid: add support for BGR666
Add support for the four byte BGR666 format.
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 | 13 | ||||
-rw-r--r-- | drivers/media/platform/vivid/vivid-vid-common.c | 8 |
2 files changed, 21 insertions, 0 deletions
diff --git a/drivers/media/platform/vivid/vivid-tpg.c b/drivers/media/platform/vivid/vivid-tpg.c index fd28c6a5f8e9..0e2b8d4b8864 100644 --- a/drivers/media/platform/vivid/vivid-tpg.c +++ b/drivers/media/platform/vivid/vivid-tpg.c | |||
@@ -200,6 +200,7 @@ bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc) | |||
200 | case V4L2_PIX_FMT_RGB555X: | 200 | case V4L2_PIX_FMT_RGB555X: |
201 | case V4L2_PIX_FMT_XRGB555X: | 201 | case V4L2_PIX_FMT_XRGB555X: |
202 | case V4L2_PIX_FMT_ARGB555X: | 202 | case V4L2_PIX_FMT_ARGB555X: |
203 | case V4L2_PIX_FMT_BGR666: | ||
203 | case V4L2_PIX_FMT_RGB24: | 204 | case V4L2_PIX_FMT_RGB24: |
204 | case V4L2_PIX_FMT_BGR24: | 205 | case V4L2_PIX_FMT_BGR24: |
205 | case V4L2_PIX_FMT_RGB32: | 206 | case V4L2_PIX_FMT_RGB32: |
@@ -299,6 +300,7 @@ bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc) | |||
299 | case V4L2_PIX_FMT_BGR24: | 300 | case V4L2_PIX_FMT_BGR24: |
300 | tpg->twopixelsize[0] = 2 * 3; | 301 | tpg->twopixelsize[0] = 2 * 3; |
301 | break; | 302 | break; |
303 | case V4L2_PIX_FMT_BGR666: | ||
302 | case V4L2_PIX_FMT_RGB32: | 304 | case V4L2_PIX_FMT_RGB32: |
303 | case V4L2_PIX_FMT_BGR32: | 305 | case V4L2_PIX_FMT_BGR32: |
304 | case V4L2_PIX_FMT_XRGB32: | 306 | case V4L2_PIX_FMT_XRGB32: |
@@ -749,6 +751,11 @@ static void precalculate_color(struct tpg_data *tpg, int k) | |||
749 | g >>= 7; | 751 | g >>= 7; |
750 | b >>= 7; | 752 | b >>= 7; |
751 | break; | 753 | break; |
754 | case V4L2_PIX_FMT_BGR666: | ||
755 | r >>= 6; | ||
756 | g >>= 6; | ||
757 | b >>= 6; | ||
758 | break; | ||
752 | default: | 759 | default: |
753 | r >>= 4; | 760 | r >>= 4; |
754 | g >>= 4; | 761 | g >>= 4; |
@@ -944,6 +951,12 @@ static void gen_twopix(struct tpg_data *tpg, | |||
944 | buf[0][offset + 1] = g_u; | 951 | buf[0][offset + 1] = g_u; |
945 | buf[0][offset + 2] = r_y; | 952 | buf[0][offset + 2] = r_y; |
946 | break; | 953 | break; |
954 | case V4L2_PIX_FMT_BGR666: | ||
955 | buf[0][offset] = (b_v << 2) | (g_u >> 4); | ||
956 | buf[0][offset + 1] = (g_u << 4) | (r_y >> 2); | ||
957 | buf[0][offset + 2] = r_y << 6; | ||
958 | buf[0][offset + 3] = 0; | ||
959 | break; | ||
947 | case V4L2_PIX_FMT_RGB32: | 960 | case V4L2_PIX_FMT_RGB32: |
948 | case V4L2_PIX_FMT_XRGB32: | 961 | case V4L2_PIX_FMT_XRGB32: |
949 | alpha = 0; | 962 | alpha = 0; |
diff --git a/drivers/media/platform/vivid/vivid-vid-common.c b/drivers/media/platform/vivid/vivid-vid-common.c index 9e8c06a102e9..58b42d267342 100644 --- a/drivers/media/platform/vivid/vivid-vid-common.c +++ b/drivers/media/platform/vivid/vivid-vid-common.c | |||
@@ -291,6 +291,14 @@ struct vivid_fmt vivid_formats[] = { | |||
291 | .buffers = 1, | 291 | .buffers = 1, |
292 | }, | 292 | }, |
293 | { | 293 | { |
294 | .name = "BGR666", | ||
295 | .fourcc = V4L2_PIX_FMT_BGR666, /* bbbbbbgg ggggrrrr rrxxxxxx */ | ||
296 | .vdownsampling = { 1 }, | ||
297 | .bit_depth = { 32 }, | ||
298 | .planes = 1, | ||
299 | .buffers = 1, | ||
300 | }, | ||
301 | { | ||
294 | .name = "RGB32 (LE)", | 302 | .name = "RGB32 (LE)", |
295 | .fourcc = V4L2_PIX_FMT_RGB32, /* xrgb */ | 303 | .fourcc = V4L2_PIX_FMT_RGB32, /* xrgb */ |
296 | .vdownsampling = { 1 }, | 304 | .vdownsampling = { 1 }, |