Commit f40ab034 authored by Jani Nikula's avatar Jani Nikula
Browse files

drm/edid: split drm_add_edid_modes() to two

parent f4e558ec
Loading
Loading
Loading
Loading
+24 −18
Original line number Original line Diff line number Diff line
@@ -5556,18 +5556,8 @@ static int add_displayid_detailed_modes(struct drm_connector *connector,
	return num_modes;
	return num_modes;
}
}


/**
static int drm_edid_connector_update(struct drm_connector *connector,
 * drm_add_edid_modes - add modes from EDID data, if available
				     const struct edid *edid)
 * @connector: connector we're probing
 * @edid: EDID data
 *
 * Add the specified modes to the connector's mode list. Also fills out the
 * &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.
 */
int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid)
{
{
	int num_modes = 0;
	int num_modes = 0;
	u32 quirks;
	u32 quirks;
@@ -5576,12 +5566,6 @@ int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid)
		clear_eld(connector);
		clear_eld(connector);
		return 0;
		return 0;
	}
	}
	if (!drm_edid_is_valid(edid)) {
		clear_eld(connector);
		drm_warn(connector->dev, "%s: EDID invalid.\n",
			 connector->name);
		return 0;
	}


	drm_edid_to_eld(connector, edid);
	drm_edid_to_eld(connector, edid);


@@ -5633,6 +5617,28 @@ int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid)


	return num_modes;
	return num_modes;
}
}

/**
 * drm_add_edid_modes - add modes from EDID data, if available
 * @connector: connector we're probing
 * @edid: EDID data
 *
 * Add the specified modes to the connector's mode list. Also fills out the
 * &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.
 */
int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid)
{
	if (edid && !drm_edid_is_valid(edid)) {
		drm_warn(connector->dev, "%s: EDID invalid.\n",
			 connector->name);
		edid = NULL;
	}

	return drm_edid_connector_update(connector, edid);
}
EXPORT_SYMBOL(drm_add_edid_modes);
EXPORT_SYMBOL(drm_add_edid_modes);


/**
/**