diff mbox

[1/2] drm/i915/dsi: abstract get pclk platform differences

Message ID 1452249940-2605-1-git-send-email-jani.nikula@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jani Nikula Jan. 8, 2016, 10:45 a.m. UTC
Hide away the platform differences in intel_dsi_get_pckl() within
intel_dsi_pll.c. No functional changes.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/intel_dsi.c     |  9 ++-------
 drivers/gpu/drm/i915/intel_dsi.h     |  3 +--
 drivers/gpu/drm/i915/intel_dsi_pll.c | 12 ++++++++++--
 3 files changed, 13 insertions(+), 11 deletions(-)

Comments

Ville Syrjälä Jan. 8, 2016, 11:05 a.m. UTC | #1
On Fri, Jan 08, 2016 at 12:45:39PM +0200, Jani Nikula wrote:
> Hide away the platform differences in intel_dsi_get_pckl() within
> intel_dsi_pll.c. No functional changes.
> 
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>

For the series
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

> ---
>  drivers/gpu/drm/i915/intel_dsi.c     |  9 ++-------
>  drivers/gpu/drm/i915/intel_dsi.h     |  3 +--
>  drivers/gpu/drm/i915/intel_dsi_pll.c | 12 ++++++++++--
>  3 files changed, 13 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
> index 44742fa2f616..91cef3525c93 100644
> --- a/drivers/gpu/drm/i915/intel_dsi.c
> +++ b/drivers/gpu/drm/i915/intel_dsi.c
> @@ -702,7 +702,7 @@ static bool intel_dsi_get_hw_state(struct intel_encoder *encoder,
>  static void intel_dsi_get_config(struct intel_encoder *encoder,
>  				 struct intel_crtc_state *pipe_config)
>  {
> -	u32 pclk = 0;
> +	u32 pclk;
>  	DRM_DEBUG_KMS("\n");
>  
>  	pipe_config->has_dsi_encoder = true;
> @@ -713,12 +713,7 @@ static void intel_dsi_get_config(struct intel_encoder *encoder,
>  	 */
>  	pipe_config->dpll_hw_state.dpll_md = 0;
>  
> -	if (IS_BROXTON(encoder->base.dev))
> -		pclk = bxt_get_dsi_pclk(encoder, pipe_config->pipe_bpp);
> -	else if (IS_VALLEYVIEW(encoder->base.dev) ||
> -		 IS_CHERRYVIEW(encoder->base.dev))
> -		pclk = vlv_get_dsi_pclk(encoder, pipe_config->pipe_bpp);
> -
> +	pclk = intel_dsi_get_pclk(encoder, pipe_config->pipe_bpp);
>  	if (!pclk)
>  		return;
>  
> diff --git a/drivers/gpu/drm/i915/intel_dsi.h b/drivers/gpu/drm/i915/intel_dsi.h
> index 02551ff228c2..de7be7f3fb42 100644
> --- a/drivers/gpu/drm/i915/intel_dsi.h
> +++ b/drivers/gpu/drm/i915/intel_dsi.h
> @@ -126,8 +126,7 @@ static inline struct intel_dsi *enc_to_intel_dsi(struct drm_encoder *encoder)
>  
>  extern void intel_enable_dsi_pll(struct intel_encoder *encoder);
>  extern void intel_disable_dsi_pll(struct intel_encoder *encoder);
> -extern u32 vlv_get_dsi_pclk(struct intel_encoder *encoder, int pipe_bpp);
> -extern u32 bxt_get_dsi_pclk(struct intel_encoder *encoder, int pipe_bpp);
> +extern u32 intel_dsi_get_pclk(struct intel_encoder *encoder, int pipe_bpp);
>  extern void intel_dsi_reset_clocks(struct intel_encoder *encoder,
>  							enum port port);
>  
> diff --git a/drivers/gpu/drm/i915/intel_dsi_pll.c b/drivers/gpu/drm/i915/intel_dsi_pll.c
> index fbd2b51810ca..4c5bb7dd95a2 100644
> --- a/drivers/gpu/drm/i915/intel_dsi_pll.c
> +++ b/drivers/gpu/drm/i915/intel_dsi_pll.c
> @@ -322,7 +322,7 @@ static void assert_bpp_mismatch(int pixel_format, int pipe_bpp)
>  	     bpp, pipe_bpp);
>  }
>  
> -u32 vlv_get_dsi_pclk(struct intel_encoder *encoder, int pipe_bpp)
> +static u32 vlv_dsi_get_pclk(struct intel_encoder *encoder, int pipe_bpp)
>  {
>  	struct drm_i915_private *dev_priv = encoder->base.dev->dev_private;
>  	struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base);
> @@ -384,7 +384,7 @@ u32 vlv_get_dsi_pclk(struct intel_encoder *encoder, int pipe_bpp)
>  	return pclk;
>  }
>  
> -u32 bxt_get_dsi_pclk(struct intel_encoder *encoder, int pipe_bpp)
> +static u32 bxt_dsi_get_pclk(struct intel_encoder *encoder, int pipe_bpp)
>  {
>  	u32 pclk;
>  	u32 dsi_clk;
> @@ -419,6 +419,14 @@ u32 bxt_get_dsi_pclk(struct intel_encoder *encoder, int pipe_bpp)
>  	return pclk;
>  }
>  
> +u32 intel_dsi_get_pclk(struct intel_encoder *encoder, int pipe_bpp)
> +{
> +	if (IS_BROXTON(encoder->base.dev))
> +		return bxt_dsi_get_pclk(encoder, pipe_bpp);
> +	else
> +		return vlv_dsi_get_pclk(encoder, pipe_bpp);
> +}
> +
>  static void vlv_dsi_reset_clocks(struct intel_encoder *encoder, enum port port)
>  {
>  	u32 temp;
> -- 
> 2.1.4
Jani Nikula Jan. 8, 2016, 11:32 a.m. UTC | #2
On Fri, 08 Jan 2016, Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:
> On Fri, Jan 08, 2016 at 12:45:39PM +0200, Jani Nikula wrote:
>> Hide away the platform differences in intel_dsi_get_pckl() within
>> intel_dsi_pll.c. No functional changes.
>> 
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>
> For the series
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Pushed to drm-intel-next-queued, thanks for the review.

BR,
Jani.


>
>> ---
>>  drivers/gpu/drm/i915/intel_dsi.c     |  9 ++-------
>>  drivers/gpu/drm/i915/intel_dsi.h     |  3 +--
>>  drivers/gpu/drm/i915/intel_dsi_pll.c | 12 ++++++++++--
>>  3 files changed, 13 insertions(+), 11 deletions(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
>> index 44742fa2f616..91cef3525c93 100644
>> --- a/drivers/gpu/drm/i915/intel_dsi.c
>> +++ b/drivers/gpu/drm/i915/intel_dsi.c
>> @@ -702,7 +702,7 @@ static bool intel_dsi_get_hw_state(struct intel_encoder *encoder,
>>  static void intel_dsi_get_config(struct intel_encoder *encoder,
>>  				 struct intel_crtc_state *pipe_config)
>>  {
>> -	u32 pclk = 0;
>> +	u32 pclk;
>>  	DRM_DEBUG_KMS("\n");
>>  
>>  	pipe_config->has_dsi_encoder = true;
>> @@ -713,12 +713,7 @@ static void intel_dsi_get_config(struct intel_encoder *encoder,
>>  	 */
>>  	pipe_config->dpll_hw_state.dpll_md = 0;
>>  
>> -	if (IS_BROXTON(encoder->base.dev))
>> -		pclk = bxt_get_dsi_pclk(encoder, pipe_config->pipe_bpp);
>> -	else if (IS_VALLEYVIEW(encoder->base.dev) ||
>> -		 IS_CHERRYVIEW(encoder->base.dev))
>> -		pclk = vlv_get_dsi_pclk(encoder, pipe_config->pipe_bpp);
>> -
>> +	pclk = intel_dsi_get_pclk(encoder, pipe_config->pipe_bpp);
>>  	if (!pclk)
>>  		return;
>>  
>> diff --git a/drivers/gpu/drm/i915/intel_dsi.h b/drivers/gpu/drm/i915/intel_dsi.h
>> index 02551ff228c2..de7be7f3fb42 100644
>> --- a/drivers/gpu/drm/i915/intel_dsi.h
>> +++ b/drivers/gpu/drm/i915/intel_dsi.h
>> @@ -126,8 +126,7 @@ static inline struct intel_dsi *enc_to_intel_dsi(struct drm_encoder *encoder)
>>  
>>  extern void intel_enable_dsi_pll(struct intel_encoder *encoder);
>>  extern void intel_disable_dsi_pll(struct intel_encoder *encoder);
>> -extern u32 vlv_get_dsi_pclk(struct intel_encoder *encoder, int pipe_bpp);
>> -extern u32 bxt_get_dsi_pclk(struct intel_encoder *encoder, int pipe_bpp);
>> +extern u32 intel_dsi_get_pclk(struct intel_encoder *encoder, int pipe_bpp);
>>  extern void intel_dsi_reset_clocks(struct intel_encoder *encoder,
>>  							enum port port);
>>  
>> diff --git a/drivers/gpu/drm/i915/intel_dsi_pll.c b/drivers/gpu/drm/i915/intel_dsi_pll.c
>> index fbd2b51810ca..4c5bb7dd95a2 100644
>> --- a/drivers/gpu/drm/i915/intel_dsi_pll.c
>> +++ b/drivers/gpu/drm/i915/intel_dsi_pll.c
>> @@ -322,7 +322,7 @@ static void assert_bpp_mismatch(int pixel_format, int pipe_bpp)
>>  	     bpp, pipe_bpp);
>>  }
>>  
>> -u32 vlv_get_dsi_pclk(struct intel_encoder *encoder, int pipe_bpp)
>> +static u32 vlv_dsi_get_pclk(struct intel_encoder *encoder, int pipe_bpp)
>>  {
>>  	struct drm_i915_private *dev_priv = encoder->base.dev->dev_private;
>>  	struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base);
>> @@ -384,7 +384,7 @@ u32 vlv_get_dsi_pclk(struct intel_encoder *encoder, int pipe_bpp)
>>  	return pclk;
>>  }
>>  
>> -u32 bxt_get_dsi_pclk(struct intel_encoder *encoder, int pipe_bpp)
>> +static u32 bxt_dsi_get_pclk(struct intel_encoder *encoder, int pipe_bpp)
>>  {
>>  	u32 pclk;
>>  	u32 dsi_clk;
>> @@ -419,6 +419,14 @@ u32 bxt_get_dsi_pclk(struct intel_encoder *encoder, int pipe_bpp)
>>  	return pclk;
>>  }
>>  
>> +u32 intel_dsi_get_pclk(struct intel_encoder *encoder, int pipe_bpp)
>> +{
>> +	if (IS_BROXTON(encoder->base.dev))
>> +		return bxt_dsi_get_pclk(encoder, pipe_bpp);
>> +	else
>> +		return vlv_dsi_get_pclk(encoder, pipe_bpp);
>> +}
>> +
>>  static void vlv_dsi_reset_clocks(struct intel_encoder *encoder, enum port port)
>>  {
>>  	u32 temp;
>> -- 
>> 2.1.4
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
index 44742fa2f616..91cef3525c93 100644
--- a/drivers/gpu/drm/i915/intel_dsi.c
+++ b/drivers/gpu/drm/i915/intel_dsi.c
@@ -702,7 +702,7 @@  static bool intel_dsi_get_hw_state(struct intel_encoder *encoder,
 static void intel_dsi_get_config(struct intel_encoder *encoder,
 				 struct intel_crtc_state *pipe_config)
 {
-	u32 pclk = 0;
+	u32 pclk;
 	DRM_DEBUG_KMS("\n");
 
 	pipe_config->has_dsi_encoder = true;
@@ -713,12 +713,7 @@  static void intel_dsi_get_config(struct intel_encoder *encoder,
 	 */
 	pipe_config->dpll_hw_state.dpll_md = 0;
 
-	if (IS_BROXTON(encoder->base.dev))
-		pclk = bxt_get_dsi_pclk(encoder, pipe_config->pipe_bpp);
-	else if (IS_VALLEYVIEW(encoder->base.dev) ||
-		 IS_CHERRYVIEW(encoder->base.dev))
-		pclk = vlv_get_dsi_pclk(encoder, pipe_config->pipe_bpp);
-
+	pclk = intel_dsi_get_pclk(encoder, pipe_config->pipe_bpp);
 	if (!pclk)
 		return;
 
diff --git a/drivers/gpu/drm/i915/intel_dsi.h b/drivers/gpu/drm/i915/intel_dsi.h
index 02551ff228c2..de7be7f3fb42 100644
--- a/drivers/gpu/drm/i915/intel_dsi.h
+++ b/drivers/gpu/drm/i915/intel_dsi.h
@@ -126,8 +126,7 @@  static inline struct intel_dsi *enc_to_intel_dsi(struct drm_encoder *encoder)
 
 extern void intel_enable_dsi_pll(struct intel_encoder *encoder);
 extern void intel_disable_dsi_pll(struct intel_encoder *encoder);
-extern u32 vlv_get_dsi_pclk(struct intel_encoder *encoder, int pipe_bpp);
-extern u32 bxt_get_dsi_pclk(struct intel_encoder *encoder, int pipe_bpp);
+extern u32 intel_dsi_get_pclk(struct intel_encoder *encoder, int pipe_bpp);
 extern void intel_dsi_reset_clocks(struct intel_encoder *encoder,
 							enum port port);
 
diff --git a/drivers/gpu/drm/i915/intel_dsi_pll.c b/drivers/gpu/drm/i915/intel_dsi_pll.c
index fbd2b51810ca..4c5bb7dd95a2 100644
--- a/drivers/gpu/drm/i915/intel_dsi_pll.c
+++ b/drivers/gpu/drm/i915/intel_dsi_pll.c
@@ -322,7 +322,7 @@  static void assert_bpp_mismatch(int pixel_format, int pipe_bpp)
 	     bpp, pipe_bpp);
 }
 
-u32 vlv_get_dsi_pclk(struct intel_encoder *encoder, int pipe_bpp)
+static u32 vlv_dsi_get_pclk(struct intel_encoder *encoder, int pipe_bpp)
 {
 	struct drm_i915_private *dev_priv = encoder->base.dev->dev_private;
 	struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base);
@@ -384,7 +384,7 @@  u32 vlv_get_dsi_pclk(struct intel_encoder *encoder, int pipe_bpp)
 	return pclk;
 }
 
-u32 bxt_get_dsi_pclk(struct intel_encoder *encoder, int pipe_bpp)
+static u32 bxt_dsi_get_pclk(struct intel_encoder *encoder, int pipe_bpp)
 {
 	u32 pclk;
 	u32 dsi_clk;
@@ -419,6 +419,14 @@  u32 bxt_get_dsi_pclk(struct intel_encoder *encoder, int pipe_bpp)
 	return pclk;
 }
 
+u32 intel_dsi_get_pclk(struct intel_encoder *encoder, int pipe_bpp)
+{
+	if (IS_BROXTON(encoder->base.dev))
+		return bxt_dsi_get_pclk(encoder, pipe_bpp);
+	else
+		return vlv_dsi_get_pclk(encoder, pipe_bpp);
+}
+
 static void vlv_dsi_reset_clocks(struct intel_encoder *encoder, enum port port)
 {
 	u32 temp;