Skip to content

Commit

Permalink
drm/panel: sharp: lq101r1sx01: Add delay after display on
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
thierryreding committed Jan 28, 2015
1 parent d435a2a commit 4569619
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 4569619

Please sign in to comment.