mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 21:22:09 -04:00
Merge "ion: msm: Add support for mapping VMIDs to ION flags"
This commit is contained in:
commit
08b5802cf3
2 changed files with 39 additions and 2 deletions
|
|
@ -1,6 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/slab.h>
|
||||
|
|
@ -53,6 +53,36 @@ int get_secure_vmid(unsigned long flags)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
int get_ion_flags(u32 vmid)
|
||||
{
|
||||
if (vmid == VMID_CP_TOUCH)
|
||||
return ION_FLAG_CP_TOUCH;
|
||||
if (vmid == VMID_CP_BITSTREAM)
|
||||
return ION_FLAG_CP_BITSTREAM;
|
||||
if (vmid == VMID_CP_PIXEL)
|
||||
return ION_FLAG_CP_PIXEL;
|
||||
if (vmid == VMID_CP_NON_PIXEL)
|
||||
return ION_FLAG_CP_NON_PIXEL;
|
||||
if (vmid == VMID_CP_CAMERA)
|
||||
return ION_FLAG_CP_CAMERA;
|
||||
if (vmid == VMID_CP_SEC_DISPLAY)
|
||||
return ION_FLAG_CP_SEC_DISPLAY;
|
||||
if (vmid == VMID_CP_APP)
|
||||
return ION_FLAG_CP_APP;
|
||||
if (vmid == VMID_CP_CAMERA_PREVIEW)
|
||||
return ION_FLAG_CP_CAMERA_PREVIEW;
|
||||
if (vmid == VMID_CP_SPSS_SP)
|
||||
return ION_FLAG_CP_SPSS_SP;
|
||||
if (vmid == VMID_CP_SPSS_SP_SHARED)
|
||||
return ION_FLAG_CP_SPSS_SP_SHARED;
|
||||
if (vmid == VMID_CP_SPSS_HLOS_SHARED)
|
||||
return ION_FLAG_CP_SPSS_HLOS_SHARED;
|
||||
if (vmid == VMID_CP_CDSP)
|
||||
return ION_FLAG_CP_CDSP;
|
||||
return -EINVAL;
|
||||
}
|
||||
EXPORT_SYMBOL(get_ion_flags);
|
||||
|
||||
static unsigned int count_set_bits(unsigned long val)
|
||||
{
|
||||
return ((unsigned int)bitmap_weight(&val, BITS_PER_LONG));
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* Copyright (c) 2019, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2019-2020, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef _MSM_ION_H
|
||||
|
|
@ -35,6 +35,8 @@ int msm_ion_heap_prefetch(int heap_id, struct ion_prefetch_region *regions,
|
|||
int msm_ion_heap_drain(int heap_id, struct ion_prefetch_region *regions,
|
||||
int nr_regions);
|
||||
|
||||
int get_ion_flags(u32 vmid);
|
||||
|
||||
#else
|
||||
|
||||
static inline struct device *msm_ion_heap_device_by_id(int heap_id)
|
||||
|
|
@ -67,5 +69,10 @@ static inline int msm_ion_heap_drain(int heap_id,
|
|||
return -ENODEV;
|
||||
}
|
||||
|
||||
static inline int get_ion_flags(u32 vmid)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_ION_MSM_HEAPS */
|
||||
#endif /* _MSM_ION_H */
|
||||
|
|
|
|||
Loading…
Reference in a new issue