drm/edid: improve non-desktop quirk logging
authorJani Nikula <jani.nikula@intel.com>
Tue, 28 Dec 2021 10:10:51 +0000 (12:10 +0200)
committerJani Nikula <jani.nikula@intel.com>
Mon, 24 Jan 2022 14:37:10 +0000 (16:37 +0200)
Improve non-desktop quirk logging if the EDID indicates non-desktop. If
both are set, note about redundant quirk. If there's no quirk but the
EDID indicates non-desktop, don't log non-desktop is set to 0.

Cc: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Philipp Zabel <philipp.zabel@gmail.com>
Tested-by: Philipp Zabel <philipp.zabel@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211228101051.317989-1-jani.nikula@intel.com
drivers/gpu/drm/drm_edid.c

index c23ad8f0b3e99dddfed68fc9d223aa784e7ea192..eb61a1a92dc0856723f29eeef535f1530f62b5f3 100644 (file)
@@ -5365,17 +5365,13 @@ u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edi
        info->width_mm = edid->width_cm * 10;
        info->height_mm = edid->height_cm * 10;
 
-       info->non_desktop = !!(quirks & EDID_QUIRK_NON_DESKTOP);
-
        drm_get_monitor_range(connector, edid);
 
-       DRM_DEBUG_KMS("non_desktop set to %d\n", info->non_desktop);
-
        if (edid->revision < 3)
-               return quirks;
+               goto out;
 
        if (!(edid->input & DRM_EDID_INPUT_DIGITAL))
-               return quirks;
+               goto out;
 
        drm_parse_cea_ext(connector, edid);
 
@@ -5395,7 +5391,7 @@ u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edi
 
        /* Only defined for 1.4 with digital displays */
        if (edid->revision < 4)
-               return quirks;
+               goto out;
 
        switch (edid->input & DRM_EDID_DIGITAL_DEPTH_MASK) {
        case DRM_EDID_DIGITAL_DEPTH_6:
@@ -5433,6 +5429,13 @@ u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edi
 
        drm_update_mso(connector, edid);
 
+out:
+       if (quirks & EDID_QUIRK_NON_DESKTOP) {
+               drm_dbg_kms(connector->dev, "Non-desktop display%s\n",
+                           info->non_desktop ? " (redundant quirk)" : "");
+               info->non_desktop = true;
+       }
+
        return quirks;
 }