summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorFancy Fang <B47543@freescale.com>2013-12-20 18:14:21 +0800
committerFancy Fang <B47543@freescale.com>2013-12-25 18:28:42 +0800
commit58fe030379580a22f5c4625cf14c064d1898895e (patch)
treed148ca6abdf1f5825e4128b06d8d784dc0e149ef /include
parentdd4e4530b272bb4aee38af13df3156a2757e1148 (diff)
ENGR00293119 PXP: change the dma buffer lists management for PXP device
Create pxp_info struct data for each opened device file descriptor. And bind all the allocated dma buffers to this struct for each opened file. This makes the dma buffer lists management safer, more effective and more flexible. Signed-off-by: Fancy Fang <B47543@freescale.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/pxp_device.h35
-rw-r--r--include/uapi/linux/pxp_device.h3
2 files changed, 31 insertions, 7 deletions
diff --git a/include/linux/pxp_device.h b/include/linux/pxp_device.h
index 38120d8c46a0..b3eb1c60ab97 100644
--- a/include/linux/pxp_device.h
+++ b/include/linux/pxp_device.h
@@ -19,14 +19,10 @@
#ifndef _PXP_DEVICE
#define _PXP_DEVICE
+#include <linux/idr.h>
+#include <linux/hash.h>
#include <uapi/linux/pxp_device.h>
-/* To track the allocated memory buffer */
-struct memalloc_record {
- struct list_head list;
- struct pxp_mem_desc mem;
-};
-
struct pxp_irq_info {
wait_queue_head_t waitq;
int irq_pending;
@@ -34,4 +30,31 @@ struct pxp_irq_info {
spinlock_t lock;
};
+struct pxp_buffer_hash {
+ struct hlist_head *hash_table;
+ u32 order;
+ spinlock_t hash_lock;
+};
+
+struct pxp_buf_obj {
+ uint32_t handle;
+
+ uint32_t size;
+ uint32_t mem_type;
+
+ unsigned long offset;
+ void *virtual;
+
+ struct hlist_node item;
+};
+
+/* File private data */
+struct pxp_file {
+ struct file *filp;
+
+ /* record allocated dma buffer */
+ struct idr buffer_idr;
+ spinlock_t buffer_lock;
+};
+
#endif
diff --git a/include/uapi/linux/pxp_device.h b/include/uapi/linux/pxp_device.h
index 4af108decfcf..80ac1880f139 100644
--- a/include/uapi/linux/pxp_device.h
+++ b/include/uapi/linux/pxp_device.h
@@ -27,9 +27,10 @@ struct pxp_chan_handle {
};
struct pxp_mem_desc {
+ unsigned int handle;
unsigned int size;
dma_addr_t phys_addr;
- unsigned int cpu_addr; /* cpu address to free the dma mem */
+ void *cpu_addr; /* cpu address to free the dma mem */
unsigned int virt_uaddr; /* virtual user space address */
};