drm/edid: build ELD in drm_add_edid_modes()
authorJani Nikula <jani.nikula@intel.com>
Wed, 1 Nov 2017 14:21:01 +0000 (16:21 +0200)
committerJani Nikula <jani.nikula@intel.com>
Tue, 7 Nov 2017 15:43:34 +0000 (17:43 +0200)
Call drm_edid_to_eld() from drm_add_edid_modes() to fill in the ELD
automatically. There's no harm in doing this for connectors that do not
support audio.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/551b2e1cf19be04c510e7865d7539cfc2f54ea89.1509545641.git.jani.nikula@intel.com
drivers/gpu/drm/drm_edid.c

index 3162ea58e450055b680712d6453a13b367d9a55f..4e3ef3d91b9564ca8da820ffca691be4b8a0ec46 100644 (file)
@@ -4612,8 +4612,8 @@ static int add_displayid_detailed_modes(struct drm_connector *connector,
  * @edid: EDID data
  *
  * Add the specified modes to the connector's mode list. Also fills out the
- * &drm_display_info structure in @connector with any information which can be
- * derived from the edid.
+ * &drm_display_info structure and ELD in @connector with any information which
+ * can be derived from the edid.
  *
  * Return: The number of modes added or 0 if we couldn't find any.
  */
@@ -4623,9 +4623,11 @@ int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid)
        u32 quirks;
 
        if (edid == NULL) {
+               clear_eld(connector);
                return 0;
        }
        if (!drm_edid_is_valid(edid)) {
+               clear_eld(connector);
                dev_warn(connector->dev->dev, "%s: EDID invalid.\n",
                         connector->name);
                return 0;
@@ -4633,6 +4635,8 @@ int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid)
 
        quirks = edid_get_quirks(edid);
 
+       drm_edid_to_eld(connector, edid);
+
        /*
         * CEA-861-F adds ycbcr capability map block, for HDMI 2.0 sinks.
         * To avoid multiple parsing of same block, lets parse that map