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>
This commit is contained in:
committed by
Alex Deucher
parent
e27a73d130
commit
4e9177134e
@@ -1428,6 +1428,9 @@ int amdgpu_cs_fence_to_handle_ioctl(struct drm_device *dev, void *data,
|
|||||||
if (IS_ERR(fence))
|
if (IS_ERR(fence))
|
||||||
return PTR_ERR(fence);
|
return PTR_ERR(fence);
|
||||||
|
|
||||||
|
if (!fence)
|
||||||
|
fence = dma_fence_get_stub();
|
||||||
|
|
||||||
switch (info->in.what) {
|
switch (info->in.what) {
|
||||||
case AMDGPU_FENCE_TO_HANDLE_GET_SYNCOBJ:
|
case AMDGPU_FENCE_TO_HANDLE_GET_SYNCOBJ:
|
||||||
r = drm_syncobj_create(&syncobj, 0, fence);
|
r = drm_syncobj_create(&syncobj, 0, fence);
|
||||||
|
|||||||
Reference in New Issue
Block a user