Commit 4e5280660dd0e1df3aa14ca80dd8615455febae7

Authored by ShankarMurthy, Akshay
Committed by Satyanarayana Sandhya
1 parent b53d2b8923

video: da8xx-fb: Check for context loss during resume

Context restore is not required when there is no loss of context which is
the case with standby.

This patch adds support for lcd to check for loss of context and
context restore is done if there has been a loss of context.

This reduces the overall resume latency of Standby approximately by
15ms.

Signed-off-by: ShankarMurthy, Akshay <akshay.s@ti.com>

Showing 2 changed files with 25 additions and 0 deletions Side-by-side Diff

drivers/video/da8xx-fb.c
... ... @@ -184,6 +184,7 @@
184 184 wait_queue_head_t vsync_wait;
185 185 int vsync_flag;
186 186 int vsync_timeout;
  187 + int context_loss_cnt;
187 188 spinlock_t lock_for_chan_update;
188 189  
189 190 /*
... ... @@ -1655,6 +1656,8 @@
1655 1656 {
1656 1657 struct fb_info *info = platform_get_drvdata(dev);
1657 1658 struct da8xx_fb_par *par = info->par;
  1659 + struct da8xx_lcdc_platform_data *fb_pdata =
  1660 + dev->dev.platform_data;
1658 1661  
1659 1662 console_lock();
1660 1663 if (par->panel_power_ctrl)
... ... @@ -1662,6 +1665,10 @@
1662 1665  
1663 1666 fb_set_suspend(info, 1);
1664 1667 lcd_disable_raster(WAIT_FOR_FRAME_DONE);
  1668 +
  1669 + if (fb_pdata->get_context_loss_count)
  1670 + par->context_loss_cnt =
  1671 + fb_pdata->get_context_loss_count(&dev->dev);
1665 1672 lcd_context_save();
1666 1673  
1667 1674 pm_runtime_put(&dev->dev);
1668 1675  
1669 1676  
... ... @@ -1673,13 +1680,30 @@
1673 1680 {
1674 1681 struct fb_info *info = platform_get_drvdata(dev);
1675 1682 struct da8xx_fb_par *par = info->par;
  1683 + struct da8xx_lcdc_platform_data *fb_pdata = dev->dev.platform_data;
  1684 + int loss_cnt;
1676 1685  
1677 1686 console_lock();
1678 1687  
1679 1688 pm_runtime_get_sync(&dev->dev);
1680 1689  
  1690 + if (fb_pdata->get_context_loss_count) {
  1691 + loss_cnt =
  1692 + fb_pdata->get_context_loss_count(&dev->dev);
  1693 + if (loss_cnt < 0) {
  1694 + dev_err(&dev->dev,
  1695 + "%s failed, context loss count = %d\n",
  1696 + __func__, loss_cnt);
  1697 + } else if (par->context_loss_cnt == loss_cnt) {
  1698 + goto skip_context_restore;
  1699 + }
  1700 + }
  1701 +
  1702 + /* Sleep is required inorder to avoid underflow error */
1681 1703 msleep(1);
1682 1704 lcd_context_restore();
  1705 +
  1706 +skip_context_restore:
1683 1707 lcd_enable_raster();
1684 1708  
1685 1709 if (par->panel_power_ctrl)
include/video/da8xx-fb.h
... ... @@ -40,6 +40,7 @@
40 40 void *controller_data;
41 41 const char type[25];
42 42 void (*panel_power_ctrl)(int);
  43 + int (*get_context_loss_count)(struct device *);
43 44 };
44 45  
45 46 struct lcd_ctrl_config {