drm/vc4: plane_state->fb iff plane_state->crtc
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 13 Dec 2019 17:26:09 +0000 (18:26 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 28 Jan 2020 14:42:43 +0000 (15:42 +0100)
Checking both is one too much, so wrap a WARN_ON around it to stope
the copypasta.

Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191213172612.1514842-7-daniel.vetter@ffwll.ch
drivers/gpu/drm/vc4/vc4_plane.c

index 4934127f0d7646c674f30b5d04ab46b01d85684a..91e408f7a56eb5ef8dfed67bdc337036d5e58be2 100644 (file)
@@ -139,7 +139,7 @@ static enum vc4_scaling_mode vc4_get_scaling_mode(u32 src, u32 dst)
 
 static bool plane_enabled(struct drm_plane_state *state)
 {
-       return state->fb && state->crtc;
+       return state->fb && !WARN_ON(!state->crtc);
 }
 
 static struct drm_plane_state *vc4_plane_duplicate_state(struct drm_plane *plane)