summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Riesch <michael.riesch@wolfvision.net>2023-01-24 08:47:01 +0300
committerHeiko Stuebner <heiko@sntech.de>2023-02-05 17:21:34 +0300
commit368419a2d429e2438bef333959732c640310bdc7 (patch)
treef8b4955bde01966fc3e45405e3e3b970a644a71c
parent9bb35d4c3230803345d5218676a7325b26823209 (diff)
downloadlinux-368419a2d429e2438bef333959732c640310bdc7.tar.xz
drm/rockchip: vop2: initialize possible_crtcs properly
The variable possible_crtcs is only initialized for primary and overlay planes. Since the VOP2 driver only supports these plane types at the moment, the current code is safe. However, in order to provide a future-proof solution, fix the initialization of the variable. Reported-by: kernel test robot <lkp@intel.com> Reported-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net> Reviewed-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patchwork.freedesktop.org/patch/msgid/20230124054706.3921383-2-michael.riesch@wolfvision.net
-rw-r--r--drivers/gpu/drm/rockchip/rockchip_drm_vop2.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
index ba3b81789509..c59d3835971b 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
@@ -2321,10 +2321,11 @@ static int vop2_create_crtc(struct vop2 *vop2)
/* change the unused primary window to overlay window */
win->type = DRM_PLANE_TYPE_OVERLAY;
}
- }
-
- if (win->type == DRM_PLANE_TYPE_OVERLAY)
+ } else if (win->type == DRM_PLANE_TYPE_OVERLAY) {
possible_crtcs = (1 << nvps) - 1;
+ } else {
+ possible_crtcs = 0;
+ }
ret = vop2_plane_init(vop2, win, possible_crtcs);
if (ret) {