Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9bedc7ed authored by Jani Nikula's avatar Jani Nikula
Browse files

drm/i915/lvds: nuke intel_lvds_supported()



Now that intel_lvds_init() is only called for platforms that might have
LVDS, move the remaining checks to intel_setup_outputs(), again similar
to other outputs, and remove the overlapping checks.

Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190122082307.4003-3-jani.nikula@intel.com
parent 0fafa226
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -14467,6 +14467,7 @@ static void intel_setup_outputs(struct drm_i915_private *dev_priv)
	} else if (IS_GEN_RANGE(dev_priv, 3, 4)) {
	} else if (IS_GEN_RANGE(dev_priv, 3, 4)) {
		bool found = false;
		bool found = false;


		if (IS_MOBILE(dev_priv))
			intel_lvds_init(dev_priv);
			intel_lvds_init(dev_priv);


		if (dev_priv->vbt.int_crt_support)
		if (dev_priv->vbt.int_crt_support)
@@ -14504,6 +14505,7 @@ static void intel_setup_outputs(struct drm_i915_private *dev_priv)
		if (IS_G4X(dev_priv) && (I915_READ(DP_D) & DP_DETECTED))
		if (IS_G4X(dev_priv) && (I915_READ(DP_D) & DP_DETECTED))
			intel_dp_init(dev_priv, DP_D, PORT_D);
			intel_dp_init(dev_priv, DP_D, PORT_D);
	} else if (IS_GEN(dev_priv, 2)) {
	} else if (IS_GEN(dev_priv, 2)) {
		if (IS_MOBILE(dev_priv) && !IS_I830(dev_priv))
			intel_lvds_init(dev_priv);
			intel_lvds_init(dev_priv);


		if (dev_priv->vbt.int_crt_support)
		if (dev_priv->vbt.int_crt_support)
+0 −23
Original line number Original line Diff line number Diff line
@@ -798,26 +798,6 @@ static bool compute_is_dual_link_lvds(struct intel_lvds_encoder *lvds_encoder)
	return (val & LVDS_CLKB_POWER_MASK) == LVDS_CLKB_POWER_UP;
	return (val & LVDS_CLKB_POWER_MASK) == LVDS_CLKB_POWER_UP;
}
}


static bool intel_lvds_supported(struct drm_i915_private *dev_priv)
{
	/*
	 * With the introduction of the PCH we gained a dedicated
	 * LVDS presence pin, use it.
	 */
	if (HAS_PCH_IBX(dev_priv) || HAS_PCH_CPT(dev_priv))
		return true;

	/*
	 * Otherwise LVDS was only attached to mobile products,
	 * except for the inglorious 830gm
	 */
	if (INTEL_GEN(dev_priv) <= 4 &&
	    IS_MOBILE(dev_priv) && !IS_I830(dev_priv))
		return true;

	return false;
}

/**
/**
 * intel_lvds_init - setup LVDS connectors on this device
 * intel_lvds_init - setup LVDS connectors on this device
 * @dev_priv: i915 device
 * @dev_priv: i915 device
@@ -842,9 +822,6 @@ void intel_lvds_init(struct drm_i915_private *dev_priv)
	u8 pin;
	u8 pin;
	u32 allowed_scalers;
	u32 allowed_scalers;


	if (!intel_lvds_supported(dev_priv))
		return;

	/* Skip init on machines we know falsely report LVDS */
	/* Skip init on machines we know falsely report LVDS */
	if (dmi_check_system(intel_no_lvds)) {
	if (dmi_check_system(intel_no_lvds)) {
		WARN(!dev_priv->vbt.int_lvds_support,
		WARN(!dev_priv->vbt.int_lvds_support,