msm: camera: memmgr: Set name for dma buffer to help profiling

For dma buffer profiling,we don't konw the owner of one dma
buffer. So we add it's name to show it's owner.
If you use v1 struct to alloc/map dma buffer it will use
default buffer name "UNKNOWN". For v2 struct you can set dma
buffer name at UMD side.

CRs-Fixed: 3131442
Change-Id: I24ce6aa1d97cd9fc26d9bd8796ab2367607008f6
Signed-off-by: Fengjie Chen <quic_fengjiec@quicinc.com>
这个提交包含在:
Fengjie Chen
2021-12-14 17:55:15 +08:00
提交者 Camera Software Integration
父节点 2e6c254487
当前提交 cf223fa7b3
修改 6 个文件,包含 170 行新增12 行删除

查看文件

@@ -5,6 +5,7 @@
*/
#include <linux/dma-mapping.h>
#include <linux/dma-buf.h>
#include <linux/of_address.h>
#include <linux/slab.h>
@@ -417,3 +418,19 @@ int cam_sensor_i3c_driver_remove(struct i3c_device *client)
return 0;
}
#endif
#if KERNEL_VERSION(5, 15, 0) <= LINUX_VERSION_CODE
long cam_dma_buf_set_name(struct dma_buf *dmabuf, const char *name)
{
long ret = 0;
ret = dma_buf_set_name(dmabuf, name);
return ret;
}
#else
long cam_dma_buf_set_name(struct dma_buf *dmabuf, const char *name)
{
return 0;
}
#endif

查看文件

@@ -65,4 +65,6 @@ int cam_req_mgr_ordered_list_cmp(void *priv,
int cam_sensor_i3c_driver_remove(struct i3c_device *client);
#endif
long cam_dma_buf_set_name(struct dma_buf *dmabuf, const char *name);
#endif /* _CAM_COMPAT_H_ */