summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_edid_load.c
diff options
context:
space:
mode:
authorJerome Glisse <jglisse@redhat.com>2012-08-09 17:25:51 +0200
committerDave Airlie <airlied@redhat.com>2012-09-17 03:16:40 +0200
commit0b2443ed4e07d7973e4554a2cc166bc35447b59e (patch)
treea996dbd03a8480f6473a7ea2fdea3936760de853 /drivers/gpu/drm/drm_edid_load.c
parentgma500: Remove unused variable (diff)
downloadlinux-0b2443ed4e07d7973e4554a2cc166bc35447b59e.tar.xz
linux-0b2443ed4e07d7973e4554a2cc166bc35447b59e.zip
drm/edid: limit printk when facing bad edid
Limit printing bad edid information at one time per connector. Connector that are connected to a bad monitor/kvm will likely stay connected to the same bad monitor/kvm and it makes no sense to keep printing the bad edid message. Signed-off-by: Jerome Glisse <jglisse@redhat.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/drm_edid_load.c')
-rw-r--r--drivers/gpu/drm/drm_edid_load.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/drm/drm_edid_load.c b/drivers/gpu/drm/drm_edid_load.c
index 186832e1874e..ea9cdab3d431 100644
--- a/drivers/gpu/drm/drm_edid_load.c
+++ b/drivers/gpu/drm/drm_edid_load.c
@@ -123,6 +123,7 @@ static u8 *edid_load(struct drm_connector *connector, char *name,
int fwsize, expected;
int builtin = 0, err = 0;
int i, valid_extensions = 0;
+ bool print_bad_edid = !connector->bad_edid_counter || (drm_debug & DRM_UT_KMS);
pdev = platform_device_register_simple(connector_name, -1, NULL, 0);
if (IS_ERR(pdev)) {
@@ -173,7 +174,8 @@ static u8 *edid_load(struct drm_connector *connector, char *name,
}
memcpy(edid, fwdata, fwsize);
- if (!drm_edid_block_valid(edid, 0)) {
+ if (!drm_edid_block_valid(edid, 0, print_bad_edid)) {
+ connector->bad_edid_counter++;
DRM_ERROR("Base block of EDID firmware \"%s\" is invalid ",
name);
kfree(edid);
@@ -185,7 +187,7 @@ static u8 *edid_load(struct drm_connector *connector, char *name,
if (i != valid_extensions + 1)
memcpy(edid + (valid_extensions + 1) * EDID_LENGTH,
edid + i * EDID_LENGTH, EDID_LENGTH);
- if (drm_edid_block_valid(edid + i * EDID_LENGTH, i))
+ if (drm_edid_block_valid(edid + i * EDID_LENGTH, i, print_bad_edid))
valid_extensions++;
}