From 5fb3a8eb7926fa1cede3335fd24b731978cb3f32 Mon Sep 17 00:00:00 2001 From: Sandor Yu Date: Wed, 13 Jun 2012 10:39:55 +0800 Subject: [PATCH] ENGR00212838 FB display lose xoffset/yoffset after HDMI plugout/in Save overlay offset before DP disable and restore it after DP enable. Signed-off-by: Sandor Yu --- drivers/video/mxc/mxc_ipuv3_fb.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/video/mxc/mxc_ipuv3_fb.c b/drivers/video/mxc/mxc_ipuv3_fb.c index f3f5bac83783..f14e8daf70ad 100644 --- a/drivers/video/mxc/mxc_ipuv3_fb.c +++ b/drivers/video/mxc/mxc_ipuv3_fb.c @@ -334,6 +334,8 @@ static int mxcfb_set_par(struct fb_info *fbi) ipu_di_signal_cfg_t sig_cfg; struct mxcfb_info *mxc_fbi = (struct mxcfb_info *)fbi->par; + int16_t ov_pos_x = 0, ov_pos_y = 0; + int ov_pos_ret = 0; struct mxcfb_info *mxc_fbi_fg = NULL; bool ovfbi_enable = false; @@ -350,6 +352,13 @@ static int mxcfb_set_par(struct fb_info *fbi) dev_dbg(fbi->device, "Reconfiguring framebuffer\n"); if (ovfbi_enable) { + ov_pos_ret = ipu_disp_get_window_pos( + mxc_fbi_fg->ipu, mxc_fbi_fg->ipu_ch, + &ov_pos_x, &ov_pos_y); + if (ov_pos_ret < 0) + dev_err(fbi->device, "Get overlay pos failed, dispdrv:%s.\n", + mxc_fbi->dispdrv->drv->name); + ipu_clear_irq(mxc_fbi_fg->ipu, mxc_fbi_fg->ipu_ch_irq); ipu_disable_irq(mxc_fbi_fg->ipu, mxc_fbi_fg->ipu_ch_irq); ipu_clear_irq(mxc_fbi_fg->ipu, mxc_fbi_fg->ipu_ch_nf_irq); @@ -494,6 +503,10 @@ static int mxcfb_set_par(struct fb_info *fbi) } if (ovfbi_enable) { + if (ov_pos_ret >= 0) + ipu_disp_set_window_pos( + mxc_fbi_fg->ipu, mxc_fbi_fg->ipu_ch, + ov_pos_x, ov_pos_y); retval = _setup_disp_channel2(mxc_fbi->ovfbi); if (retval) { ipu_uninit_channel(mxc_fbi_fg->ipu, mxc_fbi_fg->ipu_ch); -- 2.39.5