diff mbox series

drm/syncobj: Drop add/remove_callback from driver interface

Message ID 20180822092905.19884-1-daniel.vetter@ffwll.ch (mailing list archive)
State New, archived
Headers show
Series drm/syncobj: Drop add/remove_callback from driver interface | expand

Commit Message

Daniel Vetter Aug. 22, 2018, 9:29 a.m. UTC
This is used for handling future fences. Currently no driver use
these, and I think given the new timeline fence proposed by KHR it
would be better to have a more abstract interface for future fences.
Could be something simple like a struct dma_future_fence plus a
function to add a callback or wait for the fence to materialize.

Then syncobj (and anything else really) could grow new functions to
expose these two drivers. Normal dma_fence would then keep the nice
guarantee that they will always signal (and through ordering, be
deadlock free). dma_future_fence would then be the tricky one.

This also fixes sphinx complaining about the kerneldoc.

Cc: Jason Ekstrand <jason@jlekstrand.net>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/drm_syncobj.c | 15 ---------------
 include/drm/drm_syncobj.h     |  5 -----
 2 files changed, 20 deletions(-)

Comments

Jason Ekstrand Aug. 22, 2018, 4:09 p.m. UTC | #1
Fine with me.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>

On Wed, Aug 22, 2018 at 4:29 AM Daniel Vetter <daniel.vetter@ffwll.ch>
wrote:

> This is used for handling future fences. Currently no driver use
> these, and I think given the new timeline fence proposed by KHR it
> would be better to have a more abstract interface for future fences.
> Could be something simple like a struct dma_future_fence plus a
> function to add a callback or wait for the fence to materialize.
>
> Then syncobj (and anything else really) could grow new functions to
> expose these two drivers. Normal dma_fence would then keep the nice
> guarantee that they will always signal (and through ordering, be
> deadlock free). dma_future_fence would then be the tricky one.
>
> This also fixes sphinx complaining about the kerneldoc.
>
> Cc: Jason Ekstrand <jason@jlekstrand.net>
> Cc: Dave Airlie <airlied@redhat.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  drivers/gpu/drm/drm_syncobj.c | 15 ---------------
>  include/drm/drm_syncobj.h     |  5 -----
>  2 files changed, 20 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c
> index adb3cb27d31e..3a8837c49639 100644
> --- a/drivers/gpu/drm/drm_syncobj.c
> +++ b/drivers/gpu/drm/drm_syncobj.c
> @@ -120,14 +120,6 @@ static int
> drm_syncobj_fence_get_or_add_callback(struct drm_syncobj *syncobj,
>         return ret;
>  }
>
> -/**
> - * drm_syncobj_add_callback - adds a callback to syncobj::cb_list
> - * @syncobj: Sync object to which to add the callback
> - * @cb: Callback to add
> - * @func: Func to use when initializing the drm_syncobj_cb struct
> - *
> - * This adds a callback to be called next time the fence is replaced
> - */
>  void drm_syncobj_add_callback(struct drm_syncobj *syncobj,
>                               struct drm_syncobj_cb *cb,
>                               drm_syncobj_func_t func)
> @@ -136,13 +128,7 @@ void drm_syncobj_add_callback(struct drm_syncobj
> *syncobj,
>         drm_syncobj_add_callback_locked(syncobj, cb, func);
>         spin_unlock(&syncobj->lock);
>  }
> -EXPORT_SYMBOL(drm_syncobj_add_callback);
>
> -/**
> - * drm_syncobj_add_callback - removes a callback to syncobj::cb_list
> - * @syncobj: Sync object from which to remove the callback
> - * @cb: Callback to remove
> - */
>  void drm_syncobj_remove_callback(struct drm_syncobj *syncobj,
>                                  struct drm_syncobj_cb *cb)
>  {
> @@ -150,7 +136,6 @@ void drm_syncobj_remove_callback(struct drm_syncobj
> *syncobj,
>         list_del_init(&cb->node);
>         spin_unlock(&syncobj->lock);
>  }
> -EXPORT_SYMBOL(drm_syncobj_remove_callback);
>
>  /**
>   * drm_syncobj_replace_fence - replace fence in a sync object.
> diff --git a/include/drm/drm_syncobj.h b/include/drm/drm_syncobj.h
> index 3980602472c0..e419c79ba94d 100644
> --- a/include/drm/drm_syncobj.h
> +++ b/include/drm/drm_syncobj.h
> @@ -131,11 +131,6 @@ drm_syncobj_fence_get(struct drm_syncobj *syncobj)
>
>  struct drm_syncobj *drm_syncobj_find(struct drm_file *file_private,
>                                      u32 handle);
> -void drm_syncobj_add_callback(struct drm_syncobj *syncobj,
> -                             struct drm_syncobj_cb *cb,
> -                             drm_syncobj_func_t func);
> -void drm_syncobj_remove_callback(struct drm_syncobj *syncobj,
> -                                struct drm_syncobj_cb *cb);
>  void drm_syncobj_replace_fence(struct drm_syncobj *syncobj,
>                                struct dma_fence *fence);
>  int drm_syncobj_find_fence(struct drm_file *file_private,
> --
> 2.18.0
>
>
<div dir="ltr"><div>Fine with me.</div><div><br></div><div>Reviewed-by: Jason Ekstrand &lt;<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>&gt;<br></div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Aug 22, 2018 at 4:29 AM Daniel Vetter &lt;<a href="mailto:daniel.vetter@ffwll.ch">daniel.vetter@ffwll.ch</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This is used for handling future fences. Currently no driver use<br>
these, and I think given the new timeline fence proposed by KHR it<br>
would be better to have a more abstract interface for future fences.<br>
Could be something simple like a struct dma_future_fence plus a<br>
function to add a callback or wait for the fence to materialize.<br>
<br>
Then syncobj (and anything else really) could grow new functions to<br>
expose these two drivers. Normal dma_fence would then keep the nice<br>
guarantee that they will always signal (and through ordering, be<br>
deadlock free). dma_future_fence would then be the tricky one.<br>
<br>
This also fixes sphinx complaining about the kerneldoc.<br>
<br>
Cc: Jason Ekstrand &lt;<a href="mailto:jason@jlekstrand.net" target="_blank">jason@jlekstrand.net</a>&gt;<br>
Cc: Dave Airlie &lt;<a href="mailto:airlied@redhat.com" target="_blank">airlied@redhat.com</a>&gt;<br>
Cc: Chris Wilson &lt;<a href="mailto:chris@chris-wilson.co.uk" target="_blank">chris@chris-wilson.co.uk</a>&gt;<br>
Signed-off-by: Daniel Vetter &lt;<a href="mailto:daniel.vetter@intel.com" target="_blank">daniel.vetter@intel.com</a>&gt;<br>
---<br>
 drivers/gpu/drm/drm_syncobj.c | 15 ---------------<br>
 include/drm/drm_syncobj.h     |  5 -----<br>
 2 files changed, 20 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c<br>
index adb3cb27d31e..3a8837c49639 100644<br>
--- a/drivers/gpu/drm/drm_syncobj.c<br>
+++ b/drivers/gpu/drm/drm_syncobj.c<br>
@@ -120,14 +120,6 @@ static int drm_syncobj_fence_get_or_add_callback(struct drm_syncobj *syncobj,<br>
        return ret;<br>
 }<br>
<br>
-/**<br>
- * drm_syncobj_add_callback - adds a callback to syncobj::cb_list<br>
- * @syncobj: Sync object to which to add the callback<br>
- * @cb: Callback to add<br>
- * @func: Func to use when initializing the drm_syncobj_cb struct<br>
- *<br>
- * This adds a callback to be called next time the fence is replaced<br>
- */<br>
 void drm_syncobj_add_callback(struct drm_syncobj *syncobj,<br>
                              struct drm_syncobj_cb *cb,<br>
                              drm_syncobj_func_t func)<br>
@@ -136,13 +128,7 @@ void drm_syncobj_add_callback(struct drm_syncobj *syncobj,<br>
        drm_syncobj_add_callback_locked(syncobj, cb, func);<br>
        spin_unlock(&amp;syncobj-&gt;lock);<br>
 }<br>
-EXPORT_SYMBOL(drm_syncobj_add_callback);<br>
<br>
-/**<br>
- * drm_syncobj_add_callback - removes a callback to syncobj::cb_list<br>
- * @syncobj: Sync object from which to remove the callback<br>
- * @cb: Callback to remove<br>
- */<br>
 void drm_syncobj_remove_callback(struct drm_syncobj *syncobj,<br>
                                 struct drm_syncobj_cb *cb)<br>
 {<br>
@@ -150,7 +136,6 @@ void drm_syncobj_remove_callback(struct drm_syncobj *syncobj,<br>
        list_del_init(&amp;cb-&gt;node);<br>
        spin_unlock(&amp;syncobj-&gt;lock);<br>
 }<br>
-EXPORT_SYMBOL(drm_syncobj_remove_callback);<br>
<br>
 /**<br>
  * drm_syncobj_replace_fence - replace fence in a sync object.<br>
diff --git a/include/drm/drm_syncobj.h b/include/drm/drm_syncobj.h<br>
index 3980602472c0..e419c79ba94d 100644<br>
--- a/include/drm/drm_syncobj.h<br>
+++ b/include/drm/drm_syncobj.h<br>
@@ -131,11 +131,6 @@ drm_syncobj_fence_get(struct drm_syncobj *syncobj)<br>
<br>
 struct drm_syncobj *drm_syncobj_find(struct drm_file *file_private,<br>
                                     u32 handle);<br>
-void drm_syncobj_add_callback(struct drm_syncobj *syncobj,<br>
-                             struct drm_syncobj_cb *cb,<br>
-                             drm_syncobj_func_t func);<br>
-void drm_syncobj_remove_callback(struct drm_syncobj *syncobj,<br>
-                                struct drm_syncobj_cb *cb);<br>
 void drm_syncobj_replace_fence(struct drm_syncobj *syncobj,<br>
                               struct dma_fence *fence);<br>
 int drm_syncobj_find_fence(struct drm_file *file_private,<br>
-- <br>
2.18.0<br>
<br>
</blockquote></div>
Daniel Vetter Aug. 22, 2018, 6:49 p.m. UTC | #2
On Wed, Aug 22, 2018 at 11:09:21AM -0500, Jason Ekstrand wrote:
> Fine with me.
> 
> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>

Thanks for the review, applied to drm-misc-next.
-Daniel

> 
> On Wed, Aug 22, 2018 at 4:29 AM Daniel Vetter <daniel.vetter@ffwll.ch>
> wrote:
> 
> > This is used for handling future fences. Currently no driver use
> > these, and I think given the new timeline fence proposed by KHR it
> > would be better to have a more abstract interface for future fences.
> > Could be something simple like a struct dma_future_fence plus a
> > function to add a callback or wait for the fence to materialize.
> >
> > Then syncobj (and anything else really) could grow new functions to
> > expose these two drivers. Normal dma_fence would then keep the nice
> > guarantee that they will always signal (and through ordering, be
> > deadlock free). dma_future_fence would then be the tricky one.
> >
> > This also fixes sphinx complaining about the kerneldoc.
> >
> > Cc: Jason Ekstrand <jason@jlekstrand.net>
> > Cc: Dave Airlie <airlied@redhat.com>
> > Cc: Chris Wilson <chris@chris-wilson.co.uk>
> > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> > ---
> >  drivers/gpu/drm/drm_syncobj.c | 15 ---------------
> >  include/drm/drm_syncobj.h     |  5 -----
> >  2 files changed, 20 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c
> > index adb3cb27d31e..3a8837c49639 100644
> > --- a/drivers/gpu/drm/drm_syncobj.c
> > +++ b/drivers/gpu/drm/drm_syncobj.c
> > @@ -120,14 +120,6 @@ static int
> > drm_syncobj_fence_get_or_add_callback(struct drm_syncobj *syncobj,
> >         return ret;
> >  }
> >
> > -/**
> > - * drm_syncobj_add_callback - adds a callback to syncobj::cb_list
> > - * @syncobj: Sync object to which to add the callback
> > - * @cb: Callback to add
> > - * @func: Func to use when initializing the drm_syncobj_cb struct
> > - *
> > - * This adds a callback to be called next time the fence is replaced
> > - */
> >  void drm_syncobj_add_callback(struct drm_syncobj *syncobj,
> >                               struct drm_syncobj_cb *cb,
> >                               drm_syncobj_func_t func)
> > @@ -136,13 +128,7 @@ void drm_syncobj_add_callback(struct drm_syncobj
> > *syncobj,
> >         drm_syncobj_add_callback_locked(syncobj, cb, func);
> >         spin_unlock(&syncobj->lock);
> >  }
> > -EXPORT_SYMBOL(drm_syncobj_add_callback);
> >
> > -/**
> > - * drm_syncobj_add_callback - removes a callback to syncobj::cb_list
> > - * @syncobj: Sync object from which to remove the callback
> > - * @cb: Callback to remove
> > - */
> >  void drm_syncobj_remove_callback(struct drm_syncobj *syncobj,
> >                                  struct drm_syncobj_cb *cb)
> >  {
> > @@ -150,7 +136,6 @@ void drm_syncobj_remove_callback(struct drm_syncobj
> > *syncobj,
> >         list_del_init(&cb->node);
> >         spin_unlock(&syncobj->lock);
> >  }
> > -EXPORT_SYMBOL(drm_syncobj_remove_callback);
> >
> >  /**
> >   * drm_syncobj_replace_fence - replace fence in a sync object.
> > diff --git a/include/drm/drm_syncobj.h b/include/drm/drm_syncobj.h
> > index 3980602472c0..e419c79ba94d 100644
> > --- a/include/drm/drm_syncobj.h
> > +++ b/include/drm/drm_syncobj.h
> > @@ -131,11 +131,6 @@ drm_syncobj_fence_get(struct drm_syncobj *syncobj)
> >
> >  struct drm_syncobj *drm_syncobj_find(struct drm_file *file_private,
> >                                      u32 handle);
> > -void drm_syncobj_add_callback(struct drm_syncobj *syncobj,
> > -                             struct drm_syncobj_cb *cb,
> > -                             drm_syncobj_func_t func);
> > -void drm_syncobj_remove_callback(struct drm_syncobj *syncobj,
> > -                                struct drm_syncobj_cb *cb);
> >  void drm_syncobj_replace_fence(struct drm_syncobj *syncobj,
> >                                struct dma_fence *fence);
> >  int drm_syncobj_find_fence(struct drm_file *file_private,
> > --
> > 2.18.0
> >
> >
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c
index adb3cb27d31e..3a8837c49639 100644
--- a/drivers/gpu/drm/drm_syncobj.c
+++ b/drivers/gpu/drm/drm_syncobj.c
@@ -120,14 +120,6 @@  static int drm_syncobj_fence_get_or_add_callback(struct drm_syncobj *syncobj,
 	return ret;
 }
 
-/**
- * drm_syncobj_add_callback - adds a callback to syncobj::cb_list
- * @syncobj: Sync object to which to add the callback
- * @cb: Callback to add
- * @func: Func to use when initializing the drm_syncobj_cb struct
- *
- * This adds a callback to be called next time the fence is replaced
- */
 void drm_syncobj_add_callback(struct drm_syncobj *syncobj,
 			      struct drm_syncobj_cb *cb,
 			      drm_syncobj_func_t func)
@@ -136,13 +128,7 @@  void drm_syncobj_add_callback(struct drm_syncobj *syncobj,
 	drm_syncobj_add_callback_locked(syncobj, cb, func);
 	spin_unlock(&syncobj->lock);
 }
-EXPORT_SYMBOL(drm_syncobj_add_callback);
 
-/**
- * drm_syncobj_add_callback - removes a callback to syncobj::cb_list
- * @syncobj: Sync object from which to remove the callback
- * @cb: Callback to remove
- */
 void drm_syncobj_remove_callback(struct drm_syncobj *syncobj,
 				 struct drm_syncobj_cb *cb)
 {
@@ -150,7 +136,6 @@  void drm_syncobj_remove_callback(struct drm_syncobj *syncobj,
 	list_del_init(&cb->node);
 	spin_unlock(&syncobj->lock);
 }
-EXPORT_SYMBOL(drm_syncobj_remove_callback);
 
 /**
  * drm_syncobj_replace_fence - replace fence in a sync object.
diff --git a/include/drm/drm_syncobj.h b/include/drm/drm_syncobj.h
index 3980602472c0..e419c79ba94d 100644
--- a/include/drm/drm_syncobj.h
+++ b/include/drm/drm_syncobj.h
@@ -131,11 +131,6 @@  drm_syncobj_fence_get(struct drm_syncobj *syncobj)
 
 struct drm_syncobj *drm_syncobj_find(struct drm_file *file_private,
 				     u32 handle);
-void drm_syncobj_add_callback(struct drm_syncobj *syncobj,
-			      struct drm_syncobj_cb *cb,
-			      drm_syncobj_func_t func);
-void drm_syncobj_remove_callback(struct drm_syncobj *syncobj,
-				 struct drm_syncobj_cb *cb);
 void drm_syncobj_replace_fence(struct drm_syncobj *syncobj,
 			       struct dma_fence *fence);
 int drm_syncobj_find_fence(struct drm_file *file_private,