summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/msm/adreno/adreno_gpu.c
diff options
context:
space:
mode:
authorJordan Crouse <jcrouse@codeaurora.org>2020-09-14 16:40:21 -0600
committerRob Clark <robdclark@chromium.org>2020-09-15 10:47:44 -0700
commit8907afb476ac6754a4d1ba8d2dd16dbb0fd4d428 (patch)
tree83fcdc3ffc6d3bc760a6b5a607f12b5ab605275f /drivers/gpu/drm/msm/adreno/adreno_gpu.c
parent25faf2f2e06565d5cd0b97f77364fbe38f14ef71 (diff)
downloadlinux-8907afb476ac6754a4d1ba8d2dd16dbb0fd4d428.tar.bz2
drm/msm: Allow a5xx to mark the RPTR shadow as privileged
Newer microcode versions have support for the CP_WHERE_AM_I opcode which allows the RPTR shadow memory to be marked as privileged to protect it from corruption. Move the RPTR shadow into its own buffer and protect it it if the current microcode version supports the new feature. We can also re-enable preemption for those targets that support CP_WHERE_AM_I. Start out by preemptively assuming that we can enable preemption and disable it in a5xx_hw_init if the microcode version comes back as too old. Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org> Signed-off-by: Rob Clark <robdclark@chromium.org>
Diffstat (limited to 'drivers/gpu/drm/msm/adreno/adreno_gpu.c')
-rw-r--r--drivers/gpu/drm/msm/adreno/adreno_gpu.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
index a833dd0ab751..11635e39ca19 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
@@ -422,6 +422,11 @@ int adreno_hw_init(struct msm_gpu *gpu)
static uint32_t get_rptr(struct adreno_gpu *adreno_gpu,
struct msm_ringbuffer *ring)
{
+ struct msm_gpu *gpu = &adreno_gpu->base;
+
+ if (gpu->funcs->get_rptr)
+ return gpu->funcs->get_rptr(gpu, ring);
+
return ring->memptrs->rptr = adreno_gpu_read(
adreno_gpu, REG_ADRENO_CP_RB_RPTR);
}