From 4b609b3dd4a565231f4bf4d332092255757a7800 Mon Sep 17 00:00:00 2001 From: Mahesh Kumar Date: Tue, 5 Apr 2022 11:57:24 +0000 Subject: [PATCH] platform: dce: Add support for debug level logs Add support to print debug level dce logs. This is to reduce the number of prints spew by dce in kernel logs. Bug 3472984 Change-Id: Idaf0dbb3511ee92a632bb0be8c445212e228f8d5 Signed-off-by: Mahesh Kumar Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2692698 Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-cert Reviewed-by: svcacv Reviewed-by: svc_kernel_abi Reviewed-by: Arun Swain GVS: Gerrit_Virtual_Submit --- drivers/platform/tegra/dce/dce-util-common.c | 3 +++ drivers/platform/tegra/dce/include/dce-log.h | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/platform/tegra/dce/dce-util-common.c b/drivers/platform/tegra/dce/dce-util-common.c index f05d25c2..62d46b87 100644 --- a/drivers/platform/tegra/dce/dce-util-common.c +++ b/drivers/platform/tegra/dce/dce-util-common.c @@ -336,6 +336,9 @@ static void dce_print(const char *func_name, int line, #define DCE_LOG_FMT "dce: %15s:%-4d %s\n" switch (type) { + case DCE_DEBUG: + pr_debug(DCE_LOG_FMT, func_name, line, log); + break; case DCE_INFO: pr_info(DCE_LOG_FMT, func_name, line, log); break; diff --git a/drivers/platform/tegra/dce/include/dce-log.h b/drivers/platform/tegra/dce/include/dce-log.h index edad0386..52bc8e07 100644 --- a/drivers/platform/tegra/dce/include/dce-log.h +++ b/drivers/platform/tegra/dce/include/dce-log.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2019-2022, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -20,6 +20,7 @@ enum dce_log_type { DCE_ERROR, DCE_WARNING, DCE_INFO, + DCE_DEBUG, }; /* @@ -66,4 +67,16 @@ void dce_log_msg(struct tegra_dce *d, const char *func_name, int line, #define dce_info(d, fmt, arg...) \ dce_log_msg(d, __func__, __LINE__, DCE_INFO, fmt, ##arg) +/** + * dce_debug - Print a debug message + * + * @d - Pointer to tegra_dce. + * @fmt - A format string (printf style). + * @arg... - Arguments for the format string. + * + * print a debug message. + */ +#define dce_debug(d, fmt, arg...) \ + dce_log_msg(d, __func__, __LINE__, DCE_DEBUG, fmt, ##arg) + #endif