diff mbox series

[01/13] drm/i915/bios: make child device order the priority order

Message ID 34ab98880386a095422521ad39f4c080eeb3989a.1559308269.git.jani.nikula@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915/bios: vbt cleanup | expand

Commit Message

Jani Nikula May 31, 2019, 1:14 p.m. UTC
Make the child device order the priority order in sanitizing DDC pin and
AUX CH. First come, first served.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/intel_bios.c | 32 +++++++++++++++----------------
 1 file changed, 15 insertions(+), 17 deletions(-)

Comments

Ville Syrjälä May 31, 2019, 2:04 p.m. UTC | #1
On Fri, May 31, 2019 at 04:14:51PM +0300, Jani Nikula wrote:
> Make the child device order the priority order in sanitizing DDC pin and
> AUX CH. First come, first served.
> 
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_bios.c | 32 +++++++++++++++----------------
>  1 file changed, 15 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
> index a0b708f7f384..0a1b9a4a1b71 100644
> --- a/drivers/gpu/drm/i915/intel_bios.c
> +++ b/drivers/gpu/drm/i915/intel_bios.c
> @@ -1242,8 +1242,7 @@ static u8 translate_iboost(u8 val)
>  static void sanitize_ddc_pin(struct drm_i915_private *dev_priv,
>  			     enum port port)
>  {
> -	const struct ddi_vbt_port_info *info =
> -		&dev_priv->vbt.ddi_port_info[port];
> +	struct ddi_vbt_port_info *info = &dev_priv->vbt.ddi_port_info[port];
>  	enum port p;
>  
>  	if (!info->alternate_ddc_pin)
> @@ -1258,8 +1257,8 @@ static void sanitize_ddc_pin(struct drm_i915_private *dev_priv,
>  
>  		DRM_DEBUG_KMS("port %c trying to use the same DDC pin (0x%x) as port %c, "
>  			      "disabling port %c DVI/HDMI support\n",
> -			      port_name(p), i->alternate_ddc_pin,
> -			      port_name(port), port_name(p));
> +			      port_name(port), info->alternate_ddc_pin,
> +			      port_name(p), port_name(port));
>  
>  		/*
>  		 * If we have multiple ports supposedly sharing the
> @@ -1267,20 +1266,19 @@ static void sanitize_ddc_pin(struct drm_i915_private *dev_priv,
>  		 * port. Otherwise they share the same ddc bin and
>  		 * system couldn't communicate with them separately.
>  		 *
> -		 * Due to parsing the ports in child device order,
> -		 * a later device will always clobber an earlier one.
> +		 * Give child device order the priority, first come first
> +		 * served.
>  		 */
> -		i->supports_dvi = false;
> -		i->supports_hdmi = false;
> -		i->alternate_ddc_pin = 0;
> +		info->supports_dvi = false;
> +		info->supports_hdmi = false;
> +		info->alternate_ddc_pin = 0;

'i' can now be const I think.

Series is
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Though I only glanced at the header reorganization things instead
of reading through it all in detail.

>  	}
>  }
>  
>  static void sanitize_aux_ch(struct drm_i915_private *dev_priv,
>  			    enum port port)
>  {
> -	const struct ddi_vbt_port_info *info =
> -		&dev_priv->vbt.ddi_port_info[port];
> +	struct ddi_vbt_port_info *info = &dev_priv->vbt.ddi_port_info[port];
>  	enum port p;
>  
>  	if (!info->alternate_aux_channel)
> @@ -1295,8 +1293,8 @@ static void sanitize_aux_ch(struct drm_i915_private *dev_priv,
>  
>  		DRM_DEBUG_KMS("port %c trying to use the same AUX CH (0x%x) as port %c, "
>  			      "disabling port %c DP support\n",
> -			      port_name(p), i->alternate_aux_channel,
> -			      port_name(port), port_name(p));
> +			      port_name(port), info->alternate_aux_channel,
> +			      port_name(p), port_name(port));
>  
>  		/*
>  		 * If we have multiple ports supposedlt sharing the
> @@ -1304,11 +1302,11 @@ static void sanitize_aux_ch(struct drm_i915_private *dev_priv,
>  		 * port. Otherwise they share the same aux channel
>  		 * and system couldn't communicate with them separately.
>  		 *
> -		 * Due to parsing the ports in child device order,
> -		 * a later device will always clobber an earlier one.
> +		 * Give child device order the priority, first come first
> +		 * served.
>  		 */
> -		i->supports_dp = false;
> -		i->alternate_aux_channel = 0;
> +		info->supports_dp = false;
> +		info->alternate_aux_channel = 0;
>  	}
>  }
>  
> -- 
> 2.20.1
Jani Nikula June 5, 2019, 12:22 p.m. UTC | #2
On Fri, 31 May 2019, Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:
> On Fri, May 31, 2019 at 04:14:51PM +0300, Jani Nikula wrote:
>> Make the child device order the priority order in sanitizing DDC pin and
>> AUX CH. First come, first served.
>> 
>> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>> ---
>>  drivers/gpu/drm/i915/intel_bios.c | 32 +++++++++++++++----------------
>>  1 file changed, 15 insertions(+), 17 deletions(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
>> index a0b708f7f384..0a1b9a4a1b71 100644
>> --- a/drivers/gpu/drm/i915/intel_bios.c
>> +++ b/drivers/gpu/drm/i915/intel_bios.c
>> @@ -1242,8 +1242,7 @@ static u8 translate_iboost(u8 val)
>>  static void sanitize_ddc_pin(struct drm_i915_private *dev_priv,
>>  			     enum port port)
>>  {
>> -	const struct ddi_vbt_port_info *info =
>> -		&dev_priv->vbt.ddi_port_info[port];
>> +	struct ddi_vbt_port_info *info = &dev_priv->vbt.ddi_port_info[port];
>>  	enum port p;
>>  
>>  	if (!info->alternate_ddc_pin)
>> @@ -1258,8 +1257,8 @@ static void sanitize_ddc_pin(struct drm_i915_private *dev_priv,
>>  
>>  		DRM_DEBUG_KMS("port %c trying to use the same DDC pin (0x%x) as port %c, "
>>  			      "disabling port %c DVI/HDMI support\n",
>> -			      port_name(p), i->alternate_ddc_pin,
>> -			      port_name(port), port_name(p));
>> +			      port_name(port), info->alternate_ddc_pin,
>> +			      port_name(p), port_name(port));
>>  
>>  		/*
>>  		 * If we have multiple ports supposedly sharing the
>> @@ -1267,20 +1266,19 @@ static void sanitize_ddc_pin(struct drm_i915_private *dev_priv,
>>  		 * port. Otherwise they share the same ddc bin and
>>  		 * system couldn't communicate with them separately.
>>  		 *
>> -		 * Due to parsing the ports in child device order,
>> -		 * a later device will always clobber an earlier one.
>> +		 * Give child device order the priority, first come first
>> +		 * served.
>>  		 */
>> -		i->supports_dvi = false;
>> -		i->supports_hdmi = false;
>> -		i->alternate_ddc_pin = 0;
>> +		info->supports_dvi = false;
>> +		info->supports_hdmi = false;
>> +		info->alternate_ddc_pin = 0;
>
> 'i' can now be const I think.

I ignored that because 'i' gets removed a couple of patches later
anyway.

>
> Series is
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Though I only glanced at the header reorganization things instead
> of reading through it all in detail.

Thanks, pushed the lot.

BR,
Jani.

>
>>  	}
>>  }
>>  
>>  static void sanitize_aux_ch(struct drm_i915_private *dev_priv,
>>  			    enum port port)
>>  {
>> -	const struct ddi_vbt_port_info *info =
>> -		&dev_priv->vbt.ddi_port_info[port];
>> +	struct ddi_vbt_port_info *info = &dev_priv->vbt.ddi_port_info[port];
>>  	enum port p;
>>  
>>  	if (!info->alternate_aux_channel)
>> @@ -1295,8 +1293,8 @@ static void sanitize_aux_ch(struct drm_i915_private *dev_priv,
>>  
>>  		DRM_DEBUG_KMS("port %c trying to use the same AUX CH (0x%x) as port %c, "
>>  			      "disabling port %c DP support\n",
>> -			      port_name(p), i->alternate_aux_channel,
>> -			      port_name(port), port_name(p));
>> +			      port_name(port), info->alternate_aux_channel,
>> +			      port_name(p), port_name(port));
>>  
>>  		/*
>>  		 * If we have multiple ports supposedlt sharing the
>> @@ -1304,11 +1302,11 @@ static void sanitize_aux_ch(struct drm_i915_private *dev_priv,
>>  		 * port. Otherwise they share the same aux channel
>>  		 * and system couldn't communicate with them separately.
>>  		 *
>> -		 * Due to parsing the ports in child device order,
>> -		 * a later device will always clobber an earlier one.
>> +		 * Give child device order the priority, first come first
>> +		 * served.
>>  		 */
>> -		i->supports_dp = false;
>> -		i->alternate_aux_channel = 0;
>> +		info->supports_dp = false;
>> +		info->alternate_aux_channel = 0;
>>  	}
>>  }
>>  
>> -- 
>> 2.20.1
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
index a0b708f7f384..0a1b9a4a1b71 100644
--- a/drivers/gpu/drm/i915/intel_bios.c
+++ b/drivers/gpu/drm/i915/intel_bios.c
@@ -1242,8 +1242,7 @@  static u8 translate_iboost(u8 val)
 static void sanitize_ddc_pin(struct drm_i915_private *dev_priv,
 			     enum port port)
 {
-	const struct ddi_vbt_port_info *info =
-		&dev_priv->vbt.ddi_port_info[port];
+	struct ddi_vbt_port_info *info = &dev_priv->vbt.ddi_port_info[port];
 	enum port p;
 
 	if (!info->alternate_ddc_pin)
@@ -1258,8 +1257,8 @@  static void sanitize_ddc_pin(struct drm_i915_private *dev_priv,
 
 		DRM_DEBUG_KMS("port %c trying to use the same DDC pin (0x%x) as port %c, "
 			      "disabling port %c DVI/HDMI support\n",
-			      port_name(p), i->alternate_ddc_pin,
-			      port_name(port), port_name(p));
+			      port_name(port), info->alternate_ddc_pin,
+			      port_name(p), port_name(port));
 
 		/*
 		 * If we have multiple ports supposedly sharing the
@@ -1267,20 +1266,19 @@  static void sanitize_ddc_pin(struct drm_i915_private *dev_priv,
 		 * port. Otherwise they share the same ddc bin and
 		 * system couldn't communicate with them separately.
 		 *
-		 * Due to parsing the ports in child device order,
-		 * a later device will always clobber an earlier one.
+		 * Give child device order the priority, first come first
+		 * served.
 		 */
-		i->supports_dvi = false;
-		i->supports_hdmi = false;
-		i->alternate_ddc_pin = 0;
+		info->supports_dvi = false;
+		info->supports_hdmi = false;
+		info->alternate_ddc_pin = 0;
 	}
 }
 
 static void sanitize_aux_ch(struct drm_i915_private *dev_priv,
 			    enum port port)
 {
-	const struct ddi_vbt_port_info *info =
-		&dev_priv->vbt.ddi_port_info[port];
+	struct ddi_vbt_port_info *info = &dev_priv->vbt.ddi_port_info[port];
 	enum port p;
 
 	if (!info->alternate_aux_channel)
@@ -1295,8 +1293,8 @@  static void sanitize_aux_ch(struct drm_i915_private *dev_priv,
 
 		DRM_DEBUG_KMS("port %c trying to use the same AUX CH (0x%x) as port %c, "
 			      "disabling port %c DP support\n",
-			      port_name(p), i->alternate_aux_channel,
-			      port_name(port), port_name(p));
+			      port_name(port), info->alternate_aux_channel,
+			      port_name(p), port_name(port));
 
 		/*
 		 * If we have multiple ports supposedlt sharing the
@@ -1304,11 +1302,11 @@  static void sanitize_aux_ch(struct drm_i915_private *dev_priv,
 		 * port. Otherwise they share the same aux channel
 		 * and system couldn't communicate with them separately.
 		 *
-		 * Due to parsing the ports in child device order,
-		 * a later device will always clobber an earlier one.
+		 * Give child device order the priority, first come first
+		 * served.
 		 */
-		i->supports_dp = false;
-		i->alternate_aux_channel = 0;
+		info->supports_dp = false;
+		info->alternate_aux_channel = 0;
 	}
 }