diff options
Diffstat (limited to 'drivers/video/fbdev/mxc/mxc_ipuv3_fb.c')
-rw-r--r-- | drivers/video/fbdev/mxc/mxc_ipuv3_fb.c | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/drivers/video/fbdev/mxc/mxc_ipuv3_fb.c b/drivers/video/fbdev/mxc/mxc_ipuv3_fb.c index c6001b6a73d2..50b4f31bc536 100644 --- a/drivers/video/fbdev/mxc/mxc_ipuv3_fb.c +++ b/drivers/video/fbdev/mxc/mxc_ipuv3_fb.c @@ -1120,6 +1120,7 @@ static int mxcfb_set_par(struct fb_info *fbi) int ov_pos_ret = 0; struct mxcfb_info *mxc_fbi_fg = NULL; bool ovfbi_enable = false, on_the_fly; + int prev_line_length; if (ipu_ch_param_bad_alpha_pos(fbi_to_pixfmt(fbi, true)) && mxc_fbi->alpha_chan_en) { @@ -1143,6 +1144,7 @@ static int mxcfb_set_par(struct fb_info *fbi) if (fbi->var.xres == 0 || fbi->var.yres == 0) return 0; + prev_line_length = fbi->fix.line_length; mxcfb_set_fix(fbi); mxcfb_check_resolve(fbi); @@ -1214,6 +1216,11 @@ static int mxcfb_set_par(struct fb_info *fbi) if (mxcfb_map_video_memory(fbi) < 0) return -ENOMEM; + } else { + if (prev_line_length && (prev_line_length != fbi->fix.line_length)) { + memset((char *)fbi->screen_base, 0, fbi->fix.smem_len); + mxc_fbi->first_set_par = false; + } } if (mxc_fbi->first_set_par) { @@ -1317,6 +1324,15 @@ static int mxcfb_set_par(struct fb_info *fbi) dev_dbg(fbi->device, "pixclock = %ul Hz\n", (u32) (PICOS2KHZ(fbi->var.pixclock) * 1000UL)); + dev_info(fbi->device,"%dx%d h_sync,r,l: %d,%d,%d v_sync,l,u: %d,%d,%d pixclock=%u Hz\n", + fbi->var.xres, fbi->var.yres, + fbi->var.hsync_len, + fbi->var.right_margin, + fbi->var.left_margin, + fbi->var.vsync_len, + fbi->var.lower_margin, + fbi->var.upper_margin, + (u32)(PICOS2KHZ(fbi->var.pixclock) * 1000UL)); if (ipu_init_sync_panel(mxc_fbi->ipu, mxc_fbi->ipu_di, (PICOS2KHZ(fbi->var.pixclock)) * 1000UL, @@ -3050,6 +3066,10 @@ static int mxcfb_option_setup(struct platform_device *pdev, struct fb_info *fbi) name[5] += pdev->id; if (fb_get_options(name, &options)) { + if (options && !strncmp(options, "off", 3)) { + dev_info(&pdev->dev, "%s is turned off!\n", name); + return -ENODEV; + } dev_err(&pdev->dev, "Can't get fb option for %s!\n", name); return -ENODEV; } @@ -3128,8 +3148,7 @@ static int mxcfb_option_setup(struct platform_device *pdev, struct fb_info *fbi) fb_mode_str = opt; } - if (fb_mode_str) - pdata->mode_str = fb_mode_str; + pdata->mode_str = fb_mode_str; return 0; } @@ -3343,8 +3362,10 @@ static void mxcfb_unsetup_overlay(struct fb_info *fbi_bg) } static bool ipu_usage[2][2]; -static int ipu_test_set_usage(int ipu, int di) +static int ipu_test_set_usage(unsigned ipu, unsigned di) { + if ((ipu >= 2) || (di >= 2)) + return -EINVAL; if (ipu_usage[ipu][di]) return -EBUSY; else @@ -3354,6 +3375,8 @@ static int ipu_test_set_usage(int ipu, int di) static void ipu_clear_usage(int ipu, int di) { + if ((ipu >= 2) || (di >= 2)) + return; ipu_usage[ipu][di] = false; } @@ -3525,7 +3548,7 @@ static int mxcfb_probe(struct platform_device *pdev) mxcfbi->ipu_alp_ch_irq = IPU_IRQ_BG_ALPHA_SYNC_EOF; mxcfbi->ipu_ch = MEM_BG_SYNC; /* Unblank the primary fb only by default */ - if (pdev->id == 0) + if (1) //(pdev->id == 0) mxcfbi->cur_blank = mxcfbi->next_blank = FB_BLANK_UNBLANK; else mxcfbi->cur_blank = mxcfbi->next_blank = FB_BLANK_POWERDOWN; @@ -3566,7 +3589,7 @@ static int mxcfb_probe(struct platform_device *pdev) mxcfbi->ipu_ch_nf_irq = IPU_IRQ_DC_SYNC_NFACK; mxcfbi->ipu_alp_ch_irq = -1; mxcfbi->ipu_ch = MEM_DC_SYNC; - mxcfbi->cur_blank = mxcfbi->next_blank = FB_BLANK_POWERDOWN; + mxcfbi->cur_blank = mxcfbi->next_blank = FB_BLANK_UNBLANK; ret = mxcfb_register(fbi); if (ret < 0) |