Commit dd01d071 authored by Jammy Zhou's avatar Jammy Zhou Committed by Alex Deucher

drm/amdgpu: some code refinement v2

Fix the code alignment, etc.

v2: rebase the code
Signed-off-by: default avatarJammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 03d3a3e6
...@@ -817,14 +817,14 @@ static int amdgpu_cs_dependencies(struct amdgpu_device *adev, ...@@ -817,14 +817,14 @@ static int amdgpu_cs_dependencies(struct amdgpu_device *adev,
static int amdgpu_cs_parser_prepare_job(struct amdgpu_cs_parser *sched_job) static int amdgpu_cs_parser_prepare_job(struct amdgpu_cs_parser *sched_job)
{ {
int r, i; int r, i;
struct amdgpu_cs_parser *parser = sched_job; struct amdgpu_cs_parser *parser = sched_job;
struct amdgpu_device *adev = sched_job->adev; struct amdgpu_device *adev = sched_job->adev;
bool reserved_buffers = false; bool reserved_buffers = false;
r = amdgpu_cs_parser_relocs(parser); r = amdgpu_cs_parser_relocs(parser);
if (r) { if (r) {
if (r != -ERESTARTSYS) { if (r != -ERESTARTSYS) {
if (r == -ENOMEM) if (r == -ENOMEM)
DRM_ERROR("Not enough memory for command submission!\n"); DRM_ERROR("Not enough memory for command submission!\n");
else else
...@@ -841,16 +841,16 @@ static int amdgpu_cs_parser_prepare_job(struct amdgpu_cs_parser *sched_job) ...@@ -841,16 +841,16 @@ static int amdgpu_cs_parser_prepare_job(struct amdgpu_cs_parser *sched_job)
if (r) if (r)
DRM_ERROR("Failed in the dependencies handling %d!\n", r); DRM_ERROR("Failed in the dependencies handling %d!\n", r);
} }
if (r) { if (r) {
amdgpu_cs_parser_fini(parser, r, reserved_buffers); amdgpu_cs_parser_fini(parser, r, reserved_buffers);
return r; return r;
} }
for (i = 0; i < parser->num_ibs; i++) for (i = 0; i < parser->num_ibs; i++)
trace_amdgpu_cs(parser, i); trace_amdgpu_cs(parser, i);
r = amdgpu_cs_ib_vm_chunk(adev, parser); r = amdgpu_cs_ib_vm_chunk(adev, parser);
return r; return r;
} }
static struct amdgpu_ring *amdgpu_cs_parser_get_ring( static struct amdgpu_ring *amdgpu_cs_parser_get_ring(
......
...@@ -33,11 +33,12 @@ static int amdgpu_sched_prepare_job(struct amd_gpu_scheduler *sched, ...@@ -33,11 +33,12 @@ static int amdgpu_sched_prepare_job(struct amd_gpu_scheduler *sched,
{ {
int r = 0; int r = 0;
struct amdgpu_cs_parser *sched_job = (struct amdgpu_cs_parser *)job; struct amdgpu_cs_parser *sched_job = (struct amdgpu_cs_parser *)job;
if (sched_job->prepare_job) if (sched_job->prepare_job) {
r = sched_job->prepare_job(sched_job); r = sched_job->prepare_job(sched_job);
if (r) { if (r) {
DRM_ERROR("Prepare job error\n"); DRM_ERROR("Prepare job error\n");
schedule_work(&sched_job->job_work); schedule_work(&sched_job->job_work);
}
} }
return r; return r;
} }
......
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