public inbox for linux-rockchip@lists.infradead.org
 help / color / mirror / Atom feed
* [bug report] drm/rockchip: Add VOP2 driver
@ 2022-05-09  8:03 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2022-05-09  8:03 UTC (permalink / raw)
  To: andy.yan; +Cc: linux-rockchip

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

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-05-09  8:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-09  8:03 [bug report] drm/rockchip: Add VOP2 driver Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox