diff mbox series

[4/5] drm/i915/tv: only call intel_tv_init() on platforms that might have TV

Message ID 20190121142134.17434-4-jani.nikula@intel.com (mailing list archive)
State New, archived
Headers show
Series [1/5] drm/i915/crt: split out intel_crt_present() to platform specific setup | expand

Commit Message

Jani Nikula Jan. 21, 2019, 2:21 p.m. UTC
With most platforms not having TV support, only call intel_tv_init() on
platforms that might actually have TV, specifically gens 3 and 4.

This puts intel_tv_init() more in line with the rest of the outputs, and
makes it slightly easier for the uninitiated to figure out which
platforms actually have what.

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

Comments

Ville Syrjala Jan. 21, 2019, 7:33 p.m. UTC | #1
On Mon, Jan 21, 2019 at 04:21:33PM +0200, Jani Nikula wrote:
> With most platforms not having TV support, only call intel_tv_init() on
> platforms that might actually have TV, specifically gens 3 and 4.
> 
> This puts intel_tv_init() more in line with the rest of the outputs, and
> makes it slightly easier for the uninitiated to figure out which
> platforms actually have what.
> 
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 4207ee0b83ce..6960004fdc94 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -14501,6 +14501,9 @@ static void intel_setup_outputs(struct drm_i915_private *dev_priv)
>  
>  		if (IS_G4X(dev_priv) && (I915_READ(DP_D) & DP_DETECTED))
>  			intel_dp_init(dev_priv, DP_D, PORT_D);
> +
> +		if (SUPPORTS_TV(dev_priv))
> +			intel_tv_init(dev_priv);

Since PNV was split into its own thing I think this could actually
be replaced with IS_MOBILE().

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

>  	} else if (IS_GEN(dev_priv, 2)) {
>  		if (IS_MOBILE(dev_priv) && !IS_I830(dev_priv))
>  			intel_lvds_init(dev_priv);
> @@ -14511,9 +14514,6 @@ static void intel_setup_outputs(struct drm_i915_private *dev_priv)
>  		intel_dvo_init(dev_priv);
>  	}
>  
> -	if (SUPPORTS_TV(dev_priv))
> -		intel_tv_init(dev_priv);
> -
>  	intel_psr_init(dev_priv);
>  
>  	for_each_intel_encoder(&dev_priv->drm, encoder) {
> -- 
> 2.20.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Jani Nikula Jan. 22, 2019, 8:25 a.m. UTC | #2
On Mon, 21 Jan 2019, Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:
> On Mon, Jan 21, 2019 at 04:21:33PM +0200, Jani Nikula wrote:
>> With most platforms not having TV support, only call intel_tv_init() on
>> platforms that might actually have TV, specifically gens 3 and 4.
>> 
>> This puts intel_tv_init() more in line with the rest of the outputs, and
>> makes it slightly easier for the uninitiated to figure out which
>> platforms actually have what.
>> 
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>> ---
>>  drivers/gpu/drm/i915/intel_display.c | 6 +++---
>>  1 file changed, 3 insertions(+), 3 deletions(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
>> index 4207ee0b83ce..6960004fdc94 100644
>> --- a/drivers/gpu/drm/i915/intel_display.c
>> +++ b/drivers/gpu/drm/i915/intel_display.c
>> @@ -14501,6 +14501,9 @@ static void intel_setup_outputs(struct drm_i915_private *dev_priv)
>>  
>>  		if (IS_G4X(dev_priv) && (I915_READ(DP_D) & DP_DETECTED))
>>  			intel_dp_init(dev_priv, DP_D, PORT_D);
>> +
>> +		if (SUPPORTS_TV(dev_priv))
>> +			intel_tv_init(dev_priv);
>
> Since PNV was split into its own thing I think this could actually
> be replaced with IS_MOBILE().

If I'd been able to get rid of SUPPORTS_TV() with that altogether, I
probably would've made the change. But there's still a user in CRC code,
so I left this as-is.

BR,
Jani.


>
> Either way
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
>>  	} else if (IS_GEN(dev_priv, 2)) {
>>  		if (IS_MOBILE(dev_priv) && !IS_I830(dev_priv))
>>  			intel_lvds_init(dev_priv);
>> @@ -14511,9 +14514,6 @@ static void intel_setup_outputs(struct drm_i915_private *dev_priv)
>>  		intel_dvo_init(dev_priv);
>>  	}
>>  
>> -	if (SUPPORTS_TV(dev_priv))
>> -		intel_tv_init(dev_priv);
>> -
>>  	intel_psr_init(dev_priv);
>>  
>>  	for_each_intel_encoder(&dev_priv->drm, encoder) {
>> -- 
>> 2.20.1
>> 
>> _______________________________________________
>> Intel-gfx mailing list
>> Intel-gfx@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 4207ee0b83ce..6960004fdc94 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -14501,6 +14501,9 @@  static void intel_setup_outputs(struct drm_i915_private *dev_priv)
 
 		if (IS_G4X(dev_priv) && (I915_READ(DP_D) & DP_DETECTED))
 			intel_dp_init(dev_priv, DP_D, PORT_D);
+
+		if (SUPPORTS_TV(dev_priv))
+			intel_tv_init(dev_priv);
 	} else if (IS_GEN(dev_priv, 2)) {
 		if (IS_MOBILE(dev_priv) && !IS_I830(dev_priv))
 			intel_lvds_init(dev_priv);
@@ -14511,9 +14514,6 @@  static void intel_setup_outputs(struct drm_i915_private *dev_priv)
 		intel_dvo_init(dev_priv);
 	}
 
-	if (SUPPORTS_TV(dev_priv))
-		intel_tv_init(dev_priv);
-
 	intel_psr_init(dev_priv);
 
 	for_each_intel_encoder(&dev_priv->drm, encoder) {