summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorJason Chen <b02280@freescale.com>2010-02-08 13:31:00 +0800
committerAlejandro Gonzalez <alex.gonzalez@digi.com>2010-05-24 12:16:00 +0200
commit0a018150ce613cabf3e9eff16bc0681476601408 (patch)
treedbd76ba02d8033a69ff4521a902741e5d1967739 /drivers/media
parent8c443dca0610624b4a0b676fe1f6dfb9fa95e8da (diff)
ENGR00120805 v4l2 output: fill black color to disp fb before streamon
There is a short show of previous played frame if not fill black color to display fb. Because fb device will unblank ahead of real data come. Signed-off-by: Jason Chen <b02280@freescale.com> Signed-off-by: Alejandro Gonzalez <alex.gonzalez@digi.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/mxc/output/mxc_v4l2_output.c42
1 files changed, 38 insertions, 4 deletions
diff --git a/drivers/media/video/mxc/output/mxc_v4l2_output.c b/drivers/media/video/mxc/output/mxc_v4l2_output.c
index 91205bed04de..41bfaa6b7789 100644
--- a/drivers/media/video/mxc/output/mxc_v4l2_output.c
+++ b/drivers/media/video/mxc/output/mxc_v4l2_output.c
@@ -1365,13 +1365,47 @@ static int mxc_v4l2out_streamon(vout_data * vout)
vout->display_buf_size = vout->xres *
vout->yres * fbi->var.bits_per_pixel / 8;
+ /* fill black color for init fb, we assume fb has double buffer*/
if (format_is_yuv(vout->v2f.fmt.pix.pixelformat)) {
int i;
- short * tmp = (short *) fbi->screen_base;
- for (i = 0; i < (fbi->fix.line_length * fbi->var.yres_virtual)/2; i++, tmp++)
- *tmp = 0x80;
+
+ if ((vout->v2f.fmt.pix.pixelformat == V4L2_PIX_FMT_UYVY) ||
+ (vout->v2f.fmt.pix.pixelformat == V4L2_PIX_FMT_YUYV) ||
+ (!vout->ic_bypass)) {
+ short * tmp = (short *) fbi->screen_base;
+ short color;
+ if (vout->v2f.fmt.pix.pixelformat == V4L2_PIX_FMT_YUYV)
+ color = 0x8000;
+ else
+ color = 0x80;
+ for (i = 0; i < (fbi->fix.line_length * fbi->var.yres_virtual)/2;
+ i++, tmp++)
+ *tmp = color;
+ } else if ((vout->v2f.fmt.pix.pixelformat == V4L2_PIX_FMT_YUV420) ||
+ (vout->v2f.fmt.pix.pixelformat == V4L2_PIX_FMT_YVU420) ||
+ (vout->v2f.fmt.pix.pixelformat == V4L2_PIX_FMT_NV12)) {
+ char * base = (char *)fbi->screen_base;
+ int j, screen_size = fbi->var.xres * fbi->var.yres;
+
+ for (j = 0; j < 2; j++) {
+ memset(base, 0, screen_size);
+ base += screen_size;
+ for (i = 0; i < screen_size/2; i++, base++)
+ *base = 0x80;
+ }
+ } else if (vout->v2f.fmt.pix.pixelformat == V4L2_PIX_FMT_YUV422P) {
+ char * base = (char *)fbi->screen_base;
+ int j, screen_size = fbi->var.xres * fbi->var.yres;
+
+ for (j = 0; j < 2; j++) {
+ memset(base, 0, screen_size);
+ base += screen_size;
+ for (i = 0; i < screen_size; i++, base++)
+ *base = 0x80;
+ }
+ }
} else
- memset(fbi->screen_base, 0x10,
+ memset(fbi->screen_base, 0x0,
fbi->fix.line_length * fbi->var.yres_virtual);
if (INTERLACED_CONTENT(vout))