From: Sean Paul Date: Tue, 6 Sep 2016 18:11:53 +0000 (-0400) Subject: drm/rockchip: Fix up bug in psr state machine X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=be91a983eaf272ed0a982e7c92b47e78d7ccc51a;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git drm/rockchip: Fix up bug in psr state machine The ->set() callback would always be called when transitioning from FLUSH->DISABLE since we assign state to psr->state right above the skip condition. Reported-by: Daniel Kurtz Reviewed-by: Daniel Kurtz Signed-off-by: Sean Paul --- diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_psr.c b/drivers/gpu/drm/rockchip/rockchip_drm_psr.c index 2cdd6eb359f2..a553e182ff53 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_psr.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_psr.c @@ -71,11 +71,13 @@ static void psr_set_state_locked(struct psr_drv *psr, enum psr_state state) if (state == psr->state || !psr->active) return; - psr->state = state; - /* Already disabled in flush, change the state, but not the hardware */ - if (state == PSR_DISABLE && psr->state == PSR_FLUSH) + if (state == PSR_DISABLE && psr->state == PSR_FLUSH) { + psr->state = state; return; + } + + psr->state = state; /* Actually commit the state change to hardware */ switch (psr->state) {