All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: andy.yan@rock-chips.com
Cc: linux-rockchip@lists.infradead.org
Subject: [bug report] drm/rockchip: Add VOP2 driver
Date: Mon, 9 May 2022 11:03:11 +0300	[thread overview]
Message-ID: <YnjKvyIFDdIY6Cuw@kili> (raw)

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

                 reply	other threads:[~2022-05-09  8:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YnjKvyIFDdIY6Cuw@kili \
    --to=dan.carpenter@oracle.com \
    --cc=andy.yan@rock-chips.com \
    --cc=linux-rockchip@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.