mem-buf: Add accessor for current_vmid

Allow other modules to access this variable.

Change-Id: I4eb92e6ea7bed0fb854a7aafe355f33a09120389
Signed-off-by: Patrick Daly <quic_pdaly@quicinc.com>
This commit is contained in:
Patrick Daly 2022-06-08 19:41:33 -07:00 committed by Chris Goldsworthy
parent a375851b6a
commit 12058013a7
2 changed files with 11 additions and 0 deletions

View file

@ -82,6 +82,12 @@ struct mem_buf_vm *pdata_array[] = {
NULL, NULL,
}; };
int mem_buf_current_vmid(void)
{
return current_vmid;
}
EXPORT_SYMBOL(mem_buf_current_vmid);
/* /*
* Opening this file acquires a refcount on vm->dev's kobject - see * Opening this file acquires a refcount on vm->dev's kobject - see
* chrdev_open(). So private data won't be free'd out from * chrdev_open(). So private data won't be free'd out from

View file

@ -104,6 +104,7 @@ int mem_buf_reclaim(struct dma_buf *dmabuf);
void *mem_buf_alloc(struct mem_buf_allocation_data *alloc_data); void *mem_buf_alloc(struct mem_buf_allocation_data *alloc_data);
void mem_buf_free(void *membuf); void mem_buf_free(void *membuf);
struct gh_sgl_desc *mem_buf_get_sgl(void *membuf); struct gh_sgl_desc *mem_buf_get_sgl(void *membuf);
int mem_buf_current_vmid(void);
#else #else
static inline void *mem_buf_alloc(struct mem_buf_allocation_data *alloc_data) static inline void *mem_buf_alloc(struct mem_buf_allocation_data *alloc_data)
@ -117,6 +118,10 @@ static inline struct gh_sgl_desc *mem_buf_get_sgl(void *membuf)
{ {
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
} }
static inline int mem_buf_current_vmid(void)
{
return ERR_PTR(-EINVAL);
}
#endif /* CONFIG_QCOM_MEM_BUF */ #endif /* CONFIG_QCOM_MEM_BUF */