From 22ebae80fae76c71ea1894680c2c75e2372a7973 Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Thu, 7 May 2020 11:06:40 +0200 Subject: [PATCH] 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 --- drivers/gpu/drm/ast/ast_mode.c | 3 +++ 1 file changed, 3 insertions(+) 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; -- 2.39.5