drm/panel-simple: Retry if we timeout waiting for HPD
authorDouglas Anderson <dianders@chromium.org>
Fri, 15 Jan 2021 22:44:18 +0000 (14:44 -0800)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 11 Mar 2021 16:14:41 +0000 (17:14 +0100)
commit87b497179f5c7c524dd00a6c0d464a390cc74db0
tree601bccb0b159aa91b4b34f4fa5b95245705c3d97
parent6ec52621e77c81079e7d3858cca00344d4266a89
drm/panel-simple: Retry if we timeout waiting for HPD

On an Innolux N116BCA panel that I have in front of me, sometimes HPD
simply doesn't assert no matter how long you wait for it. As per the
very wise advice of The IT Crowd ("Have you tried turning it off and
on again?") it appears that power cycling is enough to kick this panel
back into a sane state.

>From tests on this panel, it appears that leaving it powered off for a
while stimulates the problem. Adding a 6 second sleep at the start of
panel_simple_prepare_once() makes it happen fairly reliably and, with
this delay, I saw up to 3 retries needed sometimes. Without the 6
second sleep, however, the panel came up much more reliably the first
time or after only 1 retry.

While it's unknown what the problems are with this panel (and probably
the hardware should be debugged), adding a few retries to the power on
routine doesn't seem insane. Even if this panel's problems are
attributed to the fact that it's pre-production and/or can be fixed,
retries clearly can help in some cases and really don't hurt.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20210115144345.v2.3.I6916959daa7c5c915e889442268d23338de17923@changeid
drivers/gpu/drm/panel/panel-simple.c