Commit 71643600 authored by Rob Clark's avatar Rob Clark

drm/msm/adreno: Fix warn splat for devices without revn

Recently, a WARN_ON() was introduced to ensure that revn is filled before
adreno_is_aXYZ is called. This however doesn't work very well when revn is
0 by design (such as for A635).

Cc: Konrad Dybcio <konrad.dybcio@linaro.org>
Fixes: cc943f43 ("drm/msm/adreno: warn if chip revn is verified before being set")
Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
Reviewed-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Tested-by: Abhinav Kumar <quic_abhinavk@quicinc.com> # sc7280
Patchwork: https://patchwork.freedesktop.org/patch/545554/
parent 97368254
......@@ -149,7 +149,8 @@ bool adreno_cmp_rev(struct adreno_rev rev1, struct adreno_rev rev2);
static inline bool adreno_is_revn(const struct adreno_gpu *gpu, uint32_t revn)
{
WARN_ON_ONCE(!gpu->revn);
/* revn can be zero, but if not is set at same time as info */
WARN_ON_ONCE(!gpu->info);
return gpu->revn == revn;
}
......@@ -161,14 +162,16 @@ static inline bool adreno_has_gmu_wrapper(const struct adreno_gpu *gpu)
static inline bool adreno_is_a2xx(const struct adreno_gpu *gpu)
{
WARN_ON_ONCE(!gpu->revn);
/* revn can be zero, but if not is set at same time as info */
WARN_ON_ONCE(!gpu->info);
return (gpu->revn < 300);
}
static inline bool adreno_is_a20x(const struct adreno_gpu *gpu)
{
WARN_ON_ONCE(!gpu->revn);
/* revn can be zero, but if not is set at same time as info */
WARN_ON_ONCE(!gpu->info);
return (gpu->revn < 210);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment