Commit 894d1739 authored by Jani Nikula's avatar Jani Nikula
Browse files

drm/i915/bios: reduce indent in sanitize_ddc_pin and sanitize_aux_ch



Reduce indent with an early return. No functional changes.

Reviewed-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
[Jani: fixed a couple of comment typos while applying.]
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/17288137452f731a820e737582672f836660a26f.1615998927.git.jani.nikula@intel.com
parent ef0096e4
Loading
Loading
Loading
Loading
+41 −45
Original line number Diff line number Diff line
@@ -1525,7 +1525,9 @@ static void sanitize_ddc_pin(struct drm_i915_private *i915,
		return;

	p = get_port_by_ddc_pin(i915, info->alternate_ddc_pin);
	if (p != PORT_NONE) {
	if (p == PORT_NONE)
		return;

	drm_dbg_kms(&i915->drm,
		    "port %c trying to use the same DDC pin (0x%x) as port %c, "
		    "disabling port %c DVI/HDMI support\n",
@@ -1533,16 +1535,13 @@ static void sanitize_ddc_pin(struct drm_i915_private *i915,
		    port_name(p), port_name(p));

	/*
		 * If we have multiple ports supposedly sharing the
		 * pin, then dvi/hdmi couldn't exist on the shared
		 * port. Otherwise they share the same ddc bin and
		 * system couldn't communicate with them separately.
	 * If we have multiple ports supposedly sharing the pin, then dvi/hdmi
	 * couldn't exist on the shared port. Otherwise they share the same ddc
	 * pin and system couldn't communicate with them separately.
	 *
		 * Give inverse child device order the priority,
		 * last one wins. Yes, there are real machines
		 * (eg. Asrock B250M-HDV) where VBT has both
		 * port A and port E with the same AUX ch and
		 * we must pick port E :(
	 * Give inverse child device order the priority, last one wins. Yes,
	 * there are real machines (eg. Asrock B250M-HDV) where VBT has both
	 * port A and port E with the same AUX ch and we must pick port E :(
	 */
	info = &i915->vbt.ddi_port_info[p];

@@ -1550,7 +1549,6 @@ static void sanitize_ddc_pin(struct drm_i915_private *i915,
	info->supports_hdmi = false;
	info->alternate_ddc_pin = 0;
}
}

static enum port get_port_by_aux_ch(struct drm_i915_private *i915, u8 aux_ch)
{
@@ -1577,7 +1575,9 @@ static void sanitize_aux_ch(struct drm_i915_private *i915,
		return;

	p = get_port_by_aux_ch(i915, info->alternate_aux_channel);
	if (p != PORT_NONE) {
	if (p == PORT_NONE)
		return;

	drm_dbg_kms(&i915->drm,
		    "port %c trying to use the same AUX CH (0x%x) as port %c, "
		    "disabling port %c DP support\n",
@@ -1585,23 +1585,19 @@ static void sanitize_aux_ch(struct drm_i915_private *i915,
		    port_name(p), port_name(p));

	/*
		 * If we have multiple ports supposedlt sharing the
		 * aux channel, then DP couldn't exist on the shared
		 * port. Otherwise they share the same aux channel
		 * and system couldn't communicate with them separately.
	 * If we have multiple ports supposedly sharing the aux channel, then DP
	 * couldn't exist on the shared port. Otherwise they share the same aux
	 * channel and system couldn't communicate with them separately.
	 *
		 * Give inverse child device order the priority,
		 * last one wins. Yes, there are real machines
		 * (eg. Asrock B250M-HDV) where VBT has both
		 * port A and port E with the same AUX ch and
		 * we must pick port E :(
	 * Give inverse child device order the priority, last one wins. Yes,
	 * there are real machines (eg. Asrock B250M-HDV) where VBT has both
	 * port A and port E with the same AUX ch and we must pick port E :(
	 */
	info = &i915->vbt.ddi_port_info[p];

	info->supports_dp = false;
	info->alternate_aux_channel = 0;
}
}

static const u8 cnp_ddc_pin_map[] = {
	[0] = 0, /* N/A */