diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2021-12-14 13:32:10 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2021-12-14 13:32:10 +0000 |
commit | 976450cba2ce9b844ea95e08d6c83334b1860ec8 (patch) | |
tree | 7f37cf8b4746b3f5e3fa71e1c3cae6f6f8f313ad | |
parent | 3ec14773103f88ed7ee41f0c311e11ce06f2ca25 (diff) |
drm/syncobj: Deal with signalled fences in drm_syncobj_find_fence.
From Bas Nieuwenhuizen
2737d0bc21b6db199b4145e12b9f1745577d7944 in linux 5.10.y/5.10.85
b19926d4f3a660a8b76e5d989ffd1168e619a5c4 in mainline linux
-rw-r--r-- | sys/dev/pci/drm/drm_syncobj.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/drm_syncobj.c b/sys/dev/pci/drm/drm_syncobj.c index 2d157a1fd37..f792dd15501 100644 --- a/sys/dev/pci/drm/drm_syncobj.c +++ b/sys/dev/pci/drm/drm_syncobj.c @@ -395,8 +395,17 @@ int drm_syncobj_find_fence(struct drm_file *file_private, if (*fence) { ret = dma_fence_chain_find_seqno(fence, point); - if (!ret) + if (!ret) { + /* If the requested seqno is already signaled + * drm_syncobj_find_fence may return a NULL + * fence. To make sure the recipient gets + * signalled, use a new fence instead. + */ + if (!*fence) + *fence = dma_fence_get_stub(); + goto out; + } dma_fence_put(*fence); } else { ret = -EINVAL; |