diff options
author | Inki Dae <inki.dae@samsung.com> | 2013-07-22 12:52:01 +0900 |
---|---|---|
committer | Chanho Park <chanho61.park@samsung.com> | 2014-11-18 11:43:40 +0900 |
commit | 8dd6e00ce4dc5d17f04c75b81fd3c0cd1eb71367 (patch) | |
tree | 4ec6cfaca62cff9b23cf419c573007cca8a5f636 /include | |
parent | acb487ebca1926a5db8ca8e35ef9dd87349845cb (diff) | |
download | linux-3.10-8dd6e00ce4dc5d17f04c75b81fd3c0cd1eb71367.tar.gz linux-3.10-8dd6e00ce4dc5d17f04c75b81fd3c0cd1eb71367.tar.bz2 linux-3.10-8dd6e00ce4dc5d17f04c75b81fd3c0cd1eb71367.zip |
dmabuf-sync: add private backend callbacks
This ops has just a free callback to release resource for each
device driver. free callback will be called when device driver's
sync object is freed. So device drivers should implement this callback
so that their own contexts can be cleaned up regarding sync object.
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/dmabuf-sync.h | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/include/linux/dmabuf-sync.h b/include/linux/dmabuf-sync.h index 963ba99088c..d4dcf4f84cd 100644 --- a/include/linux/dmabuf-sync.h +++ b/include/linux/dmabuf-sync.h @@ -43,6 +43,10 @@ struct dmabuf_sync_object { unsigned int access_type; }; +struct dmabuf_sync_priv_ops { + void (*free)(void *priv); +}; + /* * A structure for dmabuf_sync. * @@ -57,15 +61,16 @@ struct dmabuf_sync_object { * @status: Indicate current status (DMABUF_SYNC_GOT or DMABUF_SYNC_LOCKED). */ struct dmabuf_sync { - struct list_head syncs; - struct list_head list; - struct mutex lock; - struct ww_acquire_ctx ctx; - struct work_struct work; - void *priv; - char name[64]; - struct timer_list timer; - unsigned int status; + struct list_head syncs; + struct list_head list; + struct mutex lock; + struct ww_acquire_ctx ctx; + struct work_struct work; + void *priv; + struct dmabuf_sync_priv_ops *ops; + char name[64]; + struct timer_list timer; + unsigned int status; }; #ifdef CONFIG_DMABUF_SYNC @@ -104,7 +109,9 @@ static inline void dmabuf_sync_reservation_fini(struct dma_buf *dmabuf) extern bool is_dmabuf_sync_supported(void); -extern struct dmabuf_sync *dmabuf_sync_init(void *priv, const char *name); +extern struct dmabuf_sync *dmabuf_sync_init(const char *name, + struct dmabuf_sync_priv_ops *ops, + void *priv); extern void dmabuf_sync_fini(struct dmabuf_sync *sync); @@ -132,8 +139,9 @@ static inline void dmabuf_sync_reservation_fini(struct dma_buf *dmabuf) { } static inline bool is_dmabuf_sync_supported(void) { return false; } -static inline struct dmabuf_sync *dmabuf_sync_init(void *priv, - const char *names) +static inline struct dmabuf_sync *dmabuf_sync_init(const char *name, + struct dmabuf_sync_priv_ops *ops, + void *priv) { return ERR_PTR(0); } |