msm: camera: memmgr: Use system movable heap if available

To provide more peak memory space for camera usecase, utilize
system-movable heap. This will first check in standard system
heap for allocation, if memory is not available, allocation will
happen from system-movable heap. As we can not keep memory from
system-movable heap to stay forever (which will regress memory
power features), need to be careful when allocating from this
heap. All camera userspace allocations' lifetime is at the
usecase boundary, so allocate userspace allocations from
system-movable heap if available, fallback to standard system
heap if not available. kmd internal allocations will most likely
stay forever, so allocate them only from standard system heap.

CRs-Fixed: 3450854
Change-Id: Ic6644dea04cb44bf963b6277205de8502bc34bd9
Signed-off-by: Pavan Kumar Chilamkurthi <quic_pchilamk@quicinc.com>
此提交包含在:
Pavan Kumar Chilamkurthi
2023-01-06 09:28:02 -08:00
提交者 Camera Software Integration
父節點 d8ac068e4d
當前提交 66619a991e
共有 2 個檔案被更改,包括 46 行新增10 行删除

查看文件

@@ -21,6 +21,12 @@ enum cam_mem_mgr_state {
CAM_MEM_MGR_INITIALIZED,
};
/*Enum for memory allocation initiator */
enum cam_mem_mgr_allocator {
CAM_MEMMGR_ALLOC_USER,
CAM_MEMMGR_ALLOC_KERNEL,
};
/*Enum for possible SMMU operations */
enum cam_smmu_mapping_client {
CAM_SMMU_MAPPING_USER,
@@ -91,11 +97,13 @@ struct cam_mem_buf_queue {
* allocations.
* @csf_version: Camera security framework version
* @system_heap: Handle to system heap
* @system_movable_heap: Handle to system movable heap
* @system_uncached_heap: Handle to system uncached heap
* @camera_heap: Handle to camera heap
* @camera_uncached_heap: Handle to camera uncached heap
* @secure_display_heap: Handle to secure display heap
* @ubwc_p_heap: Handle to ubwc-p heap
* @ubwc_p_movable_heap: Handle to ubwc-p movable heap
*/
struct cam_mem_table {
struct mutex m_lock;
@@ -108,11 +116,13 @@ struct cam_mem_table {
struct cam_csf_version csf_version;
#if IS_REACHABLE(CONFIG_DMABUF_HEAPS)
struct dma_heap *system_heap;
struct dma_heap *system_movable_heap;
struct dma_heap *system_uncached_heap;
struct dma_heap *camera_heap;
struct dma_heap *camera_uncached_heap;
struct dma_heap *secure_display_heap;
struct dma_heap *ubwc_p_heap;
struct dma_heap *ubwc_p_movable_heap;
#endif
};