summaryrefslogtreecommitdiff
path: root/sys/dev/pci/drm
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2019-11-13 06:04:42 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2019-11-13 06:04:42 +0000
commit1d8967257731f8b03ee8457735e4ee4790d97700 (patch)
tree236b29e5a12aa6640182618fa59737fd914056d0 /sys/dev/pci/drm
parent4729440e8176230442e2a24785d95d288a43a63e (diff)
drm/amdgpu: If amdgpu_ib_schedule fails return back the error.
From Andrey Grodzovsky e5edbf9c45cec143526d9d1708d216228a197cd8 in linux 4.19.y/4.19.84 57c0f58e9f562089de5f0b60da103677d232374c in mainline linux
Diffstat (limited to 'sys/dev/pci/drm')
-rw-r--r--sys/dev/pci/drm/amd/amdgpu/amdgpu_job.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_job.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_job.c
index f823d4baf04..cf582cc46d5 100644
--- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_job.c
+++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_job.c
@@ -203,7 +203,7 @@ static struct dma_fence *amdgpu_job_run(struct drm_sched_job *sched_job)
struct amdgpu_ring *ring = to_amdgpu_ring(sched_job->sched);
struct dma_fence *fence = NULL, *finished;
struct amdgpu_job *job;
- int r;
+ int r = 0;
job = to_amdgpu_job(sched_job);
finished = &job->base.s_fence->finished;
@@ -228,6 +228,8 @@ static struct dma_fence *amdgpu_job_run(struct drm_sched_job *sched_job)
job->fence = dma_fence_get(fence);
amdgpu_job_free_resources(job);
+
+ fence = r ? ERR_PTR(r) : fence;
return fence;
}