diff options
author | Chanho Park <chanho61.park@samsung.com> | 2014-08-19 21:40:44 +0900 |
---|---|---|
committer | Chanho Park <chanho61.park@samsung.com> | 2014-11-21 19:12:21 +0900 |
commit | bd22612112ec179f4f2802161be296618b4d639b (patch) | |
tree | 73aa66448153f66d19f9347c4c3bd2a9dd818651 /include | |
parent | a200aa101a8d1365d04e8e3bd893fa9d654027f2 (diff) | |
download | linux-3.10-bd22612112ec179f4f2802161be296618b4d639b.tar.gz linux-3.10-bd22612112ec179f4f2802161be296618b4d639b.tar.bz2 linux-3.10-bd22612112ec179f4f2802161be296618b4d639b.zip |
Revert "dmabuf-sync: add buffer synchronization framework"
This reverts commit 7a9958fedb90ef4000b6461d77a5c6dfd795c1c1.
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/dma-buf.h | 16 | ||||
-rw-r--r-- | include/linux/dmabuf-sync.h | 178 |
2 files changed, 0 insertions, 194 deletions
diff --git a/include/linux/dma-buf.h b/include/linux/dma-buf.h index 01096736d17..dfac5ed3112 100644 --- a/include/linux/dma-buf.h +++ b/include/linux/dma-buf.h @@ -115,7 +115,6 @@ struct dma_buf_ops { * @exp_name: name of the exporter; useful for debugging. * @list_node: node for dma_buf accounting and debugging. * @priv: exporter specific private data for this buffer object. - * @sync: sync object linked to this dma-buf */ struct dma_buf { size_t size; @@ -129,7 +128,6 @@ struct dma_buf { const char *exp_name; struct list_head list_node; void *priv; - void *sync; }; /** @@ -150,20 +148,6 @@ struct dma_buf_attachment { void *priv; }; -#define DMA_BUF_ACCESS_R 0x1 -#define DMA_BUF_ACCESS_W 0x2 -#define DMA_BUF_ACCESS_DMA 0x4 -#define DMA_BUF_ACCESS_RW (DMA_BUF_ACCESS_R | DMA_BUF_ACCESS_W) -#define DMA_BUF_ACCESS_DMA_R (DMA_BUF_ACCESS_R | DMA_BUF_ACCESS_DMA) -#define DMA_BUF_ACCESS_DMA_W (DMA_BUF_ACCESS_W | DMA_BUF_ACCESS_DMA) -#define DMA_BUF_ACCESS_DMA_RW (DMA_BUF_ACCESS_DMA_R | DMA_BUF_ACCESS_DMA_W) -#define IS_VALID_DMA_BUF_ACCESS_TYPE(t) (t == DMA_BUF_ACCESS_R || \ - t == DMA_BUF_ACCESS_W || \ - t == DMA_BUF_ACCESS_DMA_R || \ - t == DMA_BUF_ACCESS_DMA_W || \ - t == DMA_BUF_ACCESS_RW || \ - t == DMA_BUF_ACCESS_DMA_RW) - /** * get_dma_buf - convenience wrapper for get_file. * @dmabuf: [in] pointer to dma_buf diff --git a/include/linux/dmabuf-sync.h b/include/linux/dmabuf-sync.h deleted file mode 100644 index 2502ad61a69..00000000000 --- a/include/linux/dmabuf-sync.h +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Copyright (C) 2013 Samsung Electronics Co.Ltd - * Authors: - * Inki Dae <inki.dae@samsung.com> - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - */ - -#include <linux/mutex.h> -#include <linux/sched.h> -#include <linux/dma-buf.h> - -enum dmabuf_sync_status { - DMABUF_SYNC_GOT = 1, - DMABUF_SYNC_LOCKED, -}; - -struct dmabuf_sync_reservation { - struct ww_mutex sync_lock; - struct mutex lock; - atomic_t shared_cnt; - unsigned int accessed_type; - unsigned int shared; - unsigned int locked; -}; - -/* - * A structure for dmabuf_sync_object. - * - * @head: A list head to be added to syncs list. - * @robj: A reservation_object object. - * @dma_buf: A dma_buf object. - * @access_type: Indicate how a current task tries to access - * a given buffer. - */ -struct dmabuf_sync_object { - struct list_head head; - struct dmabuf_sync_reservation *robj; - struct dma_buf *dmabuf; - unsigned int access_type; -}; - -/* - * A structure for dmabuf_sync. - * - * @syncs: A list head to sync object and this is global to system. - * @list: A list entry used as committed list node - * @lock: A mutex lock to current sync object. - * @ctx: A current context for ww mutex. - * @work: A work struct to release resources at timeout. - * @priv: A private data. - * @name: A string to dmabuf sync owner. - * @timer: A timer list to avoid lockup and release resources. - * @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; -}; - -#ifdef CONFIG_DMABUF_SYNC - -extern struct ww_class dmabuf_sync_ww_class; - -static inline void dmabuf_sync_reservation_init(struct dma_buf *dmabuf) -{ - struct dmabuf_sync_reservation *obj; - - obj = kzalloc(sizeof(*obj), GFP_KERNEL); - if (!obj) - return; - - dmabuf->sync = obj; - - ww_mutex_init(&obj->sync_lock, &dmabuf_sync_ww_class); - - mutex_init(&obj->lock); - atomic_set(&obj->shared_cnt, 1); -} - -static inline void dmabuf_sync_reservation_fini(struct dma_buf *dmabuf) -{ - struct dmabuf_sync_reservation *obj; - - if (!dmabuf->sync) - return; - - obj = dmabuf->sync; - - ww_mutex_destroy(&obj->sync_lock); - - kfree(obj); -} - -extern bool is_dmabuf_sync_supported(void); - -extern struct dmabuf_sync *dmabuf_sync_init(void *priv, const char *name); - -extern void dmabuf_sync_fini(struct dmabuf_sync *sync); - -extern int dmabuf_sync_lock(struct dmabuf_sync *sync); - -extern int dmabuf_sync_unlock(struct dmabuf_sync *sync); - -int dmabuf_sync_single_lock(struct dma_buf *dmabuf, unsigned int type, - bool wait); - -void dmabuf_sync_single_unlock(struct dma_buf *dmabuf); - -extern int dmabuf_sync_get(struct dmabuf_sync *sync, void *sync_buf, - unsigned int type); - -extern void dmabuf_sync_put(struct dmabuf_sync *sync, struct dma_buf *dmabuf); - -extern void dmabuf_sync_put_all(struct dmabuf_sync *sync); - -#else - -static inline void dmabuf_sync_reservation_init(struct dma_buf *dmabuf) { } - -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) -{ - return ERR_PTR(0); -} - -static inline void dmabuf_sync_fini(struct dmabuf_sync *sync) { } - -static inline int dmabuf_sync_lock(struct dmabuf_sync *sync) -{ - return 0; -} - -static inline int dmabuf_sync_unlock(struct dmabuf_sync *sync) -{ - return 0; -} - -static inline int dmabuf_sync_single_lock(struct dma_buf *dmabuf, - unsigned int type, - bool wait) -{ - return 0; -} - -static inline void dmabuf_sync_single_unlock(struct dma_buf *dmabuf) -{ - return; -} - -static inline int dmabuf_sync_get(struct dmabuf_sync *sync, - void *sync_buf, - unsigned int type) -{ - return 0; -} - -static inline void dmabuf_sync_put(struct dmabuf_sync *sync, - struct dma_buf *dmabuf) { } - -static inline void dmabuf_sync_put_all(struct dmabuf_sync *sync) { } - -#endif |