aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h
diff options
context:
space:
mode:
authorSean Paul <seanpaul@chromium.org>2017-07-17 11:43:05 -0400
committerSean Paul <seanpaul@chromium.org>2017-07-17 11:56:07 -0400
commitef434a0c2ce765ad33026375db7d23aebd5e9532 (patch)
tree4bdac59f0bac3a6508741e6bd62da6e770fc3bc1 /drivers/gpu/drm/amd/scheduler/gpu_scheduler.h
parentdma-buf/fence: Avoid use of uninitialised timestamp (diff)
parentdrm/vc4: Fix VBLANK handling in crtc->enable() path (diff)
downloadlinux-dev-ef434a0c2ce765ad33026375db7d23aebd5e9532.tar.xz
linux-dev-ef434a0c2ce765ad33026375db7d23aebd5e9532.zip
Merge branch 'drm-misc-next-fixes' into drm-misc-fixes
Pick up 1ed134e6526b drm/vc4: Fix VBLANK handling in crtc->enable() path From drm-misc-next-fixes, it was applied after the last pull request was sent from that branch. We'll send it through drm-fixes instead.
Diffstat (limited to 'drivers/gpu/drm/amd/scheduler/gpu_scheduler.h')
-rw-r--r--drivers/gpu/drm/amd/scheduler/gpu_scheduler.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h
index 924d4a5899e1..f9d8f28efd16 100644
--- a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h
+++ b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h
@@ -81,6 +81,7 @@ struct amd_sched_job {
struct list_head node;
struct delayed_work work_tdr;
uint64_t id;
+ atomic_t karma;
};
extern const struct dma_fence_ops amd_sched_fence_ops_scheduled;
@@ -96,6 +97,11 @@ static inline struct amd_sched_fence *to_amd_sched_fence(struct dma_fence *f)
return NULL;
}
+static inline bool amd_sched_invalidate_job(struct amd_sched_job *s_job, int threshold)
+{
+ return (s_job && atomic_inc_return(&s_job->karma) > threshold);
+}
+
/**
* Define the backend operations called by the scheduler,
* these functions should be implemented in driver side
@@ -160,4 +166,5 @@ void amd_sched_hw_job_reset(struct amd_gpu_scheduler *sched);
void amd_sched_job_recovery(struct amd_gpu_scheduler *sched);
bool amd_sched_dependency_optimized(struct dma_fence* fence,
struct amd_sched_entity *entity);
+void amd_sched_job_kickout(struct amd_sched_job *s_job);
#endif