Skip to contentSkip to conversation

drm/ast: Don't check new mode if CRTC is being disabled

PATCH Superseded Thomas Zimmermann 1 participant 2 messages May 4, 2020

Subsystems (4)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Thomas Zimmermann

author maintainer
#0 lore raw

PATCH v2 1/1 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.

v2:
* add Tested-by/Reviewed-by tags
* add Fixes tags and CC (Sam)
* improved comment

Fixes b48e1b6ffd28 ("drm/ast: Add CRTC helpers for atomic modesetting")
Cc Thomas Zimmermann <[email protected]>
Cc Gerd Hoffmann <[email protected]>
Cc Dave Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc <[email protected]> # v5.6+
---
 drivers/gpu/drm/ast/ast_mode.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/ast/ast_mode.c +3 -0
index 7a9f20a2fd303..0cbbb21edb4e1 100644
@@ -801,6 +801,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;
Signature · 1 line
2.26.0
author maintainer
#1 lore raw

Am 04.05.20 um 14:12 schrieb Thomas Zimmermann:

Quoted 5 lines

Suspending failed because there's no mode if the CRTC is being disabled. Early-out in this case. This fixes runtime PM for ast.

v2:
* add Tested-by/Reviewed-by tags

s/Reviewed-by/Reported-by

Will be fixed in v3.

Quoted 32 lines

* add Fixes tags and CC (Sam)
* improved comment

Fixes b48e1b6ffd28 ("drm/ast: Add CRTC helpers for atomic modesetting")
Cc Thomas Zimmermann <[email protected]>
Cc Gerd Hoffmann <[email protected]>
Cc Dave Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc <[email protected]> # v5.6+
---
 drivers/gpu/drm/ast/ast_mode.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/ast/ast_mode.c +3 -0
index 7a9f20a2fd303..0cbbb21edb4e1 100644
@@ -801,6 +801,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;
Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer