From: Jason Chen Date: Wed, 16 Nov 2011 09:29:19 +0000 (+0800) Subject: ENGR00162358 ipuv3 fb: only check pos when fb is unblank X-Git-Tag: v3.0.35-fsl_4.1.0~2046 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=55b6c58cf825f68093d1ca7be9d5dd2a9cd6d41c;p=karo-tx-linux.git ENGR00162358 ipuv3 fb: only check pos when fb is unblank only check pos when fb is unblank Signed-off-by: Jason Chen --- diff --git a/drivers/video/mxc/mxc_ipuv3_fb.c b/drivers/video/mxc/mxc_ipuv3_fb.c index e7ad13727de5..d1036c805946 100644 --- a/drivers/video/mxc/mxc_ipuv3_fb.c +++ b/drivers/video/mxc/mxc_ipuv3_fb.c @@ -1028,17 +1028,20 @@ static int mxcfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg) break; } - if (fbi->var.xres + pos.x > bg_fbi->var.xres) { - if (bg_fbi->var.xres < fbi->var.xres) - pos.x = 0; - else - pos.x = bg_fbi->var.xres - fbi->var.xres; - } - if (fbi->var.yres + pos.y > bg_fbi->var.yres) { - if (bg_fbi->var.yres < fbi->var.yres) - pos.y = 0; - else - pos.y = bg_fbi->var.yres - fbi->var.yres; + /* if fb is unblank, check if the pos fit the display */ + if (mxc_fbi->cur_blank == FB_BLANK_UNBLANK) { + if (fbi->var.xres + pos.x > bg_fbi->var.xres) { + if (bg_fbi->var.xres < fbi->var.xres) + pos.x = 0; + else + pos.x = bg_fbi->var.xres - fbi->var.xres; + } + if (fbi->var.yres + pos.y > bg_fbi->var.yres) { + if (bg_fbi->var.yres < fbi->var.yres) + pos.y = 0; + else + pos.y = bg_fbi->var.yres - fbi->var.yres; + } } retval = ipu_disp_set_window_pos(mxc_fbi->ipu, mxc_fbi->ipu_ch,