drm/msm: Mark the microcode buffers as read-only

The PFP/ME and GPMU memory needs to be GPU accessible but it
does not need to be written by the GPU. Mark them as read-only
to avoid corruption.

Change-Id: Ic0dedbadc848f0a6693a4e57567077bbab38e9a5
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
This commit is contained in:
Jordan Crouse 2017-02-13 10:14:34 -07:00
parent e5de360e6f
commit 97c202c6d7
2 changed files with 4 additions and 2 deletions

View file

@ -410,7 +410,8 @@ static struct drm_gem_object *a5xx_ucode_load_bo(struct msm_gpu *gpu,
void *ptr; void *ptr;
mutex_lock(&drm->struct_mutex); mutex_lock(&drm->struct_mutex);
bo = msm_gem_new(drm, fw->size - 4, MSM_BO_UNCACHED); bo = msm_gem_new(drm, fw->size - 4,
MSM_BO_UNCACHED | MSM_BO_GPU_READONLY);
mutex_unlock(&drm->struct_mutex); mutex_unlock(&drm->struct_mutex);
if (IS_ERR(bo)) if (IS_ERR(bo))

View file

@ -459,7 +459,8 @@ void a5xx_gpmu_ucode_init(struct msm_gpu *gpu)
bosize = (cmds_size + (cmds_size / TYPE4_MAX_PAYLOAD) + 1) << 2; bosize = (cmds_size + (cmds_size / TYPE4_MAX_PAYLOAD) + 1) << 2;
mutex_lock(&drm->struct_mutex); mutex_lock(&drm->struct_mutex);
a5xx_gpu->gpmu_bo = msm_gem_new(drm, bosize, MSM_BO_UNCACHED); a5xx_gpu->gpmu_bo = msm_gem_new(drm, bosize,
MSM_BO_UNCACHED | MSM_BO_GPU_READONLY);
mutex_unlock(&drm->struct_mutex); mutex_unlock(&drm->struct_mutex);
if (IS_ERR(a5xx_gpu->gpmu_bo)) if (IS_ERR(a5xx_gpu->gpmu_bo))