diff mbox

[4/6] drm/i915/psr: Avoid unnecessary DPCD read of DP_PSR_CAPS

Message ID 20180511195145.3829-4-dhinakaran.pandiyan@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Dhinakaran Pandiyan May 11, 2018, 7:51 p.m. UTC
intel_dp->psr_dpcd already has the required values.

Cc: Jose Roberto de Souza <jose.souza@intel.com>
Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
---
 drivers/gpu/drm/i915/intel_psr.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

Comments

Tarun Vyas May 20, 2018, 11:01 p.m. UTC | #1
On Fri, May 11, 2018 at 12:51:43PM -0700, Dhinakaran Pandiyan wrote:
> intel_dp->psr_dpcd already has the required values.
> 
> Cc: Jose Roberto de Souza <jose.souza@intel.com>
> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_psr.c | 11 +----------
>  1 file changed, 1 insertion(+), 10 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_psr.c b/drivers/gpu/drm/i915/intel_psr.c
> index 61ade81576f5..381dbdbf30f4 100644
> --- a/drivers/gpu/drm/i915/intel_psr.c
> +++ b/drivers/gpu/drm/i915/intel_psr.c
> @@ -201,15 +201,6 @@ void intel_psr_irq_handler(struct drm_i915_private *dev_priv, u32 psr_iir)
>  	}
>  }
>  
> -static bool intel_dp_get_y_coord_required(struct intel_dp *intel_dp)
> -{
> -	uint8_t psr_caps = 0;
> -
> -	if (drm_dp_dpcd_readb(&intel_dp->aux, DP_PSR_CAPS, &psr_caps) != 1)
> -		return false;
> -	return psr_caps & DP_PSR2_SU_Y_COORDINATE_REQUIRED;
> -}
> -
>  static bool intel_dp_get_colorimetry_status(struct intel_dp *intel_dp)
>  {
>  	uint8_t dprx = 0;
> @@ -275,7 +266,7 @@ void intel_psr_init_dpcd(struct intel_dp *intel_dp)
>  		 * GTC first.
>  		 */
>  		dev_priv->psr.sink_psr2_support =
> -				intel_dp_get_y_coord_required(intel_dp);
> +			intel_dp->psr_dpcd[1] & DP_PSR2_SU_Y_COORDINATE_REQUIRED;
>  		DRM_DEBUG_KMS("PSR2 %ssupported\n",
>  			      dev_priv->psr.sink_psr2_support ? "" : "not ");
The drm_dp_dpcd_read itself reads the first 2 PSR DPCD bytes which is what is needed. Also, no other callers of intel_dp_get_y_coord_required exist. So,

Reviewed-by: Tarun Vyas <tarun.vyas@intel.com>
>  
> -- 
> 2.14.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
vathsala nagaraju May 22, 2018, 12:32 p.m. UTC | #2
On 5/12/2018 1:21 AM, Dhinakaran Pandiyan wrote:
> intel_dp->psr_dpcd already has the required values.
>
> Cc: Jose Roberto de Souza <jose.souza@intel.com>
> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> ---
>   drivers/gpu/drm/i915/intel_psr.c | 11 +----------
>   1 file changed, 1 insertion(+), 10 deletions(-)
Reviewed-by: Vathsala Nagaraju <vathsala.nagaraju@intel.com>
> diff --git a/drivers/gpu/drm/i915/intel_psr.c b/drivers/gpu/drm/i915/intel_psr.c
> index 61ade81576f5..381dbdbf30f4 100644
> --- a/drivers/gpu/drm/i915/intel_psr.c
> +++ b/drivers/gpu/drm/i915/intel_psr.c
> @@ -201,15 +201,6 @@ void intel_psr_irq_handler(struct drm_i915_private *dev_priv, u32 psr_iir)
>   	}
>   }
>   
> -static bool intel_dp_get_y_coord_required(struct intel_dp *intel_dp)
> -{
> -	uint8_t psr_caps = 0;
> -
> -	if (drm_dp_dpcd_readb(&intel_dp->aux, DP_PSR_CAPS, &psr_caps) != 1)
> -		return false;
> -	return psr_caps & DP_PSR2_SU_Y_COORDINATE_REQUIRED;
> -}
> -
>   static bool intel_dp_get_colorimetry_status(struct intel_dp *intel_dp)
>   {
>   	uint8_t dprx = 0;
> @@ -275,7 +266,7 @@ void intel_psr_init_dpcd(struct intel_dp *intel_dp)
>   		 * GTC first.
>   		 */
>   		dev_priv->psr.sink_psr2_support =
> -				intel_dp_get_y_coord_required(intel_dp);
> +			intel_dp->psr_dpcd[1] & DP_PSR2_SU_Y_COORDINATE_REQUIRED;
>   		DRM_DEBUG_KMS("PSR2 %ssupported\n",
>   			      dev_priv->psr.sink_psr2_support ? "" : "not ");
>
Jani Nikula May 24, 2018, 2:01 p.m. UTC | #3
On Sun, 20 May 2018, Tarun Vyas <tarun.vyas@intel.com> wrote:
> On Fri, May 11, 2018 at 12:51:43PM -0700, Dhinakaran Pandiyan wrote:
>> intel_dp->psr_dpcd already has the required values.
>> 
>> Cc: Jose Roberto de Souza <jose.souza@intel.com>
>> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
>> ---
>>  drivers/gpu/drm/i915/intel_psr.c | 11 +----------
>>  1 file changed, 1 insertion(+), 10 deletions(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/intel_psr.c b/drivers/gpu/drm/i915/intel_psr.c
>> index 61ade81576f5..381dbdbf30f4 100644
>> --- a/drivers/gpu/drm/i915/intel_psr.c
>> +++ b/drivers/gpu/drm/i915/intel_psr.c
>> @@ -201,15 +201,6 @@ void intel_psr_irq_handler(struct drm_i915_private *dev_priv, u32 psr_iir)
>>  	}
>>  }
>>  
>> -static bool intel_dp_get_y_coord_required(struct intel_dp *intel_dp)
>> -{
>> -	uint8_t psr_caps = 0;
>> -
>> -	if (drm_dp_dpcd_readb(&intel_dp->aux, DP_PSR_CAPS, &psr_caps) != 1)
>> -		return false;
>> -	return psr_caps & DP_PSR2_SU_Y_COORDINATE_REQUIRED;
>> -}
>> -
>>  static bool intel_dp_get_colorimetry_status(struct intel_dp *intel_dp)
>>  {
>>  	uint8_t dprx = 0;
>> @@ -275,7 +266,7 @@ void intel_psr_init_dpcd(struct intel_dp *intel_dp)
>>  		 * GTC first.
>>  		 */
>>  		dev_priv->psr.sink_psr2_support =
>> -				intel_dp_get_y_coord_required(intel_dp);
>> +			intel_dp->psr_dpcd[1] & DP_PSR2_SU_Y_COORDINATE_REQUIRED;
>>  		DRM_DEBUG_KMS("PSR2 %ssupported\n",
>>  			      dev_priv->psr.sink_psr2_support ? "" : "not ");
> The drm_dp_dpcd_read itself reads the first 2 PSR DPCD bytes which is what is needed. Also, no other callers of intel_dp_get_y_coord_required exist. So,
>
> Reviewed-by: Tarun Vyas <tarun.vyas@intel.com>

The rest of the patches in the series pushed to dinq as well, thanks for
the patches and review.

BR,
Jani.

>>  
>> -- 
>> 2.14.1
>> 
>> _______________________________________________
>> Intel-gfx mailing list
>> Intel-gfx@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_psr.c b/drivers/gpu/drm/i915/intel_psr.c
index 61ade81576f5..381dbdbf30f4 100644
--- a/drivers/gpu/drm/i915/intel_psr.c
+++ b/drivers/gpu/drm/i915/intel_psr.c
@@ -201,15 +201,6 @@  void intel_psr_irq_handler(struct drm_i915_private *dev_priv, u32 psr_iir)
 	}
 }
 
-static bool intel_dp_get_y_coord_required(struct intel_dp *intel_dp)
-{
-	uint8_t psr_caps = 0;
-
-	if (drm_dp_dpcd_readb(&intel_dp->aux, DP_PSR_CAPS, &psr_caps) != 1)
-		return false;
-	return psr_caps & DP_PSR2_SU_Y_COORDINATE_REQUIRED;
-}
-
 static bool intel_dp_get_colorimetry_status(struct intel_dp *intel_dp)
 {
 	uint8_t dprx = 0;
@@ -275,7 +266,7 @@  void intel_psr_init_dpcd(struct intel_dp *intel_dp)
 		 * GTC first.
 		 */
 		dev_priv->psr.sink_psr2_support =
-				intel_dp_get_y_coord_required(intel_dp);
+			intel_dp->psr_dpcd[1] & DP_PSR2_SU_Y_COORDINATE_REQUIRED;
 		DRM_DEBUG_KMS("PSR2 %ssupported\n",
 			      dev_priv->psr.sink_psr2_support ? "" : "not ");