All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lucas De Marchi <lucas.demarchi@intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH v2 03/14] drm/i915/bios: reduce indent in sanitize_ddc_pin and sanitize_aux_ch
Date: Wed, 17 Mar 2021 12:18:42 -0700	[thread overview]
Message-ID: <20210317191842.plywiy4uds3yxh2d@ldmartin-desk2> (raw)
In-Reply-To: <17288137452f731a820e737582672f836660a26f.1615998927.git.jani.nikula@intel.com>

On Wed, Mar 17, 2021 at 06:36:42PM +0200, Jani Nikula wrote:
>Reduce indent with an early return. No functional changes.
>
>Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>---
> drivers/gpu/drm/i915/display/intel_bios.c | 86 +++++++++++------------
> 1 file changed, 41 insertions(+), 45 deletions(-)
>
>diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
>index 824148063451..5e7dc0899ab1 100644
>--- a/drivers/gpu/drm/i915/display/intel_bios.c
>+++ b/drivers/gpu/drm/i915/display/intel_bios.c
>@@ -1525,31 +1525,29 @@ 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) {
>-		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",
>-			    port_name(port), info->alternate_ddc_pin,
>-			    port_name(p), port_name(p));
>+	if (p == PORT_NONE)
>+		return;
>
>-		/*
>-		 * 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.
>-		 *
>-		 * 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];
>+	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",
>+		    port_name(port), info->alternate_ddc_pin,
>+		    port_name(p), port_name(p));
>
>-		info->supports_dvi = false;
>-		info->supports_hdmi = false;
>-		info->alternate_ddc_pin = 0;
>-	}
>+	/*
>+	 * 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.

while at it, may be worth fixing the typo s/bin/pin/


Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>

Lucas De Marchi

>+	 *
>+	 * 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_dvi = false;
>+	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,30 +1575,28 @@ 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) {
>-		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",
>-			    port_name(port), info->alternate_aux_channel,
>-			    port_name(p), port_name(p));
>+	if (p == PORT_NONE)
>+		return;
>
>-		/*
>-		 * 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.
>-		 *
>-		 * 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];
>+	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",
>+		    port_name(port), info->alternate_aux_channel,
>+		    port_name(p), port_name(p));
>
>-		info->supports_dp = false;
>-		info->alternate_aux_channel = 0;
>-	}
>+	/*
>+	 * 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.
>+	 *
>+	 * 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[] = {
>-- 
>2.20.1
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2021-03-17 19:18 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-17 16:36 [Intel-gfx] [PATCH v2 00/14] drm/i915/bios: vbt child device rework Jani Nikula
2021-03-17 16:36 ` [Intel-gfx] [PATCH v2 01/14] drm/i915/bios: mass convert dev_priv to i915 Jani Nikula
2021-03-17 16:36 ` [Intel-gfx] [PATCH v2 02/14] drm/i915/bios: store bdb version in i915 Jani Nikula
2021-03-17 16:36 ` [Intel-gfx] [PATCH v2 03/14] drm/i915/bios: reduce indent in sanitize_ddc_pin and sanitize_aux_ch Jani Nikula
2021-03-17 19:18   ` Lucas De Marchi [this message]
2021-03-17 19:23   ` Lucas De Marchi
2021-03-18 12:47     ` Jani Nikula
2021-03-17 16:36 ` [Intel-gfx] [PATCH v2 04/14] drm/i915/bios: move aux ch and ddc checks at a lower level Jani Nikula
2021-03-17 19:23   ` Lucas De Marchi
2021-03-17 16:36 ` [Intel-gfx] [PATCH v2 05/14] drm/i915/bios: limit default outputs by platform on missing VBT Jani Nikula
2021-03-17 16:36 ` [Intel-gfx] [PATCH v2 06/14] drm/i915/bios: limit default outputs to ports A through F Jani Nikula
2021-03-17 16:36 ` [Intel-gfx] [PATCH v2 07/14] drm/i915/bios: create fake child devices on missing VBT Jani Nikula
2021-03-17 16:36 ` [Intel-gfx] [PATCH v2 08/14] drm/i915/bios: rename display_device_data to intel_bios_encoder_data Jani Nikula
2021-03-17 16:36 ` [Intel-gfx] [PATCH v2 09/14] drm/i915/bios: add i915 backpointer " Jani Nikula
2021-03-17 19:32   ` Lucas De Marchi
2021-03-17 16:36 ` [Intel-gfx] [PATCH v2 10/14] drm/i915/bios: add helper functions to check output support Jani Nikula
2021-03-17 19:42   ` Lucas De Marchi
2021-03-18 12:48     ` Jani Nikula
2021-03-17 16:36 ` [Intel-gfx] [PATCH v2 11/14] drm/i915/bios: save a higher level pointer in ddi_vbt_port_info[] Jani Nikula
2021-03-17 16:36 ` [Intel-gfx] [PATCH v2 12/14] drm/i915/bios: start using the intel_bios_encoder_data directly Jani Nikula
2021-03-17 16:36 ` [Intel-gfx] [PATCH v2 13/14] drm/i915/bios: start using intel_bios_encoder_data for Type-C USB and TBT Jani Nikula
2021-03-17 16:36 ` [Intel-gfx] [PATCH v2 14/14] drm/i915/bios: add intel_bios_encoder_data to encoder, use for iboost Jani Nikula
2021-03-17 19:25 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/bios: vbt child device rework (rev2) Patchwork
2021-03-17 19:54 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-03-17 21:44 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210317191842.plywiy4uds3yxh2d@ldmartin-desk2 \
    --to=lucas.demarchi@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.