diff options
author | Inki Dae <inki.dae@samsung.com> | 2013-07-22 12:52:01 +0900 |
---|---|---|
committer | Marek Szyprowski <m.szyprowski@samsung.com> | 2014-05-15 07:20:54 +0200 |
commit | 280aad79070ccc58baadc6b6c80cc3c36cc48b3e (patch) | |
tree | 4c19d82ca11904d2bcac3646ee125783ab512663 /include | |
parent | 8acaa60cc42f763254f4bcd10c91e890aff2ce2c (diff) | |
download | linux-3.10-280aad79070ccc58baadc6b6c80cc3c36cc48b3e.tar.gz linux-3.10-280aad79070ccc58baadc6b6c80cc3c36cc48b3e.tar.bz2 linux-3.10-280aad79070ccc58baadc6b6c80cc3c36cc48b3e.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); } |