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

Commit f77462f6 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ion: msm: Add support for VMID_CP_DSP_EXT"

parents cd5572e6 1bf23cb2
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
/*
 * Copyright (C) 2011 Google, Inc
 * Copyright (c) 2011-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2011-2019, 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
@@ -478,6 +478,10 @@ 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_CDSP:
		return "VMID_CP_CDSP";
	case VMID_CP_DSP_EXT:
		return "VMID_CP_DSP_EXT";
	case VMID_INVAL:
		return "VMID_INVAL";
	default:
+8 −3
Original line number Diff line number Diff line
@@ -31,7 +31,8 @@ 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_CDSP);
		vmid == VMID_CP_CDSP ||
		vmid == VMID_CP_DSP_EXT);
}

int get_secure_vmid(unsigned long flags)
@@ -60,6 +61,8 @@ int get_secure_vmid(unsigned long flags)
		return VMID_CP_SPSS_HLOS_SHARED;
	if (flags & ION_FLAG_CP_CDSP)
		return VMID_CP_CDSP;
	if (flags & ION_FLAG_CP_DSP_EXT)
		return VMID_CP_DSP_EXT;
	return -EINVAL;
}

@@ -159,7 +162,8 @@ int ion_hyp_assign_sg(struct sg_table *sgt, int *dest_vm_list,
	}

	for (i = 0; i < dest_nelems; i++) {
		if (dest_vm_list[i] == VMID_CP_SEC_DISPLAY)
		if (dest_vm_list[i] == VMID_CP_SEC_DISPLAY ||
		    dest_vm_list[i] == VMID_CP_DSP_EXT)
			dest_perms[i] = PERM_READ;
		else
			dest_perms[i] = PERM_READ | PERM_WRITE;
@@ -278,7 +282,8 @@ int ion_hyp_assign_from_flags(u64 base, u64 size, unsigned long flags)
	}

	for (i = 0; i < nr; i++)
		if (vmids[i] == VMID_CP_SEC_DISPLAY)
		if (vmids[i] == VMID_CP_SEC_DISPLAY ||
		    vmids[i] == VMID_CP_DSP_EXT)
			modes[i] = PERM_READ;
		else
			modes[i] = PERM_READ | PERM_WRITE;
+4 −1
Original line number Diff line number Diff line
@@ -54,6 +54,8 @@ enum ion_heap_ids {
 * Flags to be used when allocating from the secure heap for
 * content protection
 */
#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)
#define ION_FLAG_CP_BITSTREAM		ION_BIT(18)
#define ION_FLAG_CP_PIXEL		ION_BIT(19)
@@ -68,8 +70,9 @@ enum ion_heap_ids {
/* ION_FLAG_ALLOW_NON_CONTIG uses ION_BIT(28) */
#define ION_FLAG_CP_CDSP		ION_BIT(29)
#define ION_FLAG_CP_SPSS_HLOS_SHARED	ION_BIT(30)
/* ION_FLAG_SECURE uses ION_BIT(31) */

#define ION_FLAGS_CP_MASK	0x6FFE0000
#define ION_FLAGS_CP_MASK	0x6FFE8000

/**
 * Flag to allow non continguous allocation of memory from secure
+2 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2015-2019, 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
@@ -42,6 +42,7 @@ enum vmid {
	VMID_CP_SPSS_SP_SHARED = 0x22,
	VMID_CP_SPSS_HLOS_SHARED = 0x24,
	VMID_CP_CDSP = 0x2A,
	VMID_CP_DSP_EXT = 0x2E,
	VMID_LAST,
	VMID_INVAL = -1
};