This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/cgit.cgi/media_tree.git tree:

Subject: [media] vivid: add support for PIX_FMT_RGB332
Author:  Hans Verkuil <[email protected]>
Date:    Thu Mar 12 15:40:36 2015 -0300

Add support for the one-byte-per-pixel RGB332 format.

Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>

 drivers/media/platform/vivid/vivid-tpg.c        |   12 ++++++++++++
 drivers/media/platform/vivid/vivid-vid-common.c |    8 ++++++++
 2 files changed, 20 insertions(+), 0 deletions(-)

---

http://git.linuxtv.org/cgit.cgi/media_tree.git/commit/?id=71491063b85c04e6b68803db52cca7a9f14a945e

diff --git a/drivers/media/platform/vivid/vivid-tpg.c 
b/drivers/media/platform/vivid/vivid-tpg.c
index 0d31532..fd28c6a 100644
--- a/drivers/media/platform/vivid/vivid-tpg.c
+++ b/drivers/media/platform/vivid/vivid-tpg.c
@@ -188,6 +188,7 @@ bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc)
        tpg->hmask[2] = ~0;
 
        switch (fourcc) {
+       case V4L2_PIX_FMT_RGB332:
        case V4L2_PIX_FMT_RGB565:
        case V4L2_PIX_FMT_RGB565X:
        case V4L2_PIX_FMT_RGB444:
@@ -274,6 +275,9 @@ bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc)
        }
 
        switch (fourcc) {
+       case V4L2_PIX_FMT_RGB332:
+               tpg->twopixelsize[0] = 2;
+               break;
        case V4L2_PIX_FMT_RGB565:
        case V4L2_PIX_FMT_RGB565X:
        case V4L2_PIX_FMT_RGB444:
@@ -717,6 +721,11 @@ static void precalculate_color(struct tpg_data *tpg, int k)
                        b = (b * 219) / 255 + (16 << 4);
                }
                switch (tpg->fourcc) {
+               case V4L2_PIX_FMT_RGB332:
+                       r >>= 9;
+                       g >>= 9;
+                       b >>= 10;
+                       break;
                case V4L2_PIX_FMT_RGB565:
                case V4L2_PIX_FMT_RGB565X:
                        r >>= 7;
@@ -890,6 +899,9 @@ static void gen_twopix(struct tpg_data *tpg,
                buf[0][0] = b_v;
                buf[0][2] = g_u;
                break;
+       case V4L2_PIX_FMT_RGB332:
+               buf[0][offset] = (r_y << 5) | (g_u << 2) | b_v;
+               break;
        case V4L2_PIX_FMT_RGB565:
                buf[0][offset] = (g_u << 5) | b_v;
                buf[0][offset + 1] = (r_y << 3) | (g_u >> 3);
diff --git a/drivers/media/platform/vivid/vivid-vid-common.c 
b/drivers/media/platform/vivid/vivid-vid-common.c
index aa89850..9e8c06a 100644
--- a/drivers/media/platform/vivid/vivid-vid-common.c
+++ b/drivers/media/platform/vivid/vivid-vid-common.c
@@ -171,6 +171,14 @@ struct vivid_fmt vivid_formats[] = {
                .buffers = 1,
        },
        {
+               .name     = "RGB332",
+               .fourcc   = V4L2_PIX_FMT_RGB332, /* rrrgggbb */
+               .vdownsampling = { 1 },
+               .bit_depth = { 8 },
+               .planes   = 1,
+               .buffers = 1,
+       },
+       {
                .name     = "RGB565 (LE)",
                .fourcc   = V4L2_PIX_FMT_RGB565, /* gggbbbbb rrrrrggg */
                .vdownsampling = { 1 },

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to