Commit f38fdfdd authored by Chunming Zhou's avatar Chunming Zhou Committed by Alex Deucher

drm/amdgpu: add priv data to sched

Signed-off-by: default avatarChunming Zhou <david1.zhou@amd.com>
Reviewed-by: default avatarChristian K?nig <christian.koenig@amd.com>
parent 84f76ea6
...@@ -628,7 +628,8 @@ void amdgpu_fence_driver_init_ring(struct amdgpu_ring *ring) ...@@ -628,7 +628,8 @@ void amdgpu_fence_driver_init_ring(struct amdgpu_ring *ring)
if (amdgpu_enable_scheduler) { if (amdgpu_enable_scheduler) {
ring->scheduler = amd_sched_create(&amdgpu_sched_ops, ring->scheduler = amd_sched_create(&amdgpu_sched_ops,
ring->idx, ring->idx,
amdgpu_sched_hw_submission); amdgpu_sched_hw_submission,
(void *)ring->adev);
if (!ring->scheduler) if (!ring->scheduler)
DRM_ERROR("Failed to create scheduler on ring %d.\n", DRM_ERROR("Failed to create scheduler on ring %d.\n",
ring->idx); ring->idx);
......
...@@ -341,7 +341,8 @@ static int amd_sched_main(void *param) ...@@ -341,7 +341,8 @@ static int amd_sched_main(void *param)
* Return the pointer to scheduler for success, otherwise return NULL * Return the pointer to scheduler for success, otherwise return NULL
*/ */
struct amd_gpu_scheduler *amd_sched_create(struct amd_sched_backend_ops *ops, 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; struct amd_gpu_scheduler *sched;
...@@ -352,6 +353,7 @@ struct amd_gpu_scheduler *amd_sched_create(struct amd_sched_backend_ops *ops, ...@@ -352,6 +353,7 @@ struct amd_gpu_scheduler *amd_sched_create(struct amd_sched_backend_ops *ops,
sched->ops = ops; sched->ops = ops;
sched->ring_id = ring; sched->ring_id = ring;
sched->hw_submission_limit = hw_submission; sched->hw_submission_limit = hw_submission;
sched->priv = priv;
snprintf(sched->name, sizeof(sched->name), "amdgpu[%d]", ring); snprintf(sched->name, sizeof(sched->name), "amdgpu[%d]", ring);
amd_sched_rq_init(&sched->sched_rq); amd_sched_rq_init(&sched->sched_rq);
amd_sched_rq_init(&sched->kernel_rq); amd_sched_rq_init(&sched->kernel_rq);
......
...@@ -112,11 +112,12 @@ struct amd_gpu_scheduler { ...@@ -112,11 +112,12 @@ struct amd_gpu_scheduler {
wait_queue_head_t wait_queue; wait_queue_head_t wait_queue;
uint32_t hw_submission_limit; uint32_t hw_submission_limit;
char name[20]; char name[20];
void *priv;
}; };
struct amd_gpu_scheduler * struct amd_gpu_scheduler *
amd_sched_create(struct amd_sched_backend_ops *ops, 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_destroy(struct amd_gpu_scheduler *sched);
int amd_sched_entity_init(struct amd_gpu_scheduler *sched, int amd_sched_entity_init(struct amd_gpu_scheduler *sched,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment