Commit 4a2236f9 authored by Ville Syrjälä's avatar Ville Syrjälä
Browse files

drm/i915/dvo: Make .get_modes() return the number of modes



.get_modes() is supposed to return the number of modes added to the
probed_modes list (not that anyone actually checks for anything
except zero vs. not zero). Let's do that.

Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200108181242.13650-9-ville.syrjala@linux.intel.com


Reviewed-by: default avatarImre Deak <imre.deak@intel.com>
parent 7407ec6e
Loading
Loading
Loading
Loading
+8 −6
Original line number Original line Diff line number Diff line
@@ -324,6 +324,7 @@ static int intel_dvo_get_modes(struct drm_connector *connector)
	struct drm_i915_private *dev_priv = to_i915(connector->dev);
	struct drm_i915_private *dev_priv = to_i915(connector->dev);
	const struct drm_display_mode *fixed_mode =
	const struct drm_display_mode *fixed_mode =
		to_intel_connector(connector)->panel.fixed_mode;
		to_intel_connector(connector)->panel.fixed_mode;
	int num_modes;


	/*
	/*
	 * We should probably have an i2c driver get_modes function for those
	 * We should probably have an i2c driver get_modes function for those
@@ -331,21 +332,22 @@ static int intel_dvo_get_modes(struct drm_connector *connector)
	 * (TV-out, for example), but for now with just TMDS and LVDS,
	 * (TV-out, for example), but for now with just TMDS and LVDS,
	 * that's not the case.
	 * that's not the case.
	 */
	 */
	intel_ddc_get_modes(connector,
	num_modes = intel_ddc_get_modes(connector,
					intel_gmbus_get_adapter(dev_priv, GMBUS_PIN_DPC));
					intel_gmbus_get_adapter(dev_priv, GMBUS_PIN_DPC));
	if (!list_empty(&connector->probed_modes))
	if (num_modes)
		return 1;
		return num_modes;


	if (fixed_mode) {
	if (fixed_mode) {
		struct drm_display_mode *mode;
		struct drm_display_mode *mode;

		mode = drm_mode_duplicate(connector->dev, fixed_mode);
		mode = drm_mode_duplicate(connector->dev, fixed_mode);
		if (mode) {
		if (mode) {
			drm_mode_probed_add(connector, mode);
			drm_mode_probed_add(connector, mode);
			return 1;
			num_modes++;
		}
		}
	}
	}


	return 0;
	return num_modes;
}
}


static const struct drm_connector_funcs intel_dvo_connector_funcs = {
static const struct drm_connector_funcs intel_dvo_connector_funcs = {