drm/msm: Separate locking of buffer resources from struct_mutex
Buffer object specific resources like pages, domains, sg list need not be protected with struct_mutex. They can be protected with a buffer object level lock. This simplifies locking and makes it easier to avoid potential recursive locking scenarios for SVM involving mmap_sem and struct_mutex. This also removes unnecessary serialization when creating buffer objects, and also between buffer object creation and GPU command submission. Signed-off-by: Sushmita Susheelendra <ssusheel@codeaurora.org> [robclark: squash in handling new locking for shrinker] Signed-off-by: Rob Clark <robdclark@gmail.com>
This commit is contained in:

committed by
Rob Clark

parent
816fa34c05
commit
0e08270a1f
@@ -497,7 +497,7 @@ void msm_gpu_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit,
|
||||
|
||||
/* submit takes a reference to the bo and iova until retired: */
|
||||
drm_gem_object_reference(&msm_obj->base);
|
||||
msm_gem_get_iova_locked(&msm_obj->base,
|
||||
msm_gem_get_iova(&msm_obj->base,
|
||||
submit->gpu->aspace, &iova);
|
||||
|
||||
if (submit->bos[i].flags & MSM_SUBMIT_BO_WRITE)
|
||||
@@ -661,9 +661,7 @@ int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev,
|
||||
}
|
||||
|
||||
/* Create ringbuffer: */
|
||||
mutex_lock(&drm->struct_mutex);
|
||||
gpu->rb = msm_ringbuffer_new(gpu, config->ringsz);
|
||||
mutex_unlock(&drm->struct_mutex);
|
||||
if (IS_ERR(gpu->rb)) {
|
||||
ret = PTR_ERR(gpu->rb);
|
||||
gpu->rb = NULL;
|
||||
|
Reference in New Issue
Block a user