media: vivid: add support for new pixelformats
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Fri, 26 Jul 2019 12:08:21 +0000 (08:08 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Tue, 30 Jul 2019 16:17:34 +0000 (12:17 -0400)
New RGB444, RGB555 and RGB32 variants were recently added. Now also
support them in vivid.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/platform/vivid/vivid-vid-common.c

index 1f33eb1a76b68ae8be26027ee9e1b2af7f0a10d9..8665dfd25eb47556eff0b8692d364ad33d6c0184 100644 (file)
@@ -262,21 +262,66 @@ struct vivid_fmt vivid_formats[] = {
                .can_do_overlay = true,
        },
        {
-               .fourcc   = V4L2_PIX_FMT_RGB444, /* xxxxrrrr ggggbbbb */
+               .fourcc   = V4L2_PIX_FMT_RGB444, /* ggggbbbb xxxxrrrr */
                .vdownsampling = { 1 },
                .bit_depth = { 16 },
                .planes   = 1,
                .buffers = 1,
        },
        {
-               .fourcc   = V4L2_PIX_FMT_XRGB444, /* xxxxrrrr ggggbbbb */
+               .fourcc   = V4L2_PIX_FMT_XRGB444, /* ggggbbbb xxxxrrrr */
                .vdownsampling = { 1 },
                .bit_depth = { 16 },
                .planes   = 1,
                .buffers = 1,
        },
        {
-               .fourcc   = V4L2_PIX_FMT_ARGB444, /* aaaarrrr ggggbbbb */
+               .fourcc   = V4L2_PIX_FMT_ARGB444, /* ggggbbbb aaaarrrr */
+               .vdownsampling = { 1 },
+               .bit_depth = { 16 },
+               .planes   = 1,
+               .buffers = 1,
+               .alpha_mask = 0x00f0,
+       },
+       {
+               .fourcc   = V4L2_PIX_FMT_RGBX444, /* bbbbxxxx rrrrgggg */
+               .vdownsampling = { 1 },
+               .bit_depth = { 16 },
+               .planes   = 1,
+               .buffers = 1,
+       },
+       {
+               .fourcc   = V4L2_PIX_FMT_RGBA444, /* bbbbaaaa rrrrgggg */
+               .vdownsampling = { 1 },
+               .bit_depth = { 16 },
+               .planes   = 1,
+               .buffers = 1,
+               .alpha_mask = 0x00f0,
+       },
+       {
+               .fourcc   = V4L2_PIX_FMT_XBGR444, /* ggggrrrr xxxxbbbb */
+               .vdownsampling = { 1 },
+               .bit_depth = { 16 },
+               .planes   = 1,
+               .buffers = 1,
+       },
+       {
+               .fourcc   = V4L2_PIX_FMT_ABGR444, /* ggggrrrr aaaabbbb */
+               .vdownsampling = { 1 },
+               .bit_depth = { 16 },
+               .planes   = 1,
+               .buffers = 1,
+               .alpha_mask = 0x00f0,
+       },
+       {
+               .fourcc   = V4L2_PIX_FMT_BGRX444, /* rrrrxxxx bbbbgggg */
+               .vdownsampling = { 1 },
+               .bit_depth = { 16 },
+               .planes   = 1,
+               .buffers = 1,
+       },
+       {
+               .fourcc   = V4L2_PIX_FMT_BGRA444, /* rrrraaaa bbbbgggg  */
                .vdownsampling = { 1 },
                .bit_depth = { 16 },
                .planes   = 1,
@@ -308,6 +353,57 @@ struct vivid_fmt vivid_formats[] = {
                .can_do_overlay = true,
                .alpha_mask = 0x8000,
        },
+       {
+               .fourcc   = V4L2_PIX_FMT_RGBX555, /* ggbbbbbx rrrrrggg */
+               .vdownsampling = { 1 },
+               .bit_depth = { 16 },
+               .planes   = 1,
+               .buffers = 1,
+               .can_do_overlay = true,
+       },
+       {
+               .fourcc   = V4L2_PIX_FMT_RGBA555, /* ggbbbbba rrrrrggg */
+               .vdownsampling = { 1 },
+               .bit_depth = { 16 },
+               .planes   = 1,
+               .buffers = 1,
+               .can_do_overlay = true,
+               .alpha_mask = 0x8000,
+       },
+       {
+               .fourcc   = V4L2_PIX_FMT_XBGR555, /* gggrrrrr xbbbbbgg */
+               .vdownsampling = { 1 },
+               .bit_depth = { 16 },
+               .planes   = 1,
+               .buffers = 1,
+               .can_do_overlay = true,
+       },
+       {
+               .fourcc   = V4L2_PIX_FMT_ABGR555, /* gggrrrrr abbbbbgg */
+               .vdownsampling = { 1 },
+               .bit_depth = { 16 },
+               .planes   = 1,
+               .buffers = 1,
+               .can_do_overlay = true,
+               .alpha_mask = 0x8000,
+       },
+       {
+               .fourcc   = V4L2_PIX_FMT_BGRX555, /* ggrrrrrx bbbbbggg */
+               .vdownsampling = { 1 },
+               .bit_depth = { 16 },
+               .planes   = 1,
+               .buffers = 1,
+               .can_do_overlay = true,
+       },
+       {
+               .fourcc   = V4L2_PIX_FMT_BGRA555, /* ggrrrrra bbbbbggg */
+               .vdownsampling = { 1 },
+               .bit_depth = { 16 },
+               .planes   = 1,
+               .buffers = 1,
+               .can_do_overlay = true,
+               .alpha_mask = 0x8000,
+       },
        {
                .fourcc   = V4L2_PIX_FMT_RGB555X, /* xrrrrrgg gggbbbbb */
                .vdownsampling = { 1 },
@@ -395,6 +491,36 @@ struct vivid_fmt vivid_formats[] = {
                .buffers = 1,
                .alpha_mask = 0xff000000,
        },
+       {
+               .fourcc   = V4L2_PIX_FMT_RGBX32, /* rgbx */
+               .vdownsampling = { 1 },
+               .bit_depth = { 32 },
+               .planes   = 1,
+               .buffers = 1,
+       },
+       {
+               .fourcc   = V4L2_PIX_FMT_BGRX32, /* xbgr */
+               .vdownsampling = { 1 },
+               .bit_depth = { 32 },
+               .planes   = 1,
+               .buffers = 1,
+       },
+       {
+               .fourcc   = V4L2_PIX_FMT_RGBA32, /* rgba */
+               .vdownsampling = { 1 },
+               .bit_depth = { 32 },
+               .planes   = 1,
+               .buffers = 1,
+               .alpha_mask = 0x000000ff,
+       },
+       {
+               .fourcc   = V4L2_PIX_FMT_BGRA32, /* abgr */
+               .vdownsampling = { 1 },
+               .bit_depth = { 32 },
+               .planes   = 1,
+               .buffers = 1,
+               .alpha_mask = 0xff000000,
+       },
        {
                .fourcc   = V4L2_PIX_FMT_SBGGR8, /* Bayer BG/GR */
                .vdownsampling = { 1 },