]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/msm/gpu: Map the ringbuffer in the iova at create time
authorJordan Crouse <jcrouse@codeaurora.org>
Wed, 7 Nov 2018 22:35:54 +0000 (15:35 -0700)
committerRob Clark <robdclark@gmail.com>
Tue, 11 Dec 2018 18:07:03 +0000 (13:07 -0500)
For reasons that I'm sure made perfect sense at the time we were
opting to defer the iova alloc / pin on the ringbuffer until HW
init time so when we moved to iova reference counting we ended
up adding a reference count every time the hardware started.
Not that it mattered (because the ring is always around) but
it did make the debug output look odd. Allocate and pin the iova
at create time instead.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
drivers/gpu/drm/msm/adreno/adreno_gpu.c
drivers/gpu/drm/msm/msm_ringbuffer.c

index 7ab2788e33b664d3e877fbe4cc0cd08918f47148..20c86e2369f3c3e9dad97f84bdf8d1a8f4e1362f 100644 (file)
@@ -209,15 +209,6 @@ int adreno_hw_init(struct msm_gpu *gpu)
                if (!ring)
                        continue;
 
-               ret = msm_gem_get_and_pin_iova(ring->bo, gpu->aspace,
-                       &ring->iova);
-               if (ret) {
-                       ring->iova = 0;
-                       DRM_DEV_ERROR(gpu->dev->dev,
-                               "could not map ringbuffer %d: %d\n", i, ret);
-                       return ret;
-               }
-
                ring->cur = ring->start;
                ring->next = ring->start;
 
index 6169bd6ca153d926e33390b318159cf41a17e428..20a96fe69dcd89b4ed4e5cf3332df81deb709d33 100644 (file)
@@ -36,9 +36,9 @@ struct msm_ringbuffer *msm_ringbuffer_new(struct msm_gpu *gpu, int id,
 
        ring->gpu = gpu;
        ring->id = id;
-       /* Pass NULL for the iova pointer - we will map it later */
+
        ring->start = msm_gem_kernel_new(gpu->dev, MSM_GPU_RINGBUFFER_SZ,
-               MSM_BO_WC, gpu->aspace, &ring->bo, NULL);
+               MSM_BO_WC, gpu->aspace, &ring->bo, &ring->iova);
 
        if (IS_ERR(ring->start)) {
                ret = PTR_ERR(ring->start);