[Intel-gfx] [PATCH] drm/i915/mtl: Use int for entry setup frames

Andrzej Hajda andrzej.hajda at intel.com
Tue Nov 14 10:22:09 UTC 2023


On 13.11.2023 10:37, Mika Kahola wrote:
> At least one TGL had regression when using u8 types
> for entry setup frames calculation. So, let's switch
> to use ints instead.

This explanation is missing the most important part - why int?

I guess it is because intel_psr_entry_setup_frames can return -ETIME, 
which converted to u8 and then int becomes not what we would expect.
And fixes tag is missing.

Regards
Andrzej

> 
> Signed-off-by: Mika Kahola <mika.kahola at intel.com>
> ---
>   drivers/gpu/drm/i915/display/intel_psr.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c
> index 3691f882e1c0..a4417e85f92a 100644
> --- a/drivers/gpu/drm/i915/display/intel_psr.c
> +++ b/drivers/gpu/drm/i915/display/intel_psr.c
> @@ -1093,12 +1093,12 @@ static bool _compute_psr2_wake_times(struct intel_dp *intel_dp,
>   	return true;
>   }
>   
> -static u8 intel_psr_entry_setup_frames(struct intel_dp *intel_dp,
> -				       const struct drm_display_mode *adjusted_mode)
> +static int intel_psr_entry_setup_frames(struct intel_dp *intel_dp,
> +					const struct drm_display_mode *adjusted_mode)
>   {
>   	struct drm_i915_private *i915 = dp_to_i915(intel_dp);
>   	int psr_setup_time = drm_dp_psr_setup_time(intel_dp->psr_dpcd);
> -	u8 entry_setup_frames = 0;
> +	int entry_setup_frames = 0;
>   
>   	if (psr_setup_time < 0) {
>   		drm_dbg_kms(&i915->drm,



More information about the Intel-gfx mailing list