All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@linux.intel.com>
To: maarten.lankhorst@linux.intel.com
Cc: mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com,
	simona@ffwll.ch, dri-devel@lists.freedesktop.org,
	Andi Kleen <ak@linux.intel.com>
Subject: [PATCH v3] drm: Print bad EDID notices less often
Date: Thu, 26 Sep 2024 11:01:50 -0700	[thread overview]
Message-ID: <20240926180150.2674763-1-ak@linux.intel.com> (raw)

I have an old monitor that reports a zero EDID block, which results in a
warning message. This happens on every screen save cycle, and maybe in
some other situations, and over time the whole kernel log gets filled
with these redundant messages.

Make most of these prints conditional on bad_edid_count like other verbose EDID
messages.

Signed-off-by: Andi Kleen <ak@linux.intel.com>

---

v2: Use bad_edid_count instead of _once.
v3: Move rate limit logic into dedicated wrapper.
---
 drivers/gpu/drm/drm_edid.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 855beafb76ff..64d41dd605f1 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -1949,6 +1949,18 @@ static void edid_block_status_print(enum edid_block_status status,
 	}
 }
 
+static void edid_block_status_print_rl(struct drm_connector *connector,
+				    enum edid_block_status status,
+				    const struct edid *block,
+				    int block_num)
+{
+	if (status != EDID_BLOCK_OK &&
+		!connector->bad_edid_counter++ &&
+		!drm_debug_enabled(DRM_UT_KMS))
+		return;
+	edid_block_status_print(status, block, block_num);
+}
+
 static void edid_block_dump(const char *level, const void *block, int block_num)
 {
 	enum edid_block_status status;
@@ -2375,7 +2387,7 @@ static struct edid *_drm_do_get_edid(struct drm_connector *connector,
 
 	status = edid_block_read(edid, 0, read_block, context);
 
-	edid_block_status_print(status, edid, 0);
+	edid_block_status_print_rl(connector, status, edid, 0);
 
 	if (status == EDID_BLOCK_READ_FAIL)
 		goto fail;
@@ -2409,7 +2421,7 @@ static struct edid *_drm_do_get_edid(struct drm_connector *connector,
 
 		status = edid_block_read(block, i, read_block, context);
 
-		edid_block_status_print(status, block, i);
+		edid_block_status_print_rl(connector, status, block, i);
 
 		if (!edid_block_status_valid(status, edid_block_tag(block))) {
 			if (status == EDID_BLOCK_READ_FAIL)
-- 
2.46.1


             reply	other threads:[~2024-09-26 18:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-26 18:01 Andi Kleen [this message]
2024-09-27  9:30 ` [PATCH v3] drm: Print bad EDID notices less often Jani Nikula
2024-09-27 11:33   ` Andi Kleen
2024-09-27 12:23     ` Jani Nikula

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=20240926180150.2674763-1-ak@linux.intel.com \
    --to=ak@linux.intel.com \
    --cc=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=maarten.lankhorst@linux.intel.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.