diff --git a/drivers/dma-buf/Kconfig b/drivers/dma-buf/Kconfig index 364b93e8460a..4cac8a1f7046 100644 --- a/drivers/dma-buf/Kconfig +++ b/drivers/dma-buf/Kconfig @@ -18,7 +18,7 @@ config SYNC_FILE Documentation/driver-api/sync_file.rst. config SW_SYNC - bool "Sync File Validation Framework" + tristate "Sync File Validation Framework" default n depends on SYNC_FILE help @@ -29,6 +29,13 @@ config SW_SYNC WARNING: improper use of this can result in deadlocking kernel drivers from userspace. Intended for test and debug only. +config SW_SYNC_DEBUG + bool "SW Sync Debug" + depends on DEBUG_FS && SW_SYNC && NO_GKI + default SW_SYNC + help + To get current fence point and timeline status. + config UDMABUF bool "userspace dmabuf misc driver" default n diff --git a/drivers/dma-buf/Makefile b/drivers/dma-buf/Makefile index 40d81f23cacf..32757328b317 100644 --- a/drivers/dma-buf/Makefile +++ b/drivers/dma-buf/Makefile @@ -4,7 +4,8 @@ obj-y := dma-buf.o dma-fence.o dma-fence-array.o dma-fence-chain.o \ obj-$(CONFIG_DMABUF_HEAPS) += dma-heap.o obj-$(CONFIG_DMABUF_HEAPS) += heaps/ obj-$(CONFIG_SYNC_FILE) += sync_file.o -obj-$(CONFIG_SW_SYNC) += sw_sync.o sync_debug.o +obj-$(CONFIG_SW_SYNC) += sw_sync.o +obj-$(CONFIG_SW_SYNC_DEBUG) += sync_debug.o obj-$(CONFIG_UDMABUF) += udmabuf.o obj-$(CONFIG_DMABUF_SYSFS_STATS) += dma-buf-sysfs-stats.o diff --git a/drivers/dma-buf/sync_debug.c b/drivers/dma-buf/sync_debug.c index a2f906741ce0..101394f16930 100644 --- a/drivers/dma-buf/sync_debug.c +++ b/drivers/dma-buf/sync_debug.c @@ -8,7 +8,6 @@ #include #include "sync_debug.h" -#ifdef CONFIG_DEBUG_FS static struct dentry *dbgfs; static LIST_HEAD(sync_timeline_list_head); @@ -189,4 +188,3 @@ static __init int sync_debugfs_init(void) return 0; } late_initcall(sync_debugfs_init); -#endif diff --git a/drivers/dma-buf/sync_debug.h b/drivers/dma-buf/sync_debug.h index ee84997da6b4..fb676da19755 100644 --- a/drivers/dma-buf/sync_debug.h +++ b/drivers/dma-buf/sync_debug.h @@ -62,9 +62,9 @@ struct sync_pt { struct rb_node node; }; -#ifdef CONFIG_DEBUG_FS extern const struct file_operations sw_sync_debugfs_fops; +#ifdef CONFIG_SW_SYNC_DEBUG void sync_timeline_debug_add(struct sync_timeline *obj); void sync_timeline_debug_remove(struct sync_timeline *obj); void sync_file_debug_add(struct sync_file *fence);