Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f977c112 authored by Ahmed Abdul-Salam's avatar Ahmed Abdul-Salam
Browse files

msm: VPU: Fix handling of secure video buffers



VPU hardware can process content protetcted video in secure buffers.
Fixed control to enable secure content, and using correct ION heap.

Change-Id: I3bf3d06c533ed6a4f4b73c569f6c530b103e7a43
Signed-off-by: default avatarAhmed Abdul-Salam <aabdulsa@codeaurora.org>
parent 28a50082
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -467,6 +467,7 @@ static struct vpu_ctrl_desc ctrl_descriptors[VPU_CTRL_ID_MAX] = {
	},
	[VPU_CTRL_CONTENT_PROTECTION] = {
		.name = "Content Protection",
		.api_size = sizeof(__s32),
		.set_function =
			(custom_set_function) vpu_set_content_protection,
		.get_function =
+6 −3
Original line number Diff line number Diff line
@@ -751,6 +751,7 @@ static int __vpu_mem_map_handle(struct vpu_mem_handle *handle, u32 device_id,
		domain_number = handle->domain_num[device_id];

		if (handle->flags & MEM_SECURE) { /* handle secure buffers */
			pr_debug("Securing ION buffer\n");
			align = SZ_1M;
			ret = msm_ion_secure_buffer(ion_client, ion_handle,
					VIDEO_PIXEL, 0);
@@ -858,12 +859,14 @@ int vpu_mem_alloc(void *mem_handle, u32 size, bool secure)
		align = SZ_4K;
		heap_mask = ION_HEAP(ION_SYSTEM_CONTIG_HEAP_ID);
	} else {
		heap_mask = ION_HEAP(ION_IOMMU_HEAP_ID);
		if (flags & MEM_SECURE)
		if (flags & MEM_SECURE) {
			heap_mask = ION_HEAP(ION_CP_MM_HEAP_ID);
			align = SZ_1M;
		else
		} else {
			heap_mask = ION_HEAP(ION_IOMMU_HEAP_ID);
			align = SZ_4K;
		}
	}

	ion_handle = ion_alloc(ion_client, ALIGN(size, align), align,
			heap_mask, flags);