aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/msm/msm_gpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/msm/msm_gpu.c')
-rw-r--r--drivers/gpu/drm/msm/msm_gpu.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c
index c6322197db8c..4a0dce587745 100644
--- a/drivers/gpu/drm/msm/msm_gpu.c
+++ b/drivers/gpu/drm/msm/msm_gpu.c
@@ -606,14 +606,17 @@ int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev,
606 iommu = iommu_domain_alloc(&platform_bus_type); 606 iommu = iommu_domain_alloc(&platform_bus_type);
607 if (iommu) { 607 if (iommu) {
608 dev_info(drm->dev, "%s: using IOMMU\n", name); 608 dev_info(drm->dev, "%s: using IOMMU\n", name);
609 gpu->mmu = msm_iommu_new(drm, iommu); 609 gpu->mmu = msm_iommu_new(&pdev->dev, iommu);
610 } else { 610 } else {
611 dev_info(drm->dev, "%s: no IOMMU, fallback to VRAM carveout!\n", name); 611 dev_info(drm->dev, "%s: no IOMMU, fallback to VRAM carveout!\n", name);
612 } 612 }
613 gpu->id = msm_register_mmu(drm, gpu->mmu); 613 gpu->id = msm_register_mmu(drm, gpu->mmu);
614 614
615
615 /* Create ringbuffer: */ 616 /* Create ringbuffer: */
617 mutex_lock(&drm->struct_mutex);
616 gpu->rb = msm_ringbuffer_new(gpu, ringsz); 618 gpu->rb = msm_ringbuffer_new(gpu, ringsz);
619 mutex_unlock(&drm->struct_mutex);
617 if (IS_ERR(gpu->rb)) { 620 if (IS_ERR(gpu->rb)) {
618 ret = PTR_ERR(gpu->rb); 621 ret = PTR_ERR(gpu->rb);
619 gpu->rb = NULL; 622 gpu->rb = NULL;
@@ -621,13 +624,6 @@ int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev,
621 goto fail; 624 goto fail;
622 } 625 }
623 626
624 ret = msm_gem_get_iova_locked(gpu->rb->bo, gpu->id, &gpu->rb_iova);
625 if (ret) {
626 gpu->rb_iova = 0;
627 dev_err(drm->dev, "could not map ringbuffer: %d\n", ret);
628 goto fail;
629 }
630
631 bs_init(gpu); 627 bs_init(gpu);
632 628
633 return 0; 629 return 0;