From 1b36b97f39a46ec44fc14c23596054a10a88c946 Mon Sep 17 00:00:00 2001 From: lijiawei Date: Tue, 26 Apr 2022 11:20:46 +0800 Subject: [PATCH] dmabuf: add dmabuf process info for debug issue: #I54AWN Signed-off-by: lijiawei --- linux-5.10/rk3568_patch/kernel.patch | 37 ++++++++++++++-------------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/linux-5.10/rk3568_patch/kernel.patch b/linux-5.10/rk3568_patch/kernel.patch index 9fdccc0..923cb29 100755 --- a/linux-5.10/rk3568_patch/kernel.patch +++ b/linux-5.10/rk3568_patch/kernel.patch @@ -128400,16 +128400,16 @@ index 3ca7de37d..dec5d6851 100644 diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c --- a/drivers/dma-buf/dma-buf.c +++ b/drivers/dma-buf/dma-buf.c -@@ -31,8 +31,6 @@ - +@@ -32,8 +32,6 @@ #include "dma-buf-sysfs-stats.h" + #include "dma-buf-process-info.h" -static inline int is_dma_buf_file(struct file *); - struct dma_buf_list { struct list_head head; struct mutex lock; -@@ -40,6 +38,30 @@ struct dma_buf_list { +@@ -41,6 +39,30 @@ struct dma_buf_list { static struct dma_buf_list db_list; @@ -128440,7 +128440,7 @@ diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c static char *dmabuffs_dname(struct dentry *dentry, char *buffer, int buflen) { struct dma_buf *dmabuf; -@@ -127,6 +149,54 @@ static struct file_system_type dma_buf_fs_type = { +@@ -128,6 +150,54 @@ static struct file_system_type dma_buf_fs_type = { .kill_sb = kill_anon_super, }; @@ -128495,7 +128495,7 @@ diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c static int dma_buf_mmap_internal(struct file *file, struct vm_area_struct *vma) { struct dma_buf *dmabuf; -@@ -145,7 +215,7 @@ static int dma_buf_mmap_internal(struct file *file, struct vm_area_struct *vma) +@@ -146,7 +216,7 @@ static int dma_buf_mmap_internal(struct file *file, struct vm_area_struct *vma) dmabuf->size >> PAGE_SHIFT) return -EINVAL; @@ -128504,7 +128504,7 @@ diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c } static loff_t dma_buf_llseek(struct file *file, loff_t offset, int whence) -@@ -440,10 +510,11 @@ static const struct file_operations dma_buf_fops = { +@@ -441,10 +511,11 @@ static const struct file_operations dma_buf_fops = { /* * is_dma_buf_file - Check if struct file* is associated with dma_buf */ @@ -128517,7 +128517,7 @@ diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c static struct file *dma_buf_getfile(struct dma_buf *dmabuf, int flags) { -@@ -1129,6 +1200,30 @@ int dma_buf_begin_cpu_access(struct dma_buf *dmabuf, +@@ -1131,6 +1202,30 @@ int dma_buf_begin_cpu_access(struct dma_buf *dmabuf, } EXPORT_SYMBOL_GPL(dma_buf_begin_cpu_access); @@ -128548,7 +128548,7 @@ diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c /** * dma_buf_end_cpu_access - Must be called after accessing a dma_buf from the * cpu in the kernel context. Calls end_cpu_access to allow exporter-specific -@@ -1155,6 +1250,21 @@ int dma_buf_end_cpu_access(struct dma_buf *dmabuf, +@@ -1157,6 +1252,21 @@ int dma_buf_end_cpu_access(struct dma_buf *dmabuf, } EXPORT_SYMBOL_GPL(dma_buf_end_cpu_access); @@ -128570,7 +128570,7 @@ diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c /** * dma_buf_mmap - Setup up a userspace mmap with the given vma -@@ -1283,6 +1393,32 @@ void dma_buf_vunmap(struct dma_buf *dmabuf, void *vaddr) +@@ -1285,6 +1395,32 @@ void dma_buf_vunmap(struct dma_buf *dmabuf, void *vaddr) } EXPORT_SYMBOL_GPL(dma_buf_vunmap); @@ -1649515,7 +1649515,7 @@ index 000000000..d97545560 + +#endif /* _LINUX_DMA_BUF_CACHE_H */ diff --git a/include/linux/dma-buf.h b/include/linux/dma-buf.h -index 957b398d3..f1242b50f 100644 +index 999316c58160..7dca05dcb771 100644 --- a/include/linux/dma-buf.h +++ b/include/linux/dma-buf.h @@ -209,6 +209,41 @@ struct dma_buf_ops { @@ -1649625,7 +1649625,7 @@ index 957b398d3..f1242b50f 100644 }; /** -@@ -293,8 +379,9 @@ struct dma_buf_ops { +@@ -295,8 +381,9 @@ struct dma_buf_ops { * @cb_excl: for userspace poll support * @cb_shared: for userspace poll support * @sysfs_entry: for exposing information about this buffer in sysfs. @@ -1649637,7 +1649637,7 @@ index 957b398d3..f1242b50f 100644 * * This represents a shared buffer, created by calling dma_buf_export(). The * userspace representation is a normal file descriptor, which can be created by -@@ -336,6 +423,9 @@ struct dma_buf { +@@ -342,6 +429,9 @@ struct dma_buf { struct kobject kobj; struct dma_buf *dmabuf; } *sysfs_entry; @@ -1649647,7 +1649647,7 @@ index 957b398d3..f1242b50f 100644 #endif }; -@@ -386,6 +476,9 @@ struct dma_buf_attach_ops { +@@ -392,6 +482,9 @@ struct dma_buf_attach_ops { * @importer_ops: importer operations for this attachment, if provided * dma_buf_map/unmap_attachment() must be called with the dma_resv lock held. * @importer_priv: importer specific attachment data. @@ -1649657,7 +1649657,7 @@ index 957b398d3..f1242b50f 100644 * * This structure holds the attachment information between the dma_buf buffer * and its user device(s). The list contains one attachment struct per device -@@ -406,6 +499,14 @@ struct dma_buf_attachment { +@@ -412,6 +505,14 @@ struct dma_buf_attachment { const struct dma_buf_attach_ops *importer_ops; void *importer_priv; void *priv; @@ -1649672,7 +1649672,7 @@ index 957b398d3..f1242b50f 100644 }; /** -@@ -483,6 +584,9 @@ dma_buf_attachment_is_dynamic(struct dma_buf_attachment *attach) +@@ -489,6 +590,9 @@ dma_buf_attachment_is_dynamic(struct dma_buf_attachment *attach) return !!attach->importer_ops; } @@ -1649682,7 +1649682,7 @@ index 957b398d3..f1242b50f 100644 struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf, struct device *dev); struct dma_buf_attachment * -@@ -507,11 +611,20 @@ void dma_buf_unmap_attachment(struct dma_buf_attachment *, struct sg_table *, +@@ -513,13 +617,21 @@ void dma_buf_unmap_attachment(struct dma_buf_attachment *, struct sg_table *, void dma_buf_move_notify(struct dma_buf *dma_buf); int dma_buf_begin_cpu_access(struct dma_buf *dma_buf, enum dma_data_direction dir); @@ -1649701,8 +1649701,9 @@ index 957b398d3..f1242b50f 100644 void dma_buf_vunmap(struct dma_buf *, void *vaddr); +int dma_buf_get_flags(struct dma_buf *dmabuf, unsigned long *flags); +int dma_buf_get_uuid(struct dma_buf *dmabuf, uuid_t *uuid); -+ - #endif /* __DMA_BUF_H__ */ + + #ifdef CONFIG_DMABUF_PROCESS_INFO + /** diff --git a/include/linux/dma-fence.h b/include/linux/dma-fence.h index 09e23adb3..9f12efaaa 100644 --- a/include/linux/dma-fence.h -- Gitee