Rename our kernel-internal DMA-BUF Heap headers. Remove header define our version of the heap helper buffer, which will not longer be used. Change-Id: Ib1c7f1c00aa922ef81b45f23306e91faab32be92 Signed-off-by: Chris Goldsworthy <cgoldswo@codeaurora.org>
70 lines
2.6 KiB
C
70 lines
2.6 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Copyright (c) 2020, The Linux Foundation. All rights reserved.
|
|
*/
|
|
#ifndef _MSM_DMA_HEAP_H
|
|
#define _MSM_DMA_HEAP_H
|
|
|
|
#include <linux/bits.h>
|
|
#include <linux/qcom_dma_heap_names.h>
|
|
#include <linux/err.h>
|
|
|
|
/* Heap flags */
|
|
#define MSM_DMA_HEAP_FLAG_CACHED BIT(1)
|
|
|
|
#define MSM_DMA_HEAP_FLAG_CP_TRUSTED_VM BIT(15)
|
|
/* Unused */
|
|
#define MSM_DMA_HEAP_FLAG_CP_TOUCH BIT(17)
|
|
#define MSM_DMA_HEAP_FLAG_CP_BITSTREAM BIT(18)
|
|
#define MSM_DMA_HEAP_FLAG_CP_PIXEL BIT(19)
|
|
#define MSM_DMA_HEAP_FLAG_CP_NON_PIXEL BIT(20)
|
|
#define MSM_DMA_HEAP_FLAG_CP_CAMERA BIT(21)
|
|
#define MSM_DMA_HEAP_FLAG_CP_HLOS BIT(22)
|
|
#define MSM_DMA_HEAP_FLAG_CP_SPSS_SP BIT(23)
|
|
#define MSM_DMA_HEAP_FLAG_CP_SPSS_SP_SHARED BIT(24)
|
|
#define MSM_DMA_HEAP_FLAG_CP_SEC_DISPLAY BIT(25)
|
|
#define MSM_DMA_HEAP_FLAG_CP_APP BIT(26)
|
|
#define MSM_DMA_HEAP_FLAG_CP_CAMERA_PREVIEW BIT(27)
|
|
/* Unused */
|
|
#define MSM_DMA_HEAP_FLAG_CP_CDSP BIT(29)
|
|
#define MSM_DMA_HEAP_FLAG_CP_SPSS_HLOS_SHARED BIT(30)
|
|
|
|
#define MSM_DMA_HEAP_FLAGS_CP_MASK GENMASK(30, 15)
|
|
|
|
/**
|
|
* dma_buf_heap_hyp_assign - wrapper function that hyp-assigns a dma_buf away from HLOS
|
|
* @buf: dma_buf to hyp-assign away from HLOS
|
|
* @dest_vmids: array of MSM_DMA_HEAP_FLAG VMIDs (as defined above)
|
|
* @dest_perms: array of PERM_READ/PERM_WRITE/PERM_EXEC permission bits (as
|
|
* defined in include/soc/qcom/secure_buffer.sh), such that
|
|
* dest_perms[i] specifies the permissions for VMID dest_vmids[i]
|
|
* @dest_nelems: number of elements in dest_vmids and dest_perms
|
|
*
|
|
* Return: Temporarily return -EINVAL whilst the functon isn't present. Otherwise, return
|
|
* 0 on success, or the negative value returned by hyp_assign_table() on failure.
|
|
*/
|
|
static inline int dma_buf_heap_hyp_assign(struct dma_buf *buf, int *dest_vmids, int *dest_perms,
|
|
int dest_nelems)
|
|
{
|
|
return -EINVAL;
|
|
}
|
|
|
|
/**
|
|
* dma_buf_heap_hyp_unassign - wrapper function that hyp-assigns a dma_buf back to HLOS
|
|
* @buf: dma_buf to hyp-assign back to HLOS
|
|
*
|
|
* This function takes a dma_buf, and re-assigns it to HLOS with RWX permissions (at the
|
|
* S2 level). The end-points to which the buffer was assigned to are tracked by the flags
|
|
* kept in the msm_heap_helper_buffer->flags field (the helper_buffer is accesed through
|
|
* dma_buf->priv), so the corresponding VMIDs don't need to be supplied as arguments.
|
|
*
|
|
* Return: Temporarily return -EINVAL whilst the functon isn't present. Otherwise, return
|
|
* 0 on success, or the negative value returned by hyp_assign_table() on failure.
|
|
*/
|
|
static inline int dma_buf_heap_hyp_unassign(struct dma_buf *buf)
|
|
{
|
|
return -EINVAL;
|
|
}
|
|
|
|
#endif /* _MSM_DMA_HEAP_H */
|