diff options
Diffstat (limited to 'drivers/gpu/drm/msm/msm_ringbuffer.c')
-rw-r--r-- | drivers/gpu/drm/msm/msm_ringbuffer.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/gpu/drm/msm/msm_ringbuffer.c b/drivers/gpu/drm/msm/msm_ringbuffer.c index 6f5295b3f2f6..20a96fe69dcd 100644 --- a/drivers/gpu/drm/msm/msm_ringbuffer.c +++ b/drivers/gpu/drm/msm/msm_ringbuffer.c @@ -36,15 +36,18 @@ 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); ring->start = 0; goto fail; } + + msm_gem_object_set_name(ring->bo, "ring%d", id); + ring->end = ring->start + (MSM_GPU_RINGBUFFER_SZ >> 2); ring->next = ring->start; ring->cur = ring->start; @@ -73,10 +76,7 @@ void msm_ringbuffer_destroy(struct msm_ringbuffer *ring) msm_fence_context_free(ring->fctx); - if (ring->bo) { - msm_gem_put_iova(ring->bo, ring->gpu->aspace); - msm_gem_put_vaddr(ring->bo); - drm_gem_object_put_unlocked(ring->bo); - } + msm_gem_kernel_put(ring->bo, ring->gpu->aspace, false); + kfree(ring); } |