All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Oarora Etimis" <oaroraetimis@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2 2/2] drm/vkms: skip planes that have no framebuffer
Date: Wed, 02 Dec 2026 13:09:57 +0000	[thread overview]
Message-ID: <sashiko-outbox-245845@kernel.org> (raw)
In-Reply-To: <20261202-vkms-cursor-ci-v2-2-210aae7dd3d7@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] drm/vkms: dead !plane_state->fb check in
  vkms_crtc_atomic_check()
--

commit ff2475266a72766f837c669474a13dc8e53ca901
Author: Oarora Etimis <oaroraetimis@gmail.com>

drm/vkms: skip planes that have no framebuffer

This commit adds a !plane_state->fb check alongside !plane_state->visible
when populating vkms_state->active_planes in vkms_crtc_atomic_check().

> diff --git a/drivers/gpu/drm/vkms/vkms_crtc.c b/drivers/gpu/drm/vkms/vkms_crtc.c
> index 019d7bc90cdcb..3f98fac7ce92b 100644
> --- a/drivers/gpu/drm/vkms/vkms_crtc.c
> +++ b/drivers/gpu/drm/vkms/vkms_crtc.c
> @@ -133,7 +133,7 @@ static int vkms_crtc_atomic_check(struct drm_crtc *crtc,
>  		plane_state = drm_atomic_get_new_plane_state(crtc_state->state, plane);
>  		WARN_ON(!plane_state);
>  
> -		if (!plane_state->visible)
> +		if (!plane_state->visible || !plane_state->fb)
>  			continue;
>  
>  		i++;
> @@ -148,7 +148,7 @@ static int vkms_crtc_atomic_check(struct drm_crtc *crtc,
>  	drm_for_each_plane_mask(plane, crtc->dev, crtc_state->plane_mask) {
>  		plane_state = drm_atomic_get_new_plane_state(crtc_state->state, plane);
>  
> -		if (!plane_state->visible)
> +		if (!plane_state->visible || !plane_state->fb)
>  			continue;
>  
>  		vkms_state->active_planes[i++] =

[Severity: Medium]
Can plane_state->fb ever be NULL for a plane in crtc_state->plane_mask?

drm_atomic_set_crtc_for_plane() only keeps a plane in crtc_state->plane_mask
while plane_state->crtc == crtc, and drm_atomic_check_only() runs
drm_atomic_plane_check() before vkms_crtc_atomic_check(), rejecting any plane
state with crtc && !fb with -EINVAL.  Every plane visited by
drm_for_each_plane_mask(..., crtc_state->plane_mask) therefore already has a
non-NULL plane_state->fb, making !plane_state->fb dead code here.

If a disabled plane retains a stale plane_state->visible == true, that happens
because vkms_plane_atomic_check() returns early when !new_plane_state->fb
before calling drm_atomic_helper_check_plane_state(), without clearing
new_plane_state->visible:

drivers/gpu/drm/vkms/vkms_plane.c:vkms_plane_atomic_check() {
	...
	if (!new_plane_state->fb || WARN_ON(!new_plane_state->crtc))
		return 0;

	ret = drm_atomic_helper_check_plane_state(new_plane_state, crtc_state,
						  DRM_PLANE_NO_SCALING,
						  DRM_PLANE_NO_SCALING,
						  can_position, true);
	...
}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261202-vkms-cursor-ci-v2-0-210aae7dd3d7@gmail.com?part=2

      reply	other threads:[~2026-12-02 13:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02 12:49 [PATCH v2 0/2] drm/vkms: guard the empty-plane path, re-enable the cursor CRC tests Oarora Etimis
2026-12-02 12:49 ` [PATCH v2 1/2] drm/ci: re-enable the vkms " Oarora Etimis
2026-12-02 12:49 ` [PATCH v2 2/2] drm/vkms: skip planes that have no framebuffer Oarora Etimis
2026-12-02 13:09   ` sashiko-bot [this message]

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=sashiko-outbox-245845@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=oaroraetimis@gmail.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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.