summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h
diff options
context:
space:
mode:
authorChunming Zhou2015-08-05 13:52:14 +0200
committerAlex Deucher2015-08-17 22:51:03 +0200
commit4cef92670bc908aaa48771fc9c72f4bcfb7d6a35 (patch)
tree4fbd3338f432f461966bc38a1ade2deb90f0a73f /drivers/gpu/drm/amd/scheduler/gpu_scheduler.h
parentRevert "drm/amdgpu: return new seq_no for amd_sched_push_job" (diff)
downloadkernel-qcow2-linux-4cef92670bc908aaa48771fc9c72f4bcfb7d6a35.tar.gz
kernel-qcow2-linux-4cef92670bc908aaa48771fc9c72f4bcfb7d6a35.tar.xz
kernel-qcow2-linux-4cef92670bc908aaa48771fc9c72f4bcfb7d6a35.zip
drm/amdgpu: process sched job exactly triggered by fence signal
Signed-off-by: Chunming Zhou <david1.zhou@amd.com> Reviewed-by: Christian K?nig <christian.koenig@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/scheduler/gpu_scheduler.h')
-rw-r--r--drivers/gpu/drm/amd/scheduler/gpu_scheduler.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h
index 1a01ac45cd4c..8a756a565583 100644
--- a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h
+++ b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h
@@ -25,6 +25,7 @@
#define _GPU_SCHEDULER_H_
#include <linux/kfifo.h>
+#include <linux/fence.h>
#define AMD_GPU_WAIT_IDLE_TIMEOUT_IN_MS 3000
@@ -80,6 +81,13 @@ struct amd_context_entity {
bool is_pending;
};
+struct amd_sched_job {
+ struct list_head list;
+ struct fence_cb cb;
+ struct amd_gpu_scheduler *sched;
+ void *job;
+};
+
/**
* Define the backend operations called by the scheduler,
* these functions should be implemented in driver side
@@ -90,7 +98,7 @@ struct amd_sched_backend_ops {
void *job);
void (*run_job)(struct amd_gpu_scheduler *sched,
struct amd_context_entity *c_entity,
- void *job);
+ struct amd_sched_job *job);
void (*process_job)(struct amd_gpu_scheduler *sched, void *job);
};
@@ -102,19 +110,19 @@ struct amd_gpu_scheduler {
struct task_struct *thread;
struct amd_run_queue sched_rq;
struct amd_run_queue kernel_rq;
- struct kfifo active_hw_rq;
+ struct list_head active_hw_rq;
+ atomic64_t hw_rq_count;
struct amd_sched_backend_ops *ops;
uint32_t ring_id;
uint32_t granularity; /* in ms unit */
uint32_t preemption;
- atomic64_t last_handled_seq;
wait_queue_head_t wait_queue;
struct amd_context_entity *current_entity;
struct mutex sched_lock;
spinlock_t queue_lock;
+ uint32_t hw_submission_limit;
};
-
struct amd_gpu_scheduler *amd_sched_create(void *device,
struct amd_sched_backend_ops *ops,
uint32_t ring,
@@ -133,7 +141,7 @@ int amd_sched_wait_emit(struct amd_context_entity *c_entity,
bool intr,
long timeout);
-void amd_sched_isr(struct amd_gpu_scheduler *sched);
+void amd_sched_process_job(struct amd_sched_job *sched_job);
uint64_t amd_sched_get_handled_seq(struct amd_gpu_scheduler *sched);
int amd_context_entity_fini(struct amd_gpu_scheduler *sched,