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

Commit b2df9318 authored by Vishwanath Raju K's avatar Vishwanath Raju K
Browse files

ion: msm: Add support for VMID_CP_CAMERA_ENCODE



Add necessary flags for secure encoder feature to
request this type of memory.

Change-Id: I81521ac8c9c1b1dd003c96998052a9f1b9ab8c11
Signed-off-by: default avatarVishwanath Raju K <vishk@codeaurora.org>
parent 2c35c274
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
/*
 * Copyright (C) 2011 Google, Inc
 * Copyright (c) 2011-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2011-2020, The Linux Foundation. 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 version 2 and
@@ -457,6 +457,8 @@ const char *msm_secure_vmid_to_string(int secure_vmid)
		return "VMID_CP_SPSS_SP_SHARED";
	case VMID_CP_SPSS_HLOS_SHARED:
		return "VMID_CP_SPSS_HLOS_SHARED";
	case VMID_CP_CAMERA_ENCODE:
		return "VMID_CP_CAMERA_ENCODE";
	case VMID_CP_CDSP:
		return "VMID_CP_CDSP";
	case VMID_CP_DSP_EXT:
+4 −1
Original line number Diff line number Diff line
/*
 *
 * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2017-2020, The Linux Foundation. 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 version 2 and
@@ -31,6 +31,7 @@ bool is_secure_vmid_valid(int vmid)
		vmid == VMID_CP_SPSS_SP ||
		vmid == VMID_CP_SPSS_SP_SHARED ||
		vmid == VMID_CP_SPSS_HLOS_SHARED ||
		vmid == VMID_CP_CAMERA_ENCODE ||
		vmid == VMID_CP_CDSP ||
		vmid == VMID_CP_DSP_EXT);
}
@@ -59,6 +60,8 @@ int get_secure_vmid(unsigned long flags)
		return VMID_CP_SPSS_SP_SHARED;
	if (flags & ION_FLAG_CP_SPSS_HLOS_SHARED)
		return VMID_CP_SPSS_HLOS_SHARED;
	if (flags & ION_FLAG_CP_CAMERA_ENCODE)
		return VMID_CP_CAMERA_ENCODE;
	if (flags & ION_FLAG_CP_CDSP)
		return VMID_CP_CDSP;
	if (flags & ION_FLAG_CP_DSP_EXT)
+2 −1
Original line number Diff line number Diff line
@@ -61,7 +61,8 @@ static bool is_cp_flag_present(unsigned long flags)
			ION_FLAG_CP_BITSTREAM |
			ION_FLAG_CP_PIXEL |
			ION_FLAG_CP_NON_PIXEL |
			ION_FLAG_CP_CAMERA);
			ION_FLAG_CP_CAMERA |
			ION_FLAG_CP_CAMERA_ENCODE);
}

static void ion_system_secure_heap_free(struct ion_buffer *buffer)
+2 −1
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ enum ion_heap_ids {
 * Flags to be used when allocating from the secure heap for
 * content protection
 */
#define ION_FLAG_CP_CAMERA_ENCODE	ION_BIT(14)
#define ION_FLAG_CP_DSP_EXT		ION_BIT(15)
/* ION_FLAG_POOL_FORCE_ALLOC uses ION_BIT(16) */
#define ION_FLAG_CP_TOUCH		ION_BIT(17)
@@ -72,7 +73,7 @@ enum ion_heap_ids {
#define ION_FLAG_CP_SPSS_HLOS_SHARED	ION_BIT(30)
/* ION_FLAG_SECURE uses ION_BIT(31) */

#define ION_FLAGS_CP_MASK	0x6FFE8000
#define ION_FLAGS_CP_MASK	0x6FFEC000

/**
 * Flag to allow non continguous allocation of memory from secure
+2 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2015-2020, The Linux Foundation. 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 version 2 and
@@ -41,6 +41,7 @@ enum vmid {
	VMID_CP_CAMERA_PREVIEW = 0x1D,
	VMID_CP_SPSS_SP_SHARED = 0x22,
	VMID_CP_SPSS_HLOS_SHARED = 0x24,
	VMID_CP_CAMERA_ENCODE = 0x29,
	VMID_CP_CDSP = 0x2A,
	VMID_CP_DSP_EXT = 0x2E,
	VMID_NAV = 0x2B,