diff options
author | Liam Mark <lmark@codeaurora.org> | 2016-09-22 11:30:51 -0700 |
---|---|---|
committer | Liam Mark <lmark@codeaurora.org> | 2016-09-30 10:25:26 -0700 |
commit | c156aa8e2a90bf7ef831f6f762fc23af9b9f7954 (patch) | |
tree | 6023c9b982dedfc450844513ccb481a3f360a693 /drivers | |
parent | 9b82a4c5896632b62140d1ddda55638fea254007 (diff) |
msm: secure_buffer: Add VMID_CP_CAMERA_PREVIEW
Add support for VMID_CP_CAMERA_PREVIEW
Change-Id: Ifacc1ff95262c6240283d19cf02dcac37933c141
Signed-off-by: Liam Mark <lmark@codeaurora.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/soc/qcom/secure_buffer.c | 2 | ||||
-rw-r--r-- | drivers/staging/android/ion/msm/msm_ion.c | 5 | ||||
-rw-r--r-- | drivers/staging/android/uapi/msm_ion.h | 32 |
3 files changed, 24 insertions, 15 deletions
diff --git a/drivers/soc/qcom/secure_buffer.c b/drivers/soc/qcom/secure_buffer.c index e7dbcac064aa..d9ebc1edda9c 100644 --- a/drivers/soc/qcom/secure_buffer.c +++ b/drivers/soc/qcom/secure_buffer.c @@ -418,6 +418,8 @@ const char *msm_secure_vmid_to_string(int secure_vmid) return "VMID_WLAN"; case VMID_WLAN_CE: return "VMID_WLAN_CE"; + case VMID_CP_CAMERA_PREVIEW: + return "VMID_CP_CAMERA_PREVIEW"; case VMID_INVAL: return "VMID_INVAL"; default: diff --git a/drivers/staging/android/ion/msm/msm_ion.c b/drivers/staging/android/ion/msm/msm_ion.c index cd420c429031..592c603b1780 100644 --- a/drivers/staging/android/ion/msm/msm_ion.c +++ b/drivers/staging/android/ion/msm/msm_ion.c @@ -632,7 +632,8 @@ bool is_secure_vmid_valid(int vmid) vmid == VMID_CP_NON_PIXEL || vmid == VMID_CP_CAMERA || vmid == VMID_CP_SEC_DISPLAY || - vmid == VMID_CP_APP); + vmid == VMID_CP_APP || + vmid == VMID_CP_CAMERA_PREVIEW); } int get_secure_vmid(unsigned long flags) @@ -651,6 +652,8 @@ int get_secure_vmid(unsigned long flags) return VMID_CP_SEC_DISPLAY; if (flags & ION_FLAG_CP_APP) return VMID_CP_APP; + if (flags & ION_FLAG_CP_CAMERA_PREVIEW) + return VMID_CP_CAMERA_PREVIEW; return -EINVAL; } /* fix up the cases where the ioctl direction bits are incorrect */ diff --git a/drivers/staging/android/uapi/msm_ion.h b/drivers/staging/android/uapi/msm_ion.h index b3c29826834e..54a4672ff143 100644 --- a/drivers/staging/android/uapi/msm_ion.h +++ b/drivers/staging/android/uapi/msm_ion.h @@ -3,6 +3,8 @@ #include "ion.h" +#define ION_BIT(nr) (1UL << (nr)) + enum msm_ion_heap_types { ION_HEAP_TYPE_MSM_START = ION_HEAP_TYPE_CUSTOM + 1, ION_HEAP_TYPE_SECURE_DMA = ION_HEAP_TYPE_MSM_START, @@ -76,39 +78,41 @@ enum cp_mem_usage { * Flags to be used when allocating from the secure heap for * content protection */ -#define ION_FLAG_CP_TOUCH (1 << 17) -#define ION_FLAG_CP_BITSTREAM (1 << 18) -#define ION_FLAG_CP_PIXEL (1 << 19) -#define ION_FLAG_CP_NON_PIXEL (1 << 20) -#define ION_FLAG_CP_CAMERA (1 << 21) -#define ION_FLAG_CP_HLOS (1 << 22) -#define ION_FLAG_CP_HLOS_FREE (1 << 23) -#define ION_FLAG_CP_SEC_DISPLAY (1 << 25) -#define ION_FLAG_CP_APP (1 << 26) +#define ION_FLAG_CP_TOUCH ION_BIT(17) +#define ION_FLAG_CP_BITSTREAM ION_BIT(18) +#define ION_FLAG_CP_PIXEL ION_BIT(19) +#define ION_FLAG_CP_NON_PIXEL ION_BIT(20) +#define ION_FLAG_CP_CAMERA ION_BIT(21) +#define ION_FLAG_CP_HLOS ION_BIT(22) +#define ION_FLAG_CP_HLOS_FREE ION_BIT(23) +#define ION_FLAG_CP_SEC_DISPLAY ION_BIT(25) +#define ION_FLAG_CP_APP ION_BIT(26) +#define ION_FLAG_CP_CAMERA_PREVIEW ION_BIT(27) + /** * Flag to allow non continguous allocation of memory from secure * heap */ -#define ION_FLAG_ALLOW_NON_CONTIG (1 << 24) +#define ION_FLAG_ALLOW_NON_CONTIG ION_BIT(24) /** * Flag to use when allocating to indicate that a heap is secure. */ -#define ION_FLAG_SECURE (1 << ION_HEAP_ID_RESERVED) +#define ION_FLAG_SECURE ION_BIT(ION_HEAP_ID_RESERVED) /** * Flag for clients to force contiguous memort allocation * * Use of this flag is carefully monitored! */ -#define ION_FLAG_FORCE_CONTIGUOUS (1 << 30) +#define ION_FLAG_FORCE_CONTIGUOUS ION_BIT(30) /* * Used in conjunction with heap which pool memory to force an allocation * to come from the page allocator directly instead of from the pool allocation */ -#define ION_FLAG_POOL_FORCE_ALLOC (1 << 16) +#define ION_FLAG_POOL_FORCE_ALLOC ION_BIT(16) /** * Deprecated! Please use the corresponding ION_FLAG_* @@ -119,7 +123,7 @@ enum cp_mem_usage { /** * Macro should be used with ion_heap_ids defined above. */ -#define ION_HEAP(bit) (1 << (bit)) +#define ION_HEAP(bit) ION_BIT(bit) #define ION_ADSP_HEAP_NAME "adsp" #define ION_SYSTEM_HEAP_NAME "system" |