Skip to content

Commit 29af760

Browse files
konradybciorobclark
authored andcommitted
drm/msm/a6xx: Skip empty protection ranges entries
Some specific SKUs leave certain protection range registers empty. Allow for that behavior. Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Patchwork: https://patchwork.freedesktop.org/patch/543334/ Signed-off-by: Rob Clark <robdclark@chromium.org>
1 parent 02a726f commit 29af760

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/gpu/drm/msm/adreno/a6xx_gpu.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -935,8 +935,11 @@ static void a6xx_set_cp_protect(struct msm_gpu *gpu)
935935
A6XX_CP_PROTECT_CNTL_ACCESS_FAULT_ON_VIOL_EN |
936936
A6XX_CP_PROTECT_CNTL_LAST_SPAN_INF_RANGE);
937937

938-
for (i = 0; i < count - 1; i++)
939-
gpu_write(gpu, REG_A6XX_CP_PROTECT(i), regs[i]);
938+
for (i = 0; i < count - 1; i++) {
939+
/* Intentionally skip writing to some registers */
940+
if (regs[i])
941+
gpu_write(gpu, REG_A6XX_CP_PROTECT(i), regs[i]);
942+
}
940943
/* last CP_PROTECT to have "infinite" length on the last entry */
941944
gpu_write(gpu, REG_A6XX_CP_PROTECT(count_max - 1), regs[i]);
942945
}

0 commit comments

Comments
 (0)