diff options
author | Thierry Reding <treding@nvidia.com> | 2014-12-08 17:05:48 +0300 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2015-01-28 10:45:38 +0300 |
commit | 4569619d0f3a38c41a4556c79ef63cabd4282558 (patch) | |
tree | d2f4d84b9ef65276160223c8e3025c8e68a6c4f9 /drivers/gpu/drm/panel | |
parent | d435a2af12349e6285559196675ad45f1e4a041d (diff) | |
download | linux-4569619d0f3a38c41a4556c79ef63cabd4282558.tar.xz |
drm/panel: sharp: lq101r1sx01: Add delay after display on
After switching the display on (using the DCS display_on command), wait
for 6 frames (100ms at 60 Hz) to give the display more time to prepare.
Failing to do this results in the panel not initializing properly in a
large number of cases.
Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/gpu/drm/panel')
-rw-r--r-- | drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c b/drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c index 9d81759d82fc..8a11e83ab582 100644 --- a/drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c +++ b/drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c @@ -41,6 +41,16 @@ static inline struct sharp_panel *to_sharp_panel(struct drm_panel *panel) return container_of(panel, struct sharp_panel, base); } +static void sharp_wait_frames(struct sharp_panel *sharp, unsigned int frames) +{ + unsigned int refresh = drm_mode_vrefresh(sharp->mode); + + if (WARN_ON(frames > refresh)) + return; + + msleep(1000 / (refresh / frames)); +} + static int sharp_panel_write(struct sharp_panel *sharp, u16 offset, u8 value) { u8 payload[3] = { offset >> 8, offset & 0xff, value }; @@ -238,6 +248,9 @@ static int sharp_panel_prepare(struct drm_panel *panel) sharp->prepared = true; + /* wait for 6 frames before continuing */ + sharp_wait_frames(sharp, 6); + return 0; poweroff: |