aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Clark <robdclark@chromium.org>2020-08-17 09:23:09 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-09-17 13:47:56 +0200
commit8cbe9b765487ef1b3f9ea37a768d4907ca577b56 (patch)
tree889ee69315b634d6b8c846b9a14aa6b372bb3a80
parentebd9aff7b62ad70fa06ca0cb468a178f6c057fe4 (diff)
downloadlinux-yocto-8cbe9b765487ef1b3f9ea37a768d4907ca577b56.tar.gz
linux-yocto-8cbe9b765487ef1b3f9ea37a768d4907ca577b56.tar.bz2
linux-yocto-8cbe9b765487ef1b3f9ea37a768d4907ca577b56.zip
drm/msm/gpu: make ringbuffer readonly
[ Upstream commit 352c83fb39cae3eff95a8e1ed23006291abb6196 ] The GPU has no business writing into the ringbuffer, let's make it readonly to the GPU. Fixes: 7198e6b03155 ("drm/msm: add a3xx gpu support") Signed-off-by: Rob Clark <robdclark@chromium.org> Reviewed-by: Jordan Crouse <jcrouse@codeaurora.org> Signed-off-by: Rob Clark <robdclark@chromium.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/gpu/drm/msm/msm_ringbuffer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/msm/msm_ringbuffer.c b/drivers/gpu/drm/msm/msm_ringbuffer.c
index e397c44cc011..39ecb5a18431 100644
--- a/drivers/gpu/drm/msm/msm_ringbuffer.c
+++ b/drivers/gpu/drm/msm/msm_ringbuffer.c
@@ -27,7 +27,8 @@ struct msm_ringbuffer *msm_ringbuffer_new(struct msm_gpu *gpu, int id,
ring->id = id;
ring->start = msm_gem_kernel_new(gpu->dev, MSM_GPU_RINGBUFFER_SZ,
- MSM_BO_WC, gpu->aspace, &ring->bo, &ring->iova);
+ MSM_BO_WC | MSM_BO_GPU_READONLY, gpu->aspace, &ring->bo,
+ &ring->iova);
if (IS_ERR(ring->start)) {
ret = PTR_ERR(ring->start);