Subversion Repositories Kolibri OS

Rev

Rev 6293 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6293 Rev 7143
Line 52... Line 52...
52
 * @unmap_dma_buf: decreases usecount of buffer, might deallocate scatter
52
 * @unmap_dma_buf: decreases usecount of buffer, might deallocate scatter
53
 *		   pages.
53
 *		   pages.
54
 * @release: release this buffer; to be called after the last dma_buf_put.
54
 * @release: release this buffer; to be called after the last dma_buf_put.
55
 * @begin_cpu_access: [optional] called before cpu access to invalidate cpu
55
 * @begin_cpu_access: [optional] called before cpu access to invalidate cpu
56
 * 		      caches and allocate backing storage (if not yet done)
56
 * 		      caches and allocate backing storage (if not yet done)
57
 * 		      respectively pin the objet into memory.
57
 * 		      respectively pin the object into memory.
58
 * @end_cpu_access: [optional] called after cpu access to flush caches.
58
 * @end_cpu_access: [optional] called after cpu access to flush caches.
59
 * @kmap_atomic: maps a page from the buffer into kernel address
59
 * @kmap_atomic: maps a page from the buffer into kernel address
60
 * 		 space, users may not block until the subsequent unmap call.
60
 * 		 space, users may not block until the subsequent unmap call.
61
 * 		 This callback must not sleep.
61
 * 		 This callback must not sleep.
62
 * @kunmap_atomic: [optional] unmaps a atomically mapped page from the buffer.
62
 * @kunmap_atomic: [optional] unmaps a atomically mapped page from the buffer.
Line 91... Line 91...
91
	 */
91
	 */
Line 92... Line 92...
92
 
92
 
93
	/* after final dma_buf_put() */
93
	/* after final dma_buf_put() */
Line 94... Line 94...
94
	void (*release)(struct dma_buf *);
94
	void (*release)(struct dma_buf *);
95
 
-
 
96
	int (*begin_cpu_access)(struct dma_buf *, size_t, size_t,
95
 
97
				enum dma_data_direction);
-
 
98
	void (*end_cpu_access)(struct dma_buf *, size_t, size_t,
96
	int (*begin_cpu_access)(struct dma_buf *, enum dma_data_direction);
99
			       enum dma_data_direction);
97
	int (*end_cpu_access)(struct dma_buf *, enum dma_data_direction);
100
	void *(*kmap_atomic)(struct dma_buf *, unsigned long);
98
	void *(*kmap_atomic)(struct dma_buf *, unsigned long);
101
	void (*kunmap_atomic)(struct dma_buf *, unsigned long, void *);
99
	void (*kunmap_atomic)(struct dma_buf *, unsigned long, void *);
Line 190... Line 188...
190
 * Increments the reference count on the dma-buf, needed in case of drivers
188
 * Increments the reference count on the dma-buf, needed in case of drivers
191
 * that either need to create additional references to the dmabuf on the
189
 * that either need to create additional references to the dmabuf on the
192
 * kernel side.  For example, an exporter that needs to keep a dmabuf ptr
190
 * kernel side.  For example, an exporter that needs to keep a dmabuf ptr
193
 * so that subsequent exports don't create a new dmabuf.
191
 * so that subsequent exports don't create a new dmabuf.
194
 */
192
 */
195
static inline void get_dma_buf(struct dma_buf *dmabuf)
-
 
196
{
-
 
197
	get_file(dmabuf->file);
-
 
198
}
-
 
Line 199... Line 193...
199
 
193
 
200
struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf,
194
struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf,
201
							struct device *dev);
195
							struct device *dev);
202
void dma_buf_detach(struct dma_buf *dmabuf,
196
void dma_buf_detach(struct dma_buf *dmabuf,
Line 210... Line 204...
210
 
204
 
211
struct sg_table *dma_buf_map_attachment(struct dma_buf_attachment *,
205
struct sg_table *dma_buf_map_attachment(struct dma_buf_attachment *,
212
					enum dma_data_direction);
206
					enum dma_data_direction);
213
void dma_buf_unmap_attachment(struct dma_buf_attachment *, struct sg_table *,
207
void dma_buf_unmap_attachment(struct dma_buf_attachment *, struct sg_table *,
214
				enum dma_data_direction);
208
				enum dma_data_direction);
215
int dma_buf_begin_cpu_access(struct dma_buf *dma_buf, size_t start, size_t len,
209
int dma_buf_begin_cpu_access(struct dma_buf *dma_buf,
216
			     enum dma_data_direction dir);
210
			     enum dma_data_direction dir);
217
void dma_buf_end_cpu_access(struct dma_buf *dma_buf, size_t start, size_t len,
211
int dma_buf_end_cpu_access(struct dma_buf *dma_buf,
218
			    enum dma_data_direction dir);
212
			   enum dma_data_direction dir);
219
void *dma_buf_kmap_atomic(struct dma_buf *, unsigned long);
213
void *dma_buf_kmap_atomic(struct dma_buf *, unsigned long);
220
void dma_buf_kunmap_atomic(struct dma_buf *, unsigned long, void *);
214
void dma_buf_kunmap_atomic(struct dma_buf *, unsigned long, void *);
221
void *dma_buf_kmap(struct dma_buf *, unsigned long);
215
void *dma_buf_kmap(struct dma_buf *, unsigned long);