dri-devel Archive on 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 2/2] drm/vkms: skip planes that have no framebuffer
Date: Wed, 02 Dec 2026 10:41:31 +0000	[thread overview]
Message-ID: <sashiko-outbox-245491@kernel.org> (raw)
In-Reply-To: <20261202-vkms-cursor-ci-v1-2-ff0140820268@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 2e72d6803c42a45dea03a11c7071f0b5d99277d5
Author: Oarora Etimis <oaroraetimis@gmail.com>

drm/vkms: skip planes that have no framebuffer

This commit adds a !plane_state->fb check to the loops in
vkms_crtc_atomic_check() to exclude planes without a framebuffer from
vkms_state->active_planes.

> 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 true 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 is set, and
drm_atomic_plane_check() (called by drm_atomic_check_only() before
vkms_crtc_atomic_check()) rejects any plane state with crtc && !fb with
-EINVAL.  Every plane visited by drm_for_each_plane_mask() here therefore
already has a non-NULL plane_state->fb, making the !plane_state->fb check
unreachable while vkms_plane_atomic_check() still returns early on
!new_plane_state->fb before drm_atomic_helper_check_plane_state() can
clear new_plane_state->visible.

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

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

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02 10:11 [PATCH 0/2] drm/vkms: guard the empty-plane path, re-enable the cursor CRC tests Oarora Etimis
2026-12-02 10:11 ` [PATCH 1/2] drm/ci: re-enable the vkms " Oarora Etimis
2026-12-02 10:22   ` sashiko-bot
2026-12-02 10:11 ` [PATCH 2/2] drm/vkms: skip planes that have no framebuffer Oarora Etimis
2026-12-02 10:41   ` 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-245491@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox