]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00212838 FB display lose xoffset/yoffset after HDMI plugout/in
authorSandor Yu <R01008@freescale.com>
Wed, 13 Jun 2012 02:39:55 +0000 (10:39 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:34:48 +0000 (08:34 +0200)
Save overlay offset before DP disable and restore it after DP enable.

Signed-off-by: Sandor Yu <R01008@freescale.com>
drivers/video/mxc/mxc_ipuv3_fb.c

index f3f5bac837832a382550324eb79511bafbd8764c..f14e8daf70ad6932f1b21a7f6eb6b89433cf04bc 100644 (file)
@@ -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);