drm: revert "expand replace_fence to support timeline point v2"
authorChristian König <christian.koenig@amd.com>
Wed, 14 Nov 2018 13:24:27 +0000 (14:24 +0100)
committerChristian König <christian.koenig@amd.com>
Wed, 5 Dec 2018 10:01:11 +0000 (11:01 +0100)
This reverts commit 9a09a42369a4a37a959c051d8e1a1f948c1529a4.

The whole interface isn't thought through. Since this function can't
fail we actually can't allocate an object to store the sync point.

Sorry, I should have taken the lead on this from the very beginning and
reviewed it more thoughtfully. Going to propose a new interface as a
follow up change.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Link: https://patchwork.freedesktop.org/patch/265580/
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
drivers/gpu/drm/drm_syncobj.c
drivers/gpu/drm/i915/i915_gem_execbuffer.c
drivers/gpu/drm/v3d/v3d_gem.c
drivers/gpu/drm/vc4/vc4_gem.c
include/drm/drm_syncobj.h

index 024dfbd87f118beaa4384711fc986a579668a86a..dc54e9efd910f10ab4fc404bbb899d787958cc14 100644 (file)
@@ -1193,7 +1193,7 @@ static void amdgpu_cs_post_dependencies(struct amdgpu_cs_parser *p)
        int i;
 
        for (i = 0; i < p->num_post_dep_syncobjs; ++i)
-               drm_syncobj_replace_fence(p->post_dep_syncobjs[i], 0, p->fence);
+               drm_syncobj_replace_fence(p->post_dep_syncobjs[i], p->fence);
 }
 
 static int amdgpu_cs_submit(struct amdgpu_cs_parser *p,
index 5c5ba1f14307314d2a96d8ee996f37a271fb6ee8..db30a0e89db8f30825a8401d91aadc1b78a6c86e 100644 (file)
@@ -140,13 +140,11 @@ void drm_syncobj_remove_callback(struct drm_syncobj *syncobj,
 /**
  * drm_syncobj_replace_fence - replace fence in a sync object.
  * @syncobj: Sync object to replace fence in
- * @point: timeline point
  * @fence: fence to install in sync file.
  *
- * This replaces the fence on a sync object, or a timeline point fence.
+ * This replaces the fence on a sync object.
  */
 void drm_syncobj_replace_fence(struct drm_syncobj *syncobj,
-                              u64 point,
                               struct dma_fence *fence)
 {
        struct dma_fence *old_fence;
@@ -184,7 +182,7 @@ static void drm_syncobj_assign_null_handle(struct drm_syncobj *syncobj)
 {
        struct dma_fence *fence = dma_fence_get_stub();
 
-       drm_syncobj_replace_fence(syncobj, 0, fence);
+       drm_syncobj_replace_fence(syncobj, fence);
        dma_fence_put(fence);
 }
 
@@ -233,7 +231,7 @@ void drm_syncobj_free(struct kref *kref)
        struct drm_syncobj *syncobj = container_of(kref,
                                                   struct drm_syncobj,
                                                   refcount);
-       drm_syncobj_replace_fence(syncobj, 0, NULL);
+       drm_syncobj_replace_fence(syncobj, NULL);
        kfree(syncobj);
 }
 EXPORT_SYMBOL(drm_syncobj_free);
@@ -267,7 +265,7 @@ int drm_syncobj_create(struct drm_syncobj **out_syncobj, uint32_t flags,
                drm_syncobj_assign_null_handle(syncobj);
 
        if (fence)
-               drm_syncobj_replace_fence(syncobj, 0, fence);
+               drm_syncobj_replace_fence(syncobj, fence);
 
        *out_syncobj = syncobj;
        return 0;
@@ -452,7 +450,7 @@ static int drm_syncobj_import_sync_file_fence(struct drm_file *file_private,
                return -ENOENT;
        }
 
-       drm_syncobj_replace_fence(syncobj, 0, fence);
+       drm_syncobj_replace_fence(syncobj, fence);
        dma_fence_put(fence);
        drm_syncobj_put(syncobj);
        return 0;
@@ -923,7 +921,7 @@ drm_syncobj_reset_ioctl(struct drm_device *dev, void *data,
                return ret;
 
        for (i = 0; i < args->count_handles; i++)
-               drm_syncobj_replace_fence(syncobjs[i], 0, NULL);
+               drm_syncobj_replace_fence(syncobjs[i], NULL);
 
        drm_syncobj_array_free(syncobjs, args->count_handles);
 
index d4fac09095f862aed3131243957059de2df4f6b0..10a4afb4f23500dcac805a0c10f229149bb6ae85 100644 (file)
@@ -2191,7 +2191,7 @@ signal_fence_array(struct i915_execbuffer *eb,
                if (!(flags & I915_EXEC_FENCE_SIGNAL))
                        continue;
 
-               drm_syncobj_replace_fence(syncobj, 0, fence);
+               drm_syncobj_replace_fence(syncobj, fence);
        }
 }
 
index f565b197cba9bafc6dd9eb37de4d75c5c6451272..cb99e53f7607d9641e391df86f2743c75d9d9fcd 100644 (file)
@@ -609,8 +609,7 @@ v3d_submit_cl_ioctl(struct drm_device *dev, void *data,
        /* Update the return sync object for the */
        sync_out = drm_syncobj_find(file_priv, args->out_sync);
        if (sync_out) {
-               drm_syncobj_replace_fence(sync_out, 0,
-                                         exec->render_done_fence);
+               drm_syncobj_replace_fence(sync_out, exec->render_done_fence);
                drm_syncobj_put(sync_out);
        }
 
index 41881ce4132dd3cec5b1a6b214c386592d854761..aea2b8dfec1717648e1251c3610753dcf659679c 100644 (file)
@@ -681,7 +681,7 @@ vc4_queue_submit(struct drm_device *dev, struct vc4_exec_info *exec,
        exec->fence = &fence->base;
 
        if (out_sync)
-               drm_syncobj_replace_fence(out_sync, 0, exec->fence);
+               drm_syncobj_replace_fence(out_sync, exec->fence);
 
        vc4_update_bo_seqnos(exec, seqno);
 
index 2eda44def63902fff30b455d619d5f49385650a0..b1fe921f8e8f23132f1411e84a44a13e97411f69 100644 (file)
@@ -131,7 +131,7 @@ drm_syncobj_fence_get(struct drm_syncobj *syncobj)
 
 struct drm_syncobj *drm_syncobj_find(struct drm_file *file_private,
                                     u32 handle);
-void drm_syncobj_replace_fence(struct drm_syncobj *syncobj, u64 point,
+void drm_syncobj_replace_fence(struct drm_syncobj *syncobj,
                               struct dma_fence *fence);
 int drm_syncobj_find_fence(struct drm_file *file_private,
                           u32 handle, u64 point, u64 flags,