display: JDI: fix resume messy screen

1. remove the workaround for resume messy screen
2. add the fix patch for resume messy screen

Set the backlight after resume only after the first display
commit is done. This will avoid panel specific transients to
show up on the panel during its initialization. Also, avoid
backlight scaling during resume until backlight is set.

case 01124703
Change-Id: Iba158db803a7ea06d564b23d5477d916e8635695
Signed-off-by: yetta_wu <yetta_wu@asus.com>
Signed-off-by: Iliyan Malchev <malchev@google.com>
This commit is contained in:
Padmanabhan Komanduru 2013-04-08 19:48:15 +08:00 committed by Iliyan Malchev
parent 732a969a26
commit aac070cc81
3 changed files with 47 additions and 33 deletions

View file

@ -107,8 +107,10 @@ static int mipi_JDI_lcd_on(struct platform_device *pdev)
if (mfd->key != MFD_KEY)
return -EINVAL;
if (first) /* change first in setbacklight */
if (first) {/* change first in setbacklight */
pr_info("%s-, booting\n", __func__);
return 0;
}
msleep(20);
@ -220,6 +222,14 @@ static void mipi_JDI_set_recovery_backlight(struct msm_fb_data_type *mfd)
pr_info("%s: backlight level %d\n", __func__, recovery_backlight);
if (first) {
ret = pm8xxx_gpio_config(gpio, &config);
if (ret)
pr_err("%s: pm8xxx_gpio_config failed: ret=%d\n",
__func__, ret);
first = false;
}
if (bl_lpm) {
ret = pwm_config(bl_lpm, PWM_DUTY_LEVEL *
recovery_backlight, PWM_PERIOD_USEC);

View file

@ -61,7 +61,11 @@ static unsigned char *fbram;
static unsigned char *fbram_phys;
static int fbram_size;
static boolean bf_supported;
/* Set backlight on resume after 20 ms after first
* pan display on the panel. This is to avoid panel specific
* transients during resume.
*/
unsigned long backlight_duration = (HZ/50);
static struct platform_device *pdev_list[MSM_FB_MAX_DEV_LIST];
static int pdev_list_cnt;
@ -372,6 +376,8 @@ static void msm_fb_remove_sysfs(struct platform_device *pdev)
sysfs_remove_group(&mfd->fbi->dev->kobj, &msm_fb_attr_group);
}
static void bl_workqueue_handler(struct work_struct *work);
static int msm_fb_probe(struct platform_device *pdev)
{
struct msm_fb_data_type *mfd;
@ -410,6 +416,8 @@ static int msm_fb_probe(struct platform_device *pdev)
mfd = (struct msm_fb_data_type *)platform_get_drvdata(pdev);
INIT_DELAYED_WORK(&mfd->backlight_worker, bl_workqueue_handler);
if (!mfd)
return -ENODEV;
@ -892,7 +900,8 @@ static int mdp_bl_scale_config(struct msm_fb_data_type *mfd,
bl_min_lvl);
/* update current backlight to use new scaling*/
msm_fb_set_backlight(mfd, curr_bl);
if (mfd->panel_power_on && bl_updated)
msm_fb_set_backlight(mfd, curr_bl);
up(&mfd->sem);
return ret;
@ -980,13 +989,13 @@ static int msm_fb_blank_sub(int blank_mode, struct fb_info *info,
mfd->op_enable = FALSE;
curr_pwr_state = mfd->panel_power_on;
mfd->panel_power_on = FALSE;
cancel_delayed_work_sync(&mfd->backlight_worker);
bl_updated = 0;
if (mfd->msmfb_no_update_notify_timer.function)
del_timer(&mfd->msmfb_no_update_notify_timer);
complete(&mfd->msmfb_no_update_notify);
bl_updated = 0;
/* clean fb to prevent displaying old fb */
memset((void *)info->screen_base, 0,
info->fix.smem_len);
@ -1936,6 +1945,22 @@ static int msm_fb_pan_display_ex(struct fb_info *info,
return ret;
}
static void bl_workqueue_handler(struct work_struct *work)
{
struct msm_fb_data_type *mfd = container_of(to_delayed_work(work),
struct msm_fb_data_type, backlight_worker);
struct msm_fb_panel_data *pdata = mfd->pdev->dev.platform_data;
if ((pdata) && (pdata->set_backlight) && (!bl_updated)) {
down(&mfd->sem);
mfd->bl_level = unset_bl_level;
pdata->set_backlight(mfd);
bl_level_old = unset_bl_level;
bl_updated = 1;
up(&mfd->sem);
}
}
static int msm_fb_pan_display(struct fb_var_screeninfo *var,
struct fb_info *info)
{
@ -2046,18 +2071,9 @@ static int msm_fb_pan_display_sub(struct fb_var_screeninfo *var,
up(&msm_fb_pan_sem);
if (unset_bl_level && !bl_updated) {
pdata = (struct msm_fb_panel_data *)mfd->pdev->
dev.platform_data;
if ((pdata) && (pdata->set_backlight)) {
down(&mfd->sem);
mfd->bl_level = unset_bl_level;
pdata->set_backlight(mfd);
bl_level_old = unset_bl_level;
up(&mfd->sem);
bl_updated = 1;
}
}
if (unset_bl_level && !bl_updated)
schedule_delayed_work(&mfd->backlight_worker,
backlight_duration);
/* set backlight in recovery mode */
pdata = (struct msm_fb_panel_data *)mfd->pdev->
@ -2078,7 +2094,6 @@ static void msm_fb_commit_wq_handler(struct work_struct *work)
struct fb_var_screeninfo *var;
struct fb_info *info;
struct msm_fb_backup_type *fb_backup;
struct msm_fb_panel_data *pdata;
mfd = container_of(work, struct msm_fb_data_type, commit_work);
fb_backup = (struct msm_fb_backup_type *)mfd->msm_fb_backup;
@ -2095,21 +2110,9 @@ static void msm_fb_commit_wq_handler(struct work_struct *work)
complete_all(&mfd->commit_comp);
mutex_unlock(&mfd->sync_mutex);
if (unset_bl_level && !bl_updated) {
pdata = (struct msm_fb_panel_data *)mfd->pdev->
dev.platform_data;
if ((pdata) && (pdata->set_backlight)) {
/* add delay to make sure the fb sending completed */
msleep(20);
down(&mfd->sem);
mfd->bl_level = unset_bl_level;
pdata->set_backlight(mfd);
bl_level_old = unset_bl_level;
up(&mfd->sem);
bl_updated = 1;
}
}
if (unset_bl_level && !bl_updated)
schedule_delayed_work(&mfd->backlight_worker,
backlight_duration);
}
static int msm_fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)

View file

@ -84,6 +84,7 @@ struct msm_fb_data_type {
struct device *dev;
boolean op_enable;
struct delayed_work backlight_worker;
uint32 fb_imgType;
boolean sw_currently_refreshing;
boolean sw_refreshing_enable;