All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roy <rongh7426@gmail.com>
To: Maxime Ripard <mripard@kernel.org>,
	Dave Stevenson <dave.stevenson@raspberrypi.com>
Cc: "Maíra Canal" <mcanal@igalia.com>,
	"Raspberry Pi Kernel Maintenance" <kernel-list@raspberrypi.com>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	Roy <rongh7426@gmail.com>
Subject: [PATCH] drm/vc4: plane: Don't log LBM and UPM allocation failures as errors
Date: Thu, 26 Nov 2026 18:37:09 +0800	[thread overview]
Message-ID: <20261126103709.655707-1-rongh7426@gmail.com> (raw)

vc4_plane_allocate_lbm() and vc6_plane_allocate_upm() run from the
plane's atomic_check. When the line buffer memory or the BCM2712's
unified pixel memory can't fit a new state, they return -ENOSPC, which
is the expected way to reject a configuration that needs more of a
limited resource than is free. They also print it with drm_err().

That lets the DRM master fill the kernel log with error messages just
by testing configurations with DRM_MODE_ATOMIC_TEST_ONLY, as a
compositor or an igt test probing plane limits does. On a Raspberry
Pi 5, 1000 TEST_ONLY commits of 18 full-screen planes add 1000
"*ERROR* Failed to allocate UPM entry: -28" records, and the same with
the planes upscaled 2x adds 1000 "Failed to allocate LBM entry: -28"
records.

Use drm_dbg_kms() for both, as is already done for running out of UPM
handles in the same function. The messages are still there with
drm.debug=0x04.

Tested on a Raspberry Pi 5 (Raspberry Pi OS kernel 6.18.39, with this
change applied to its vc4 driver), counting /dev/kmsg records around
1000 TEST_ONLY commits that fail with -ENOSPC:
- UPM: 1000 records before, 0 after
- LBM: 1000 records before, 0 after
- with drm.debug=0x04, both messages are printed from
  vc4_plane_atomic_check

This change and its description were written with the help of an AI
coding assistant (Claude); the testing above was done on real
hardware.

Signed-off-by: Roy <rongh7426@gmail.com>
---
 drivers/gpu/drm/vc4/vc4_plane.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c
index 20c9fc9..81df567 100644
--- a/drivers/gpu/drm/vc4/vc4_plane.c
+++ b/drivers/gpu/drm/vc4/vc4_plane.c
@@ -958,7 +958,7 @@ static int vc4_plane_allocate_lbm(struct drm_plane_state *state)
 		spin_unlock_irqrestore(&vc4->hvs->mm_lock, irqflags);
 
 		if (ret) {
-			drm_err(drm, "Failed to allocate LBM entry: %d\n", ret);
+			drm_dbg_kms(drm, "Failed to allocate LBM entry: %d\n", ret);
 			return ret;
 		}
 	} else {
@@ -1028,7 +1028,7 @@ static int vc6_plane_allocate_upm(struct drm_plane_state *state)
 							 0, 0);
 			spin_unlock_irqrestore(&hvs->mm_lock, irqflags);
 			if (ret) {
-				drm_err(drm, "Failed to allocate UPM entry: %d\n", ret);
+				drm_dbg_kms(drm, "Failed to allocate UPM entry: %d\n", ret);
 				refcount_set(&refcount->refcount, 0);
 				ida_free(&hvs->upm_handles, upm_handle);
 				vc4_state->upm_handle[i] = 0;
-- 
2.51.1.windows.1


                 reply	other threads:[~2026-11-26 10:37 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=20261126103709.655707-1-rongh7426@gmail.com \
    --to=rongh7426@gmail.com \
    --cc=airlied@gmail.com \
    --cc=dave.stevenson@raspberrypi.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kernel-list@raspberrypi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mcanal@igalia.com \
    --cc=mripard@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    /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.