Commit 754ce0fa authored by Chunming Zhou's avatar Chunming Zhou Committed by Alex Deucher

drm/amd: add parent for sched fence

Parent of sched fence is hw fence which is to signal sched fence.
Signed-off-by: default avatarChunming Zhou <David1.Zhou@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent f263ec62
......@@ -516,6 +516,7 @@ static int amd_sched_main(void *param)
fence = sched->ops->run_job(sched_job);
amd_sched_fence_scheduled(s_fence);
if (fence) {
s_fence->parent = fence_get(fence);
r = fence_add_callback(fence, &s_fence->cb,
amd_sched_process_job);
if (r == -ENOENT)
......
......@@ -69,6 +69,7 @@ struct amd_sched_fence {
struct fence scheduled;
struct fence finished;
struct fence_cb cb;
struct fence *parent;
struct amd_gpu_scheduler *sched;
spinlock_t lock;
void *owner;
......
......@@ -98,6 +98,7 @@ static void amd_sched_fence_free(struct rcu_head *rcu)
struct fence *f = container_of(rcu, struct fence, rcu);
struct amd_sched_fence *fence = to_amd_sched_fence(f);
fence_put(fence->parent);
kmem_cache_free(sched_fence_slab, fence);
}
......
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