diff options
author | Fancy Fang <B47543@freescale.com> | 2013-12-24 16:05:53 +0800 |
---|---|---|
committer | Fancy Fang <B47543@freescale.com> | 2014-01-02 09:55:03 +0800 |
commit | af8c32d1d914ad07694713943123700893e602e5 (patch) | |
tree | 931434156ae8b4a37a70401e517ea6117215af48 /include | |
parent | 72b10ff276608203a7e933d195c5e348140ccea7 (diff) |
ENGR00293211 PXP: bind allocated DMA channels to opened device file descriptor
The allocated DMA channels via some opened file descriptor is better
to be bound to this descriptor. Since this can avoid some application
to fake a channel id which may be requested by other applications to
request PXP service. And also, this make it easier to release the dma
channel when application exists abnormally or forgets to release it
explicitly.
Signed-off-by: Fancy Fang <B47543@freescale.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/pxp_device.h | 11 | ||||
-rw-r--r-- | include/uapi/linux/pxp_device.h | 4 | ||||
-rw-r--r-- | include/uapi/linux/pxp_dma.h | 4 |
3 files changed, 14 insertions, 5 deletions
diff --git a/include/linux/pxp_device.h b/include/linux/pxp_device.h index b3eb1c60ab97..5881deb0e030 100644 --- a/include/linux/pxp_device.h +++ b/include/linux/pxp_device.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013 Freescale Semiconductor, Inc. All Rights Reserved. + * Copyright (C) 2013-2014 Freescale Semiconductor, Inc. All Rights Reserved. * * 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 @@ -48,6 +48,11 @@ struct pxp_buf_obj { struct hlist_node item; }; +struct pxp_chan_obj { + uint32_t handle; + struct dma_chan *chan; +}; + /* File private data */ struct pxp_file { struct file *filp; @@ -55,6 +60,10 @@ struct pxp_file { /* record allocated dma buffer */ struct idr buffer_idr; spinlock_t buffer_lock; + + /* record allocated dma channel */ + struct idr channel_idr; + spinlock_t channel_lock; }; #endif diff --git a/include/uapi/linux/pxp_device.h b/include/uapi/linux/pxp_device.h index 245b19e57156..e63a6e6eb418 100644 --- a/include/uapi/linux/pxp_device.h +++ b/include/uapi/linux/pxp_device.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013 Freescale Semiconductor, Inc. All Rights Reserved. + * Copyright (C) 2013-2014 Freescale Semiconductor, Inc. All Rights Reserved. * * 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 @@ -22,7 +22,7 @@ #include <linux/pxp_dma.h> struct pxp_chan_handle { - int chan_id; + unsigned int handle; int hist_status; }; diff --git a/include/uapi/linux/pxp_dma.h b/include/uapi/linux/pxp_dma.h index d1f7a89ecd15..1e462f4193d2 100644 --- a/include/uapi/linux/pxp_dma.h +++ b/include/uapi/linux/pxp_dma.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013 Freescale Semiconductor, Inc. All Rights Reserved. + * Copyright (C) 2013-2014 Freescale Semiconductor, Inc. All Rights Reserved. * * 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 @@ -166,7 +166,7 @@ struct pxp_config_data { int layer_nr; /* Users don't touch */ - int chan_id; + int handle; }; |