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

Commit 4d250f36 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: ion: Allow multi-vmid allocations assigned to non-secure vmids"

parents 0b14aa35 acc4a03e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -293,6 +293,7 @@ long msm_ion_custom_ioctl(struct ion_client *client,

int ion_heap_is_system_secure_heap_type(enum ion_heap_type type);
int get_secure_vmid(unsigned long flags);
int get_vmid(unsigned long flags);
bool is_secure_vmid_valid(int vmid);
unsigned int count_set_bits(unsigned long val);
int populate_vm_list(unsigned long flags, unsigned int *vm_list, int nelems);
+14 −1
Original line number Diff line number Diff line
@@ -638,7 +638,7 @@ int populate_vm_list(unsigned long flags, unsigned int *vm_list,

	flags = flags & ION_FLAGS_CP_MASK;
	for_each_set_bit(itr, &flags, BITS_PER_LONG) {
		vmid = get_secure_vmid(0x1UL << itr);
		vmid = get_vmid(0x1UL << itr);
		if (vmid < 0 || !nelems)
			return -EINVAL;

@@ -674,6 +674,19 @@ int get_secure_vmid(unsigned long flags)
		return VMID_CP_SPSS_HLOS_SHARED;
	return -EINVAL;
}

int get_vmid(unsigned long flags)
{
	int vmid;

	vmid = get_secure_vmid(flags);
	if (vmid < 0) {
		if (flags & ION_FLAG_CP_HLOS)
			vmid = VMID_HLOS;
	}
	return vmid;
}

/* fix up the cases where the ioctl direction bits are incorrect */
static unsigned int msm_ion_ioctl_dir(unsigned int cmd)
{