drm/rockchip: psr: Avoid redundant calls to .set() callback
authorTomasz Figa <tfiga@chromium.org>
Mon, 23 Apr 2018 10:50:00 +0000 (12:50 +0200)
committerAndrzej Hajda <a.hajda@samsung.com>
Tue, 24 Apr 2018 06:34:51 +0000 (08:34 +0200)
commit39b138ea861a3494d2962467d6e275ae9f80a364
treeed72f2ae8a7d2fea07f1e29350e85773923777eb
parenta4169609def769c66f88140678970b2be6f64ac7
drm/rockchip: psr: Avoid redundant calls to .set() callback

The first time after we call rockchip_drm_do_flush() after
rockchip_drm_psr_register(), we go from PSR_DISABLE to PSR_FLUSH. The
difference between PSR_DISABLE and PSR_FLUSH is whether or not we have a
delayed work pending - PSR is off in either state.  However
psr_set_state() only catches the transition from PSR_FLUSH to
PSR_DISABLE (which never happens), while going from PSR_DISABLE to
PSR_FLUSH triggers a call to psr->set() to disable PSR while it's
already disabled. This triggers the eDP PHY power-on sequence without
being shut down first and this seems to occasionally leave the encoder
unable to later enable PSR. Let's just simplify the state machine and
simply consider PSR_DISABLE and PSR_FLUSH the same state.

Signed-off-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Kristian H. Kristensen <hoegsberg@chromium.org>
Signed-off-by: Thierry Escande <thierry.escande@collabora.com>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180423105003.9004-25-enric.balletbo@collabora.com
drivers/gpu/drm/rockchip/rockchip_drm_psr.c