From 87f4ad890a3702c3547966c1da59dc7124d527fd Mon Sep 17 00:00:00 2001 From: Wayne Zou Date: Mon, 2 Jul 2012 14:54:07 +0800 Subject: [PATCH] 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 --- drivers/media/video/mxc/output/mxc_vout.c | 24 ++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) 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); -- 2.39.5