From: Thomas Zimmermann Date: Thu, 7 May 2020 09:06:40 +0000 (+0200) Subject: drm/ast: Don't check new mode if CRTC is being disabled X-Git-Tag: baikal/mips/sdk5.9~13559^2~9^2~16 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=22ebae80fae76c71ea1894680c2c75e2372a7973;p=kernel.git drm/ast: Don't check new mode if CRTC is being disabled Suspending failed because there's no mode if the CRTC is being disabled. Early-out in this case. This fixes runtime PM for ast. v3: * fixed commit message v2: * added Tested-by/Reported-by tags * added Fixes tags and CC (Sam) * improved comment Signed-off-by: Thomas Zimmermann Reported-by: Cary Garrett Tested-by: Cary Garrett Reviewed-by: Daniel Vetter Fixes: 8a7e5eddfb5b ("drm/ast: Add CRTC helpers for atomic modesetting") Cc: Thomas Zimmermann Cc: Gerd Hoffmann Cc: Dave Airlie Cc: Daniel Vetter Cc: Sam Ravnborg Cc: # v5.6+ Link: https://patchwork.freedesktop.org/patch/msgid/20200507090640.21561-1-tzimmermann@suse.de --- diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c index 4ddf77045759e..7d39b858c9f1f 100644 --- a/drivers/gpu/drm/ast/ast_mode.c +++ b/drivers/gpu/drm/ast/ast_mode.c @@ -802,6 +802,9 @@ static int ast_crtc_helper_atomic_check(struct drm_crtc *crtc, return -EINVAL; } + if (!state->enable) + return 0; /* no mode checks if CRTC is being disabled */ + ast_state = to_ast_crtc_state(state); format = ast_state->format;