aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChunming Zhou <david1.zhou@amd.com>2015-08-23 23:35:26 -0400
committerAlex Deucher <alexander.deucher@amd.com>2015-08-25 10:52:18 -0400
commitf38fdfddfaab070e3ff2333a79e45169ee33dc28 (patch)
tree8988ba27abf8551083067d487b8b04ddfd8ff2f6
parent84f76ea6b03a766931e5d6d650af5ab980c6c4f4 (diff)
drm/amdgpu: add priv data to sched
Signed-off-by: Chunming Zhou <david1.zhou@amd.com> Reviewed-by: Christian K?nig <christian.koenig@amd.com>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c3
-rw-r--r--drivers/gpu/drm/amd/scheduler/gpu_scheduler.c4
-rw-r--r--drivers/gpu/drm/amd/scheduler/gpu_scheduler.h3
3 files changed, 7 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
index e13e4452a349..9787337a65a1 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
@@ -628,7 +628,8 @@ void amdgpu_fence_driver_init_ring(struct amdgpu_ring *ring)
628 if (amdgpu_enable_scheduler) { 628 if (amdgpu_enable_scheduler) {
629 ring->scheduler = amd_sched_create(&amdgpu_sched_ops, 629 ring->scheduler = amd_sched_create(&amdgpu_sched_ops,
630 ring->idx, 630 ring->idx,
631 amdgpu_sched_hw_submission); 631 amdgpu_sched_hw_submission,
632 (void *)ring->adev);
632 if (!ring->scheduler) 633 if (!ring->scheduler)
633 DRM_ERROR("Failed to create scheduler on ring %d.\n", 634 DRM_ERROR("Failed to create scheduler on ring %d.\n",
634 ring->idx); 635 ring->idx);
diff --git a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
index 24593fd29150..2df6f174ba7b 100644
--- a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
+++ b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
@@ -341,7 +341,8 @@ static int amd_sched_main(void *param)
341 * Return the pointer to scheduler for success, otherwise return NULL 341 * Return the pointer to scheduler for success, otherwise return NULL
342*/ 342*/
343struct amd_gpu_scheduler *amd_sched_create(struct amd_sched_backend_ops *ops, 343struct amd_gpu_scheduler *amd_sched_create(struct amd_sched_backend_ops *ops,
344 unsigned ring, unsigned hw_submission) 344 unsigned ring, unsigned hw_submission,
345 void *priv)
345{ 346{
346 struct amd_gpu_scheduler *sched; 347 struct amd_gpu_scheduler *sched;
347 348
@@ -352,6 +353,7 @@ struct amd_gpu_scheduler *amd_sched_create(struct amd_sched_backend_ops *ops,
352 sched->ops = ops; 353 sched->ops = ops;
353 sched->ring_id = ring; 354 sched->ring_id = ring;
354 sched->hw_submission_limit = hw_submission; 355 sched->hw_submission_limit = hw_submission;
356 sched->priv = priv;
355 snprintf(sched->name, sizeof(sched->name), "amdgpu[%d]", ring); 357 snprintf(sched->name, sizeof(sched->name), "amdgpu[%d]", ring);
356 amd_sched_rq_init(&sched->sched_rq); 358 amd_sched_rq_init(&sched->sched_rq);
357 amd_sched_rq_init(&sched->kernel_rq); 359 amd_sched_rq_init(&sched->kernel_rq);
diff --git a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h
index 0927864af1f8..44909b16c3a3 100644
--- a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h
+++ b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h
@@ -112,11 +112,12 @@ struct amd_gpu_scheduler {
112 wait_queue_head_t wait_queue; 112 wait_queue_head_t wait_queue;
113 uint32_t hw_submission_limit; 113 uint32_t hw_submission_limit;
114 char name[20]; 114 char name[20];
115 void *priv;
115}; 116};
116 117
117struct amd_gpu_scheduler * 118struct amd_gpu_scheduler *
118amd_sched_create(struct amd_sched_backend_ops *ops, 119amd_sched_create(struct amd_sched_backend_ops *ops,
119 uint32_t ring, uint32_t hw_submission); 120 uint32_t ring, uint32_t hw_submission, void *priv);
120int amd_sched_destroy(struct amd_gpu_scheduler *sched); 121int amd_sched_destroy(struct amd_gpu_scheduler *sched);
121 122
122int amd_sched_entity_init(struct amd_gpu_scheduler *sched, 123int amd_sched_entity_init(struct amd_gpu_scheduler *sched,