Skip to contentSkip to conversation

drm: Print bad EDID notices less often

PATCH In review Andi Kleen 2 participants 4 messages Sep 26, 2024 – Sep 27, 2024

Subsystems (2)
lore
Share & tools
lore

Andi Kleen

author
#0 lore raw

PATCH v3 1/1 drm: Print bad EDID notices less often

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.

---

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(-)
drivers/gpu/drm/drm_edid.c +14 -2
index 855beafb76ff..64d41dd605f1 100644
@@ -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)
Signature · 1 line
2.46.1
#1 lore raw
Quoted 7 lines · Andi Kleen

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.

Honestly I think merging this would be counter-productive to addressing the issue properly.

Please just give me the chance to look into it.

Is your zero EDID block the base block or an extension block?

BR,
Jani.

Quoted 52 lines

---

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(-)
drivers/gpu/drm/drm_edid.c +14 -2
index 855beafb76ff..64d41dd605f1 100644
@@ -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)
Signature · 1 line
Jani Nikula, Intel
author
#2 lore raw
Quoted 11 lines · Jani Nikula
Quoted 7 lines · Andi Kleen

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.

Honestly I think merging this would be counter-productive to addressing the issue properly.

You think it's a problem on the host side, not the monitor side?

Quoted 4 lines

Please just give me the chance to look into it.

Is your zero EDID block the base block or an extension block?

It's an extension block I believe.

-Andi

#3 lore raw
Quoted 7 lines · Andi Kleen
Quoted 6 lines · Jani Nikula
Quoted 5 lines · Andi Kleen

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.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

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

Honestly I think merging this would be counter-productive to addressing the issue properly.

You think it's a problem on the host side, not the monitor side?

Both. :)

Having zero EDID block is an issue with the display, logging excessively about it is an issue on the host side.

Quoted 5 lines
Quoted 3 lines

Please just give me the chance to look into it.

Is your zero EDID block the base block or an extension block?

It's an extension block I believe.

Now that should be helpful in detecting display changes, and only logging once per display. Unless you unplug and plug, but that's not so common.

BR,
Jani.

Signature · 1 line
Jani Nikula, Intel