summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/scheduler
diff options
context:
space:
mode:
authorJammy Zhou <Jammy.Zhou@amd.com>2015-07-31 17:18:15 +0800
committerAlex Deucher <alexander.deucher@amd.com>2015-08-17 16:50:57 -0400
commitf95b7e3e8664fbea4e60f15e7e8a975e4b2b7c3f (patch)
tree8a1fb3c11bbd4443545a593fd0497910a6709ccb /drivers/gpu/drm/amd/scheduler
parentea199cc9f825f3ef5aab3db5f00dcc639f8a8b02 (diff)
drm/amdgpu: add amd_sched_commit
This function is to update last_emitted_v_seq and wake up the waiters. It should be called by driver in the run_job backend function Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/scheduler')
-rw-r--r--drivers/gpu/drm/amd/scheduler/gpu_scheduler.c12
-rw-r--r--drivers/gpu/drm/amd/scheduler/gpu_scheduler.h2
2 files changed, 14 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
index 2c4c261ff928..66938f1597bb 100644
--- a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
+++ b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
@@ -495,3 +495,15 @@ int amd_sched_destroy(struct amd_gpu_scheduler *sched)
return 0;
}
+/**
+ * Update emitted sequence and wake up the waiters, called by run_job
+ * in driver side
+ *
+ * @entity The context entity
+ * @seq The sequence number for the latest emitted job
+*/
+void amd_sched_emit(struct amd_context_entity *c_entity, uint64_t seq)
+{
+ atomic64_set(&c_entity->last_emitted_v_seq, seq);
+ wake_up_all(&c_entity->wait_emit);
+}
diff --git a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h
index 37dd6370bd98..af2afdf2309c 100644
--- a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h
+++ b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h
@@ -151,4 +151,6 @@ int amd_context_entity_init(struct amd_gpu_scheduler *sched,
uint32_t context_id,
uint32_t jobs);
+void amd_sched_emit(struct amd_context_entity *c_entity, uint64_t seq);
+
#endif