summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2022-06-17 12:32:26 +0200
committerThomas Zimmermann <tzimmermann@suse.de>2022-06-27 11:10:43 +0200
commit016a14beac6d407c9a51f0b92d1e586a00bfc345 (patch)
tree3ae092f743ffb2a4c14ba7bbafdc806cbcd0e669
parentdrm/simple-kms: Use drm_atomic_helper_check_crtc_state() (diff)
downloadlinux-016a14beac6d407c9a51f0b92d1e586a00bfc345.tar.xz
linux-016a14beac6d407c9a51f0b92d1e586a00bfc345.zip
drm/ast: Enable primary plane with CRTC
As the CRTC requires a primary plane for display, ensure that the primary plane is enabled with the CRTC. Use drm_atomic_helper_check_crtc_state(). Add all affected planes to the atomic state so that their state will be checked as well. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Acked-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20220617103226.25617-4-tzimmermann@suse.de
-rw-r--r--drivers/gpu/drm/ast/ast_mode.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
index 4a91605b4654..214b10178454 100644
--- a/drivers/gpu/drm/ast/ast_mode.c
+++ b/drivers/gpu/drm/ast/ast_mode.c
@@ -1108,15 +1108,19 @@ ast_crtc_helper_mode_valid(struct drm_crtc *crtc, const struct drm_display_mode
static int ast_crtc_helper_atomic_check(struct drm_crtc *crtc,
struct drm_atomic_state *state)
{
- struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state,
- crtc);
+ struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
struct drm_device *dev = crtc->dev;
struct ast_crtc_state *ast_state;
const struct drm_format_info *format;
bool succ;
+ int ret;
+
+ ret = drm_atomic_helper_check_crtc_state(crtc_state, false);
+ if (ret)
+ return ret;
if (!crtc_state->enable)
- return 0; /* no mode checks if CRTC is being disabled */
+ goto out;
ast_state = to_ast_crtc_state(crtc_state);
@@ -1130,7 +1134,8 @@ static int ast_crtc_helper_atomic_check(struct drm_crtc *crtc,
if (!succ)
return -EINVAL;
- return 0;
+out:
+ return drm_atomic_add_affected_planes(state, crtc);
}
static void ast_crtc_helper_atomic_begin(struct drm_crtc *crtc, struct drm_atomic_state *state)