[PATCH 7/8] drm: export syncobj search fence to replace fence_get
Chunming Zhou
david1.zhou at amd.com
Fri Aug 24 12:12:09 UTC 2018
Signed-off-by: Chunming Zhou <david1.zhou at amd.com>
---
drivers/gpu/drm/drm_syncobj.c | 5 +++--
drivers/gpu/drm/i915/i915_gem_execbuffer.c | 4 +++-
include/drm/drm_syncobj.h | 2 ++
3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c
index ff0b1fdfd9a8..0be7dd0a0e7d 100644
--- a/drivers/gpu/drm/drm_syncobj.c
+++ b/drivers/gpu/drm/drm_syncobj.c
@@ -500,8 +500,8 @@ drm_syncobj_timeline_point_get(struct drm_syncobj *syncobj, u64 point, u64 flags
* contains a reference to the fence, which must be released by calling
* dma_fence_put().
*/
-static int drm_syncobj_search_fence(struct drm_syncobj *syncobj, u64 point,
- u64 flags, struct dma_fence **fence)
+int drm_syncobj_search_fence(struct drm_syncobj *syncobj, u64 point,
+ u64 flags, struct dma_fence **fence)
{
int ret = 0;
@@ -530,6 +530,7 @@ static int drm_syncobj_search_fence(struct drm_syncobj *syncobj, u64 point,
drm_syncobj_put(syncobj);
return ret;
}
+EXPORT_SYMBOL(drm_syncobj_search_fence);
int drm_syncobj_find_fence(struct drm_file *file_private,
u32 handle, u64 point,
struct dma_fence **fence) {
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index 7209dd832d39..bb20d318c9d6 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -2182,7 +2182,9 @@ await_fence_array(struct i915_execbuffer *eb,
if (!(flags & I915_EXEC_FENCE_WAIT))
continue;
- fence = drm_syncobj_fence_get(syncobj);
+ drm_syncobj_search_fence(syncobj, 0,
+ DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT,
+ &fence);
if (!fence)
return -EINVAL;
diff --git a/include/drm/drm_syncobj.h b/include/drm/drm_syncobj.h
index fb4e7edf90bf..ec098d4798b8 100644
--- a/include/drm/drm_syncobj.h
+++ b/include/drm/drm_syncobj.h
@@ -170,5 +170,7 @@ int drm_syncobj_create(struct drm_syncobj **out_syncobj, uint32_t flags,
int drm_syncobj_get_handle(struct drm_file *file_private,
struct drm_syncobj *syncobj, u32 *handle);
int drm_syncobj_get_fd(struct drm_syncobj *syncobj, int *p_fd);
+int drm_syncobj_search_fence(struct drm_syncobj *syncobj, u64 point,
+ u64 flags, struct dma_fence **fence);
#endif
--
2.17.1
More information about the dri-devel
mailing list