]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm: verisilicon: call atomic helper's plane state check even if no CRTC
authorIcenowy Zheng <zhengxingda@iscas.ac.cn>
Tue, 31 Mar 2026 06:01:25 +0000 (14:01 +0800)
committerThomas Zimmermann <tzimmermann@suse.de>
Mon, 4 May 2026 11:30:59 +0000 (13:30 +0200)
The `drm_atomic_helper_check_plane_state()` helper function needs to be
called even if the plane is bound to no CRTCs.

Remove the early return in the primary plane's atomic_check, and use
NULL for crtc_state in this situation.

Fixes: dbf21777caa8 ("drm: verisilicon: add a driver for Verisilicon display controllers")
Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patch.msgid.link/20260331060126.1291966-4-zhengxingda@iscas.ac.cn
drivers/gpu/drm/verisilicon/vs_primary_plane.c

index bad0bc5e3242d19fe7282ea417371b0e67c94396..421d6f9dc547b2e58b6178c063c7f91a96e3ea20 100644 (file)
@@ -26,14 +26,10 @@ static int vs_primary_plane_atomic_check(struct drm_plane *plane,
        struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state,
                                                                                 plane);
        struct drm_crtc *crtc = new_plane_state->crtc;
-       struct drm_crtc_state *crtc_state;
+       struct drm_crtc_state *crtc_state = NULL;
 
-       if (!crtc)
-               return 0;
-
-       crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
-       if (WARN_ON(!crtc_state))
-               return -EINVAL;
+       if (crtc)
+               crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
 
        return drm_atomic_helper_check_plane_state(new_plane_state,
                                                   crtc_state,