Re: [PATCH 03/12] drm/msm/adreno: Remove redundant revn param

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6.07.2023 23:10, Rob Clark wrote:
> From: Rob Clark <robdclark@xxxxxxxxxxxx>
> 
> This just duplicates what is in adreno_info, and can cause confusion if
> used before it is set.
> 
> Signed-off-by: Rob Clark <robdclark@xxxxxxxxxxxx>
> ---
[...]

> -	return gpu->revn == revn;
> +	if (WARN_ON_ONCE(!gpu->info))
> +		return false;
I'm unsure about changing this behavior. Especially in a6xx code,
where these calls may guard things like SMMU behavior (the LLCC-SMMU
programming dance is unconditional if adreno_is_a7xx)

Though if gpu->info is missing, it's a lost cause anwyways..

So I guess this is really the least bad thing to do

Reviewed-by: Konrad Dybcio <konrad.dybcio@xxxxxxxxxx>

Konrad
> +	return gpu->info->revn == revn;
>  }
>  
>  static inline bool adreno_has_gmu_wrapper(const struct adreno_gpu *gpu)
> @@ -160,18 +158,16 @@ static inline bool adreno_has_gmu_wrapper(const struct adreno_gpu *gpu)
>  
>  static inline bool adreno_is_a2xx(const struct adreno_gpu *gpu)
>  {
> -	/* revn can be zero, but if not is set at same time as info */
> -	WARN_ON_ONCE(!gpu->info);
> -
> -	return (gpu->revn < 300);
> +	if (WARN_ON_ONCE(!gpu->info))
> +		return false;
> +	return (gpu->info->revn < 300);
>  }
>  
>  static inline bool adreno_is_a20x(const struct adreno_gpu *gpu)
>  {
> -	/* revn can be zero, but if not is set at same time as info */
> -	WARN_ON_ONCE(!gpu->info);
> -
> -	return (gpu->revn < 210);
> +	if (WARN_ON_ONCE(!gpu->info))
> +		return false;
> +	return (gpu->info->revn < 210);
>  }
>  
>  static inline bool adreno_is_a225(const struct adreno_gpu *gpu)



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [Linux for Sparc]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux