The patch number 9239 was added via Mauro Carvalho Chehab <[EMAIL PROTECTED]>
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
        [EMAIL PROTECTED]

------

From: Magnus Damm  <[EMAIL PROTECTED]>
Add support for rgb555 pixel formats to vivi


This patch adds RGB555 pixel format support to the vivi driver. Both
little endian and big endian versions are added. The driver follows
the RGB pixel format described in Table 2-2 of the V4L2 API spec,
_not_ the older BGR interpretation described in Table 2-1.

Signed-off-by: Magnus Damm <[EMAIL PROTECTED]>
Signed-off-by: Mauro Carvalho Chehab <[EMAIL PROTECTED]>


---

 linux/drivers/media/video/vivi.c |   40 +++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff -r ad28ee785319 -r c8a63c43b663 linux/drivers/media/video/vivi.c
--- a/linux/drivers/media/video/vivi.c  Tue Oct 14 15:47:35 2008 +0000
+++ b/linux/drivers/media/video/vivi.c  Tue Oct 14 15:47:43 2008 +0000
@@ -152,6 +152,16 @@ static struct vivi_fmt formats[] = {
                .fourcc   = V4L2_PIX_FMT_RGB565X, /* rrrrrggg gggbbbbb */
                .depth    = 16,
        },
+       {
+               .name     = "RGB555 (LE)",
+               .fourcc   = V4L2_PIX_FMT_RGB555, /* gggbbbbb arrrrrgg */
+               .depth    = 16,
+       },
+       {
+               .name     = "RGB555 (BE)",
+               .fourcc   = V4L2_PIX_FMT_RGB555X, /* arrrrrgg gggbbbbb */
+               .depth    = 16,
+       },
 };
 
 static struct vivi_fmt *get_format(struct v4l2_format *f)
@@ -331,6 +341,30 @@ static void gen_twopix(struct vivi_fh *f
                        case 0:
                        case 2:
                                *p = (r_y << 3) | (g_u >> 3);
+                               break;
+                       case 1:
+                       case 3:
+                               *p = (g_u << 5) | b_v;
+                               break;
+                       }
+                       break;
+               case V4L2_PIX_FMT_RGB555:
+                       switch (color) {
+                       case 0:
+                       case 2:
+                               *p = (g_u << 5) | b_v;
+                               break;
+                       case 1:
+                       case 3:
+                               *p = (r_y << 2) | (g_u >> 3);
+                               break;
+                       }
+                       break;
+               case V4L2_PIX_FMT_RGB555X:
+                       switch (color) {
+                       case 0:
+                       case 2:
+                               *p = (r_y << 2) | (g_u >> 3);
                                break;
                        case 1:
                        case 3:
@@ -819,6 +853,12 @@ static int vidioc_s_fmt_vid_cap(struct f
                case V4L2_PIX_FMT_RGB565X:
                        r >>= 3;
                        g >>= 2;
+                       b >>= 3;
+                       break;
+               case V4L2_PIX_FMT_RGB555:
+               case V4L2_PIX_FMT_RGB555X:
+                       r >>= 3;
+                       g >>= 3;
                        b >>= 3;
                        break;
                }


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/c8a63c43b6637621fd0a4238fc7823d642aeadd6

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to