summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c
diff options
context:
space:
mode:
authorChunming Zhou <david1.zhou@amd.com>2015-08-06 10:19:12 +0300
committerAlex Deucher <alexander.deucher@amd.com>2015-08-17 23:51:06 +0300
commit953e8fd4e734857f6dabbaf325035bf10c4a9c7a (patch)
tree10336decabe4e5a1e5a4c9a15b3a4ec26d1e4c83 /drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c
parent6f0e54a964932d3d5252ac1ff7ab153c984a5d51 (diff)
downloadlinux-953e8fd4e734857f6dabbaf325035bf10c4a9c7a.tar.xz
drm/amdgpu: use amd_sched_job in its backend ops
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/amdgpu/amdgpu_sched.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c
index 039bd1f748f0..d13d01511694 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c
@@ -29,10 +29,16 @@
static int amdgpu_sched_prepare_job(struct amd_gpu_scheduler *sched,
struct amd_sched_entity *entity,
- void *job)
+ struct amd_sched_job *job)
{
int r = 0;
- struct amdgpu_cs_parser *sched_job = (struct amdgpu_cs_parser *)job;
+ struct amdgpu_cs_parser *sched_job;
+ if (!job || !job->data) {
+ DRM_ERROR("job is null\n");
+ return -EINVAL;
+ }
+
+ sched_job = (struct amdgpu_cs_parser *)job->data;
if (sched_job->prepare_job) {
r = sched_job->prepare_job(sched_job);
if (r) {
@@ -51,11 +57,11 @@ static struct fence *amdgpu_sched_run_job(struct amd_gpu_scheduler *sched,
struct amdgpu_cs_parser *sched_job;
struct amdgpu_fence *fence;
- if (!job || !job->job) {
+ if (!job || !job->data) {
DRM_ERROR("job is null\n");
return NULL;
}
- sched_job = (struct amdgpu_cs_parser *)job->job;
+ sched_job = (struct amdgpu_cs_parser *)job->data;
mutex_lock(&sched_job->job_lock);
r = amdgpu_ib_schedule(sched_job->adev,
sched_job->num_ibs,
@@ -83,22 +89,16 @@ err:
return NULL;
}
-static void amdgpu_sched_process_job(struct amd_gpu_scheduler *sched, void *job)
+static void amdgpu_sched_process_job(struct amd_gpu_scheduler *sched,
+ struct amd_sched_job *job)
{
- struct amdgpu_cs_parser *sched_job = NULL;
- struct amdgpu_fence *fence = NULL;
- struct amdgpu_ring *ring = NULL;
- struct amdgpu_device *adev = NULL;
+ struct amdgpu_cs_parser *sched_job;
- if (!job)
- return;
- sched_job = (struct amdgpu_cs_parser *)job;
- fence = sched_job->ibs[sched_job->num_ibs - 1].fence;
- if (!fence)
+ if (!job || !job->data) {
+ DRM_ERROR("job is null\n");
return;
- ring = fence->ring;
- adev = ring->adev;
-
+ }
+ sched_job = (struct amdgpu_cs_parser *)job->data;
schedule_work(&sched_job->job_work);
}