drm/amdgpu: implement more ib pools (v2)
[linux-2.6-microblaze.git] / drivers / gpu / drm / amd / amdgpu / amdgpu_job.c
index d42be88..2b99f59 100644 (file)
@@ -87,7 +87,8 @@ int amdgpu_job_alloc(struct amdgpu_device *adev, unsigned num_ibs,
 }
 
 int amdgpu_job_alloc_with_ib(struct amdgpu_device *adev, unsigned size,
-                            struct amdgpu_job **job)
+               enum amdgpu_ib_pool_type pool_type,
+               struct amdgpu_job **job)
 {
        int r;
 
@@ -95,7 +96,7 @@ int amdgpu_job_alloc_with_ib(struct amdgpu_device *adev, unsigned size,
        if (r)
                return r;
 
-       r = amdgpu_ib_get(adev, NULL, size, &(*job)->ibs[0]);
+       r = amdgpu_ib_get(adev, NULL, size, pool_type, &(*job)->ibs[0]);
        if (r)
                kfree(*job);
 
@@ -117,12 +118,10 @@ void amdgpu_job_free_resources(struct amdgpu_job *job)
 
 static void amdgpu_job_free_cb(struct drm_sched_job *s_job)
 {
-       struct amdgpu_ring *ring = to_amdgpu_ring(s_job->sched);
        struct amdgpu_job *job = to_amdgpu_job(s_job);
 
        drm_sched_job_cleanup(s_job);
 
-       amdgpu_ring_priority_put(ring, s_job->s_priority);
        dma_fence_put(job->fence);
        amdgpu_sync_free(&job->sync);
        amdgpu_sync_free(&job->sched_sync);
@@ -143,7 +142,6 @@ int amdgpu_job_submit(struct amdgpu_job *job, struct drm_sched_entity *entity,
                      void *owner, struct dma_fence **f)
 {
        enum drm_sched_priority priority;
-       struct amdgpu_ring *ring;
        int r;
 
        if (!f)
@@ -158,9 +156,6 @@ int amdgpu_job_submit(struct amdgpu_job *job, struct drm_sched_entity *entity,
        priority = job->base.s_priority;
        drm_sched_entity_push_job(&job->base, entity);
 
-       ring = to_amdgpu_ring(entity->rq->sched);
-       amdgpu_ring_priority_get(ring, priority);
-
        return 0;
 }