From d0b95bb73b965eefa1446adc00a05fa9db0232e6 Mon Sep 17 00:00:00 2001 From: Zhen Chen Date: Thu, 28 Oct 2021 18:00:11 +0800 Subject: [PATCH] MALI: bifrost: fix compilation errors when CONFIG_DEBUG_FS is disabled Such as involving non_debuggable.config. Signed-off-by: Zhen Chen Change-Id: I4224a31169c2ce224d8cc2d6993f4ac3cd40d675 --- .../gpu/arm/bifrost/device/mali_kbase_device.c | 2 ++ .../bifrost/device/mali_kbase_device_internal.h | 10 ++++++++++ .../bifrost/mali_kbase_regs_history_debugfs.h | 17 +++++++++++++++++ 3 files changed, 29 insertions(+) diff --git a/drivers/gpu/arm/bifrost/device/mali_kbase_device.c b/drivers/gpu/arm/bifrost/device/mali_kbase_device.c index 1ebd8aa14f3a..08961d583034 100644 --- a/drivers/gpu/arm/bifrost/device/mali_kbase_device.c +++ b/drivers/gpu/arm/bifrost/device/mali_kbase_device.c @@ -395,6 +395,7 @@ void kbase_device_vinstr_term(struct kbase_device *kbdev) kbase_vinstr_term(kbdev->vinstr_ctx); } +#if defined(CONFIG_DEBUG_FS) && !IS_ENABLED(CONFIG_MALI_BIFROST_NO_MALI) int kbase_device_io_history_init(struct kbase_device *kbdev) { return kbase_io_history_init(&kbdev->io_history, @@ -405,6 +406,7 @@ void kbase_device_io_history_term(struct kbase_device *kbdev) { kbase_io_history_term(&kbdev->io_history); } +#endif int kbase_device_misc_register(struct kbase_device *kbdev) { diff --git a/drivers/gpu/arm/bifrost/device/mali_kbase_device_internal.h b/drivers/gpu/arm/bifrost/device/mali_kbase_device_internal.h index d422407901e3..b4c063ce5257 100644 --- a/drivers/gpu/arm/bifrost/device/mali_kbase_device_internal.h +++ b/drivers/gpu/arm/bifrost/device/mali_kbase_device_internal.h @@ -51,8 +51,18 @@ void kbase_device_hwcnt_virtualizer_term(struct kbase_device *kbdev); int kbase_device_list_init(struct kbase_device *kbdev); void kbase_device_list_term(struct kbase_device *kbdev); +#if defined(CONFIG_DEBUG_FS) && !IS_ENABLED(CONFIG_MALI_BIFROST_NO_MALI) int kbase_device_io_history_init(struct kbase_device *kbdev); void kbase_device_io_history_term(struct kbase_device *kbdev); +#else +static inline int kbase_device_io_history_init(struct kbase_device *kbdev) +{ + return 0; +} +static inline void kbase_device_io_history_term(struct kbase_device *kbdev) +{ +} +#endif int kbase_device_misc_register(struct kbase_device *kbdev); void kbase_device_misc_deregister(struct kbase_device *kbdev); diff --git a/drivers/gpu/arm/bifrost/mali_kbase_regs_history_debugfs.h b/drivers/gpu/arm/bifrost/mali_kbase_regs_history_debugfs.h index 75fbb47d5107..cbe602248836 100644 --- a/drivers/gpu/arm/bifrost/mali_kbase_regs_history_debugfs.h +++ b/drivers/gpu/arm/bifrost/mali_kbase_regs_history_debugfs.h @@ -70,6 +70,23 @@ void kbase_io_history_dump(struct kbase_device *kbdev); void kbasep_regs_history_debugfs_init(struct kbase_device *kbdev); #else /* defined(CONFIG_DEBUG_FS) && !IS_ENABLED(CONFIG_MALI_BIFROST_NO_MALI) */ +static inline int kbase_io_history_init(struct kbase_io_history *h, u16 n) +{ + return 0; +} + +static inline void kbase_io_history_term(struct kbase_io_history *h) +{ +} + +static inline void kbase_io_history_dump(struct kbase_device *kbdev) +{ +} + +static inline void kbasep_regs_history_debugfs_init(struct kbase_device *kbdev) +{ +} + #endif /* defined(CONFIG_DEBUG_FS) && !IS_ENABLED(CONFIG_MALI_BIFROST_NO_MALI) */ #endif /*_KBASE_REGS_HISTORY_DEBUGFS_H*/