diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c index 26b17939c9c9586bb0155b48b717916248f3ca8f..b92525329d6cef1d6a403e3442dfa9886b70c803 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c @@ -146,7 +146,7 @@ static uint32_t amdgpu_sa_get_ring_from_fence(struct fence *f) s_fence = to_amd_sched_fence(f); if (s_fence) - return s_fence->entity->scheduler->ring_id; + return s_fence->scheduler->ring_id; a_fence = to_amdgpu_fence(f); if (a_fence) return a_fence->ring->idx; @@ -437,7 +437,7 @@ void amdgpu_sa_bo_dump_debug_info(struct amdgpu_sa_manager *sa_manager, if (s_fence) seq_printf(m, " protected by 0x%016x on ring %d", s_fence->base.seqno, - s_fence->entity->scheduler->ring_id); + s_fence->scheduler->ring_id); } seq_printf(m, "\n"); diff --git a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c index 29c45ed7d02f53742cb32293c53ca76f14bb47fe..d747f82808a7197cbc36d070fd354b15a61ea24c 100644 --- a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c +++ b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c @@ -109,8 +109,6 @@ int amd_sched_entity_init(struct amd_gpu_scheduler *sched, struct amd_sched_rq *rq, uint32_t jobs) { - char name[20]; - if (!(sched && entity && rq)) return -EINVAL; @@ -119,8 +117,6 @@ int amd_sched_entity_init(struct amd_gpu_scheduler *sched, entity->scheduler = sched; init_waitqueue_head(&entity->wait_queue); entity->fence_context = fence_context_alloc(1); - snprintf(name, sizeof(name), "c_entity[%llu]", entity->fence_context); - memcpy(entity->name, name, 20); if(kfifo_alloc(&entity->job_queue, jobs * sizeof(void *), GFP_KERNEL)) @@ -347,7 +343,6 @@ struct amd_gpu_scheduler *amd_sched_create(struct amd_sched_backend_ops *ops, unsigned ring, unsigned hw_submission) { struct amd_gpu_scheduler *sched; - char name[20]; sched = kzalloc(sizeof(struct amd_gpu_scheduler), GFP_KERNEL); if (!sched) @@ -356,14 +351,14 @@ 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; - snprintf(name, sizeof(name), "gpu_sched[%d]", ring); + snprintf(sched->name, sizeof(sched->name), "amdgpu[%d]", ring); amd_sched_rq_init(&sched->sched_rq); amd_sched_rq_init(&sched->kernel_rq); init_waitqueue_head(&sched->wait_queue); atomic_set(&sched->hw_rq_count, 0); /* Each scheduler will run on a seperate kernel thread */ - sched->thread = kthread_run(amd_sched_main, sched, name); + sched->thread = kthread_run(amd_sched_main, sched, sched->name); if (IS_ERR(sched->thread)) { DRM_ERROR("Failed to create scheduler for id %d.\n", ring); kfree(sched); diff --git a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h index 46b528d41f7f2e198bb77b4158fac859ba0ce4f9..62655f4cf11da1d9021a929c0d08860a36021009 100644 --- a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h +++ b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h @@ -48,7 +48,6 @@ struct amd_sched_entity { struct amd_gpu_scheduler *scheduler; wait_queue_head_t wait_queue; uint64_t fence_context; - char name[20]; }; /** @@ -64,8 +63,7 @@ struct amd_sched_rq { struct amd_sched_fence { struct fence base; - struct fence_cb cb; - struct amd_sched_entity *entity; + struct amd_gpu_scheduler *scheduler; spinlock_t lock; }; @@ -111,6 +109,7 @@ struct amd_gpu_scheduler { uint32_t ring_id; wait_queue_head_t wait_queue; uint32_t hw_submission_limit; + char name[20]; }; struct amd_gpu_scheduler * diff --git a/drivers/gpu/drm/amd/scheduler/sched_fence.c b/drivers/gpu/drm/amd/scheduler/sched_fence.c index 266ed7bbbc74f4523cfeb13e351a6522ac10e88f..7f0f57819b62c21907f067d27239368b718964f4 100644 --- a/drivers/gpu/drm/amd/scheduler/sched_fence.c +++ b/drivers/gpu/drm/amd/scheduler/sched_fence.c @@ -36,7 +36,7 @@ struct amd_sched_fence *amd_sched_fence_create(struct amd_sched_entity *s_entity if (fence == NULL) return NULL; - fence->entity = s_entity; + fence->scheduler = s_entity->scheduler; spin_lock_init(&fence->lock); seq = atomic_inc_return(&s_entity->fence_seq); @@ -63,7 +63,7 @@ static const char *amd_sched_fence_get_driver_name(struct fence *fence) static const char *amd_sched_fence_get_timeline_name(struct fence *f) { struct amd_sched_fence *fence = to_amd_sched_fence(f); - return (const char *)fence->entity->name; + return (const char *)fence->scheduler->name; } static bool amd_sched_fence_enable_signaling(struct fence *f)