diff options
author | Christian König <christian.koenig@amd.com> | 2018-12-03 08:05:34 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-12-14 15:54:11 -0500 |
commit | 4e9177134e7dd992dd96875143413dbc303f355e (patch) | |
tree | 3abf58f8e234912f445218c5f81f71b7fc87a4d2 /drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | |
parent | e27a73d1305f22cc093b16ea9f2a81cfa9e5193c (diff) |
drm/amdgpu: fix NULL fence handling in amdgpu_cs_fence_to_handle_ioctl
When the fence is already signaled it is perfectly normal to get a NULL
fence here. But since we can't export that we need to use a stub fence.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c index 5dc3ee372e2f..149b3065119b 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | |||
@@ -1428,6 +1428,9 @@ int amdgpu_cs_fence_to_handle_ioctl(struct drm_device *dev, void *data, | |||
1428 | if (IS_ERR(fence)) | 1428 | if (IS_ERR(fence)) |
1429 | return PTR_ERR(fence); | 1429 | return PTR_ERR(fence); |
1430 | 1430 | ||
1431 | if (!fence) | ||
1432 | fence = dma_fence_get_stub(); | ||
1433 | |||
1431 | switch (info->in.what) { | 1434 | switch (info->in.what) { |
1432 | case AMDGPU_FENCE_TO_HANDLE_GET_SYNCOBJ: | 1435 | case AMDGPU_FENCE_TO_HANDLE_GET_SYNCOBJ: |
1433 | r = drm_syncobj_create(&syncobj, 0, fence); | 1436 | r = drm_syncobj_create(&syncobj, 0, fence); |