[Intel-gfx] [PATCH v2 04/14] drm/i915/bios: move aux ch and ddc checks at a lower level

Jani Nikula jani.nikula at intel.com
Wed Mar 17 16:36:43 UTC 2021


Signed-off-by: Jani Nikula <jani.nikula at intel.com>
---
 drivers/gpu/drm/i915/display/intel_bios.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
index 5e7dc0899ab1..3db41fe0c546 100644
--- a/drivers/gpu/drm/i915/display/intel_bios.c
+++ b/drivers/gpu/drm/i915/display/intel_bios.c
@@ -1505,6 +1505,9 @@ static enum port get_port_by_ddc_pin(struct drm_i915_private *i915, u8 ddc_pin)
 	const struct ddi_vbt_port_info *info;
 	enum port port;
 
+	if (!ddc_pin)
+		return PORT_NONE;
+
 	for_each_port(port) {
 		info = &i915->vbt.ddi_port_info[port];
 
@@ -1521,9 +1524,6 @@ static void sanitize_ddc_pin(struct drm_i915_private *i915,
 	struct ddi_vbt_port_info *info = &i915->vbt.ddi_port_info[port];
 	enum port p;
 
-	if (!info->alternate_ddc_pin)
-		return;
-
 	p = get_port_by_ddc_pin(i915, info->alternate_ddc_pin);
 	if (p == PORT_NONE)
 		return;
@@ -1555,6 +1555,9 @@ static enum port get_port_by_aux_ch(struct drm_i915_private *i915, u8 aux_ch)
 	const struct ddi_vbt_port_info *info;
 	enum port port;
 
+	if (!aux_ch)
+		return PORT_NONE;
+
 	for_each_port(port) {
 		info = &i915->vbt.ddi_port_info[port];
 
@@ -1571,9 +1574,6 @@ static void sanitize_aux_ch(struct drm_i915_private *i915,
 	struct ddi_vbt_port_info *info = &i915->vbt.ddi_port_info[port];
 	enum port p;
 
-	if (!info->alternate_aux_channel)
-		return;
-
 	p = get_port_by_aux_ch(i915, info->alternate_aux_channel);
 	if (p == PORT_NONE)
 		return;
-- 
2.20.1



More information about the Intel-gfx mailing list