]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00182441 V4L2 output: set screen black when resizing during video playback
authorWayne Zou <b36644@freescale.com>
Mon, 2 Jul 2012 06:54:07 +0000 (14:54 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:34:57 +0000 (08:34 +0200)
set screen black when resizing during video playback.
Fix bug: when video playback, switch to full screen or leave full screen,
sometime it has the colour stripe

Signed-off-by: Wayne Zou <b36644@freescale.com>
drivers/media/video/mxc/output/mxc_vout.c

index 419f418ec62f76d387949710ea2564a2df848910..0f755e3353a4a024ec4a65d9d304d7ad59228495 100644 (file)
 #include <media/v4l2-device.h>
 #include <media/v4l2-ioctl.h>
 
+#define UYVY_BLACK     (0x00800080)
+#define RGB_BLACK      (0x0)
+#define NV12_UV_BLACK  (0x80)
+#define NV12_Y_BLACK   (0x0)
+
 #define MAX_FB_NUM     6
 #define FB_BUFS                3
 #define VDOA_FB_BUFS   (FB_BUFS - 1)
@@ -1583,9 +1588,12 @@ static int config_disp_output(struct mxc_vout_output *vout)
        struct dma_mem *buf = NULL;
        struct fb_info *fbi = vout->fbi;
        struct fb_var_screeninfo var;
-       int i, display_buf_size, fb_num, ret;
+       int i, fb_num, ret;
        u32 fb_base;
        u32 size;
+       u32 display_buf_size;
+       u32 *pixel = NULL;
+       u32 color;
        int j;
 
        memcpy(&var, &fbi->var, sizeof(var));
@@ -1668,6 +1676,20 @@ static int config_disp_output(struct mxc_vout_output *vout)
                        fbi->fix.smem_len, fbi->fix.smem_start, fb_base);
        }
 
+       /* fill black when video config changed */
+       color = colorspaceofpixel(vout->task.output.format) == YUV_CS ?
+                       UYVY_BLACK : RGB_BLACK;
+       if (vout->task.output.format == IPU_PIX_FMT_NV12) {
+               size = display_buf_size * 8 /
+                       fmt_to_bpp(vout->task.output.format);
+               memset(fbi->screen_base, NV12_Y_BLACK, size);
+               memset(fbi->screen_base + size, NV12_UV_BLACK,
+                               display_buf_size - size);
+       } else {
+               pixel = (u32 *)fbi->screen_base;
+               for (i = 0; i < (display_buf_size >> 2); i++)
+                       *pixel++ = color;
+       }
        console_lock();
        fbi->flags |= FBINFO_MISC_USEREVENT;
        ret = fb_blank(fbi, FB_BLANK_UNBLANK);