aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/mx3fb.c
diff options
context:
space:
mode:
authorLiu Ying <Ying.Liu@freescale.com>2012-06-10 21:06:50 -0400
committerFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>2012-06-27 02:59:51 -0400
commit41a490ec019fd172f5d0356e01d8101b4708aee2 (patch)
tree2606c9b27ebc79f17446405f362af8035ff0b982 /drivers/video/mx3fb.c
parent6cd77e00c00c5da3b6f8546dcb6dfac9611ca10b (diff)
mx3fb: avoid screen flash when panning with fb_set_var
Users may call FBIOPUT_VSCREENINFO ioctrl to do pan display. This ioctrl relies on fb_set_var() to do the job. fb_set_var() calls custom fb_set_par() method and then calls custom fb_pan_display() method. The current implementation of mx3fb reinitializes IPU display controller every time the custom fb_set_par() method is called, which makes the screen flash if fb_set_var() is called to do panning frequently. This patch compares the new var info with the cached old one to decide whether we really need to reinitialize IPU display controller. We ignore xoffset and yoffset update because it doesn't require to reinitialize the controller. Users may specify activate field of var info with FB_ACTIVATE_NOW and FB_ACTIVATE_FORCE to reinialize the controller by force. Signed-off-by: Liu Ying <Ying.Liu@freescale.com> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Diffstat (limited to 'drivers/video/mx3fb.c')
-rw-r--r--drivers/video/mx3fb.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/drivers/video/mx3fb.c b/drivers/video/mx3fb.c
index da1d052a18a5..c89f8a8d36d2 100644
--- a/drivers/video/mx3fb.c
+++ b/drivers/video/mx3fb.c
@@ -698,6 +698,26 @@ static void mx3fb_dma_done(void *arg)
698 complete(&mx3_fbi->flip_cmpl); 698 complete(&mx3_fbi->flip_cmpl);
699} 699}
700 700
701static bool mx3fb_must_set_par(struct fb_info *fbi)
702{
703 struct mx3fb_info *mx3_fbi = fbi->par;
704 struct fb_var_screeninfo old_var = mx3_fbi->cur_var;
705 struct fb_var_screeninfo new_var = fbi->var;
706
707 if ((fbi->var.activate & FB_ACTIVATE_FORCE) &&
708 (fbi->var.activate & FB_ACTIVATE_MASK) == FB_ACTIVATE_NOW)
709 return true;
710
711 /*
712 * Ignore xoffset and yoffset update,
713 * because pan display handles this case.
714 */
715 old_var.xoffset = new_var.xoffset;
716 old_var.yoffset = new_var.yoffset;
717
718 return !!memcmp(&old_var, &new_var, sizeof(struct fb_var_screeninfo));
719}
720
701static int __set_par(struct fb_info *fbi, bool lock) 721static int __set_par(struct fb_info *fbi, bool lock)
702{ 722{
703 u32 mem_len, cur_xoffset, cur_yoffset; 723 u32 mem_len, cur_xoffset, cur_yoffset;
@@ -819,7 +839,7 @@ static int mx3fb_set_par(struct fb_info *fbi)
819 839
820 mutex_lock(&mx3_fbi->mutex); 840 mutex_lock(&mx3_fbi->mutex);
821 841
822 ret = __set_par(fbi, true); 842 ret = mx3fb_must_set_par(fbi) ? __set_par(fbi, true) : 0;
823 843
824 mutex_unlock(&mx3_fbi->mutex); 844 mutex_unlock(&mx3_fbi->mutex);
825 845