From: Wayne Zou Date: Mon, 2 Jul 2012 06:54:07 +0000 (+0800) Subject: ENGR00182441 V4L2 output: set screen black when resizing during video playback X-Git-Tag: v3.0.35-fsl~799 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=87f4ad890a3702c3547966c1da59dc7124d527fd;p=karo-tx-linux.git ENGR00182441 V4L2 output: set screen black when resizing during video playback 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 --- diff --git a/drivers/media/video/mxc/output/mxc_vout.c b/drivers/media/video/mxc/output/mxc_vout.c index 419f418ec62f..0f755e3353a4 100644 --- a/drivers/media/video/mxc/output/mxc_vout.c +++ b/drivers/media/video/mxc/output/mxc_vout.c @@ -28,6 +28,11 @@ #include #include +#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);