Skip to content

Commit 7164360

Browse files
committed
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 <[email protected]> Fixes: cc943f4 ("drm/msm/adreno: warn if chip revn is verified before being set") Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Tested-by: Abhinav Kumar <[email protected]> # sc7280 Patchwork: https://patchwork.freedesktop.org/patch/545554/
1 parent 9736825 commit 7164360

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

drivers/gpu/drm/msm/adreno/adreno_gpu.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,8 @@ bool adreno_cmp_rev(struct adreno_rev rev1, struct adreno_rev rev2);
149149

150150
static inline bool adreno_is_revn(const struct adreno_gpu *gpu, uint32_t revn)
151151
{
152-
WARN_ON_ONCE(!gpu->revn);
152+
/* revn can be zero, but if not is set at same time as info */
153+
WARN_ON_ONCE(!gpu->info);
153154

154155
return gpu->revn == revn;
155156
}
@@ -161,14 +162,16 @@ static inline bool adreno_has_gmu_wrapper(const struct adreno_gpu *gpu)
161162

162163
static inline bool adreno_is_a2xx(const struct adreno_gpu *gpu)
163164
{
164-
WARN_ON_ONCE(!gpu->revn);
165+
/* revn can be zero, but if not is set at same time as info */
166+
WARN_ON_ONCE(!gpu->info);
165167

166168
return (gpu->revn < 300);
167169
}
168170

169171
static inline bool adreno_is_a20x(const struct adreno_gpu *gpu)
170172
{
171-
WARN_ON_ONCE(!gpu->revn);
173+
/* revn can be zero, but if not is set at same time as info */
174+
WARN_ON_ONCE(!gpu->info);
172175

173176
return (gpu->revn < 210);
174177
}

0 commit comments

Comments
 (0)