[bug report] drm/rockchip: Add VOP2 driver

Dan Carpenter dan.carpenter at oracle.com
Mon May 9 01:03:11 PDT 2022


Hello Andy Yan,

The patch 604be85547ce: "drm/rockchip: Add VOP2 driver" from Apr 22,
2022, leads to the following Smatch static checker warning:

	drivers/gpu/drm/rockchip/rockchip_drm_vop2.c:2317 vop2_create_crtc()
	error: uninitialized symbol 'possible_crtcs'.

drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
    2283         nvp = 0;
    2284         for (i = 0; i < vop2->registered_num_wins; i++) {
    2285                 struct vop2_win *win = &vop2->win[i];
    2286                 u32 possible_crtcs;
    2287 
    2288                 if (vop2->data->soc_id == 3566) {
    2289                         /*
    2290                          * On RK3566 these windows don't have an independent
    2291                          * framebuffer. They share the framebuffer with smart0,
    2292                          * esmart0 and cluster0 respectively.
    2293                          */
    2294                         switch (win->data->phys_id) {
    2295                         case ROCKCHIP_VOP2_SMART1:
    2296                         case ROCKCHIP_VOP2_ESMART1:
    2297                         case ROCKCHIP_VOP2_CLUSTER1:
    2298                                 continue;
    2299                         }
    2300                 }
    2301 
    2302                 if (win->type == DRM_PLANE_TYPE_PRIMARY) {
    2303                         vp = find_vp_without_primary(vop2);
    2304                         if (vp) {
    2305                                 possible_crtcs = BIT(nvp);
    2306                                 vp->primary_plane = win;
    2307                                 nvp++;
    2308                         } else {
    2309                                 /* change the unused primary window to overlay window */
    2310                                 win->type = DRM_PLANE_TYPE_OVERLAY;
    2311                         }
    2312                 }
    2313 
    2314                 if (win->type == DRM_PLANE_TYPE_OVERLAY)
    2315                         possible_crtcs = (1 << nvps) - 1;

What about DRM_PLANE_TYPE_CURSOR?

    2316 
--> 2317                 ret = vop2_plane_init(vop2, win, possible_crtcs);
                                                          ^^^^^^^^^^^^^^
Warning

    2318                 if (ret) {
    2319                         drm_err(vop2->drm, "failed to init plane %s: %d\n",
    2320                                 win->data->name, ret);
    2321                         return ret;
    2322                 }
    2323         }
    2324 
    2325         for (i = 0; i < vop2_data->nr_vps; i++) {
    2326                 vp = &vop2->vps[i];
    2327 
    2328                 if (!vp->crtc.port)
    2329                         continue;
    2330 
    2331                 plane = &vp->primary_plane->base;
    2332 

regards,
dan carpenter



More information about the Linux-rockchip mailing list