[PATCH 03/12] drm/msm/adreno: Remove redundant revn param
Konrad Dybcio
konrad.dybcio at linaro.org
Thu Jul 6 23:26:14 UTC 2023
On 6.07.2023 23:10, Rob Clark wrote:
> From: Rob Clark <robdclark at chromium.org>
>
> This just duplicates what is in adreno_info, and can cause confusion if
> used before it is set.
>
> Signed-off-by: Rob Clark <robdclark at chromium.org>
> ---
[...]
> - 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 at linaro.org>
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)
More information about the dri-devel
mailing list