drm/msm: Allow a5xx to mark the RPTR shadow as privileged
authorJordan Crouse <jcrouse@codeaurora.org>
Mon, 14 Sep 2020 22:40:21 +0000 (16:40 -0600)
committerRob Clark <robdclark@chromium.org>
Tue, 15 Sep 2020 17:47:44 +0000 (10:47 -0700)
commit8907afb476ac6754a4d1ba8d2dd16dbb0fd4d428
tree83fcdc3ffc6d3bc760a6b5a607f12b5ab605275f
parent25faf2f2e06565d5cd0b97f77364fbe38f14ef71
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>
drivers/gpu/drm/msm/adreno/a5xx_gpu.c
drivers/gpu/drm/msm/adreno/a5xx_gpu.h
drivers/gpu/drm/msm/adreno/a5xx_power.c
drivers/gpu/drm/msm/adreno/a5xx_preempt.c
drivers/gpu/drm/msm/adreno/adreno_gpu.c
drivers/gpu/drm/msm/adreno/adreno_pm4.xml.h
drivers/gpu/drm/msm/msm_gpu.h