1
0
Fork 0

video: mxsfb: Don't set blank state if enable failed

Check if lcd interface enable was a success before
setting current blank state. This fixes a bug where
the pan function failes when waiting for an interrupt,
when the driver believes the display is unblanked when
in fact it is not.

Also user space applications that call ioctl to do
blanking will be notified when the blanking failed.
pull/10/head
Lars Ivar Miljeteig 2020-05-06 19:59:16 +02:00 committed by Steinar Bakkemo
parent fb1f2acfc7
commit b27c46d143
1 changed files with 13 additions and 7 deletions

View File

@ -672,7 +672,7 @@ static int mxsfb_check_var(struct fb_var_screeninfo *var,
return 0;
}
static void mxsfb_enable_controller(struct fb_info *fb_info)
static int mxsfb_enable_controller(struct fb_info *fb_info)
{
struct mxsfb_info *host = fb_info->par;
u32 reg;
@ -688,7 +688,7 @@ static void mxsfb_enable_controller(struct fb_info *fb_info)
if (ret < 0) {
dev_err(&host->pdev->dev, "failed to setup"
"dispdrv:%s\n", host->dispdrv->drv->name);
return;
return ret;
}
host->sync = fb_info->var.sync;
}
@ -698,7 +698,7 @@ static void mxsfb_enable_controller(struct fb_info *fb_info)
if (ret) {
dev_err(&host->pdev->dev,
"lcd regulator enable failed: %d\n", ret);
return;
return ret;
}
}
@ -707,7 +707,7 @@ static void mxsfb_enable_controller(struct fb_info *fb_info)
if (ret) {
dev_err(&host->pdev->dev,
"lcd2 regulator enable failed: %d\n", ret);
return;
return ret;
}
}
@ -746,7 +746,7 @@ static void mxsfb_enable_controller(struct fb_info *fb_info)
"lcd2 regulator disable failed: %d\n",
ret);
}
return;
return ret;
}
clk_enable_pix(host);
#ifdef CONFIG_FB_IMX64_DEBUG
@ -773,6 +773,7 @@ static void mxsfb_enable_controller(struct fb_info *fb_info)
host->enabled = 1;
return 0;
}
static void mxsfb_disable_controller(struct fb_info *fb_info)
@ -1095,11 +1096,14 @@ static int mxsfb_ioctl(struct fb_info *fb_info, unsigned int cmd,
static int mxsfb_blank(int blank, struct fb_info *fb_info)
{
struct mxsfb_info *host = fb_info->par;
int ret = 0;
int prev_blank;
#ifdef CONFIG_FB_IMX64_DEBUG
return 0;
#endif
prev_blank = host->cur_blank;
host->cur_blank = blank;
switch (blank) {
@ -1130,11 +1134,13 @@ static int mxsfb_blank(int blank, struct fb_info *fb_info)
writel(0, host->base + LCDC_CTRL);
mxsfb_set_par(host->fb_info);
mxsfb_enable_controller(fb_info);
ret = mxsfb_enable_controller(fb_info);
if (ret)
host->cur_blank = prev_blank;
}
break;
}
return 0;
return ret;
}
static int mxsfb_pan_display(struct fb_var_screeninfo *var,