drm/amdgpu: add priv data to sched
authorChunming Zhou <david1.zhou@amd.com>
Mon, 24 Aug 2015 03:35:26 +0000 (11:35 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 25 Aug 2015 14:52:18 +0000 (10:52 -0400)
Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
Reviewed-by: Christian K?nig <christian.koenig@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
drivers/gpu/drm/amd/scheduler/gpu_scheduler.h

index e13e4452a349cbe5f49f17347010be6a912b1b80..9787337a65a105662c0419b0f0d1e0168f43db6e 100644 (file)
@@ -628,7 +628,8 @@ void amdgpu_fence_driver_init_ring(struct amdgpu_ring *ring)
        if (amdgpu_enable_scheduler) {
                ring->scheduler = amd_sched_create(&amdgpu_sched_ops,
                                                   ring->idx,
-                                                  amdgpu_sched_hw_submission);
+                                                  amdgpu_sched_hw_submission,
+                                                  (void *)ring->adev);
                if (!ring->scheduler)
                        DRM_ERROR("Failed to create scheduler on ring %d.\n",
                                  ring->idx);
index 24593fd29150520bf4426abc1fe6c9ec0564a0c1..2df6f174ba7b199ecd7ea39deef1b85647b8fed0 100644 (file)
@@ -341,7 +341,8 @@ static int amd_sched_main(void *param)
  * Return the pointer to scheduler for success, otherwise return NULL
 */
 struct amd_gpu_scheduler *amd_sched_create(struct amd_sched_backend_ops *ops,
-                                          unsigned ring, unsigned hw_submission)
+                                          unsigned ring, unsigned hw_submission,
+                                          void *priv)
 {
        struct amd_gpu_scheduler *sched;
 
@@ -352,6 +353,7 @@ struct amd_gpu_scheduler *amd_sched_create(struct amd_sched_backend_ops *ops,
        sched->ops = ops;
        sched->ring_id = ring;
        sched->hw_submission_limit = hw_submission;
+       sched->priv = priv;
        snprintf(sched->name, sizeof(sched->name), "amdgpu[%d]", ring);
        amd_sched_rq_init(&sched->sched_rq);
        amd_sched_rq_init(&sched->kernel_rq);
index 0927864af1f83291e0e06e97751bdab16b86e19f..44909b16c3a3ac5367d04448e9a60483fa38461d 100644 (file)
@@ -112,11 +112,12 @@ struct amd_gpu_scheduler {
        wait_queue_head_t               wait_queue;
        uint32_t                        hw_submission_limit;
        char                            name[20];
+       void                            *priv;
 };
 
 struct amd_gpu_scheduler *
 amd_sched_create(struct amd_sched_backend_ops *ops,
-                uint32_t ring, uint32_t hw_submission);
+                uint32_t ring, uint32_t hw_submission, void *priv);
 int amd_sched_destroy(struct amd_gpu_scheduler *sched);
 
 int amd_sched_entity_init(struct amd_gpu_scheduler *sched,