mem-buf: Add accessor for current_vmid

Allow other modules to access this variable.

Change-Id: I4eb92e6ea7bed0fb854a7aafe355f33a09120389
Signed-off-by: Patrick Daly <[email protected]>
This commit is contained in:
Patrick Daly authored and Chris Goldsworthy committed 2022-12-17 21:39:45 -08:00
1 parent a375851b6a
commit 12058013a7
2 files changed
+11

No files matched your search

+6
View File
@@ -82,6 +82,12 @@ struct mem_buf_vm *pdata_array[] = {
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
* chrdev_open(). So private data won't be free'd out from
+5
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_free(void *membuf);
struct gh_sgl_desc *mem_buf_get_sgl(void *membuf);
int mem_buf_current_vmid(void);
#else
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);
}
static inline int mem_buf_current_vmid(void)
{
return ERR_PTR(-EINVAL);
}
#endif /* CONFIG_QCOM_MEM_BUF */