From cc5f9c54092189af460883eef0579b3ed58879bc Mon Sep 17 00:00:00 2001 From: Shi Zhongbo Date: Wed, 22 May 2019 11:24:16 +0800 Subject: [PATCH] msm: vidc: fix f/w logging route Fix to independently control f/w logging route. Change-Id: I81b57995cb9619d2dee9c43547e86cc3f08d3778 Signed-off-by: Shi Zhongbo --- msm/vidc/hfi_common.c | 6 +++--- msm/vidc/msm_vidc_debug.h | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/msm/vidc/hfi_common.c b/msm/vidc/hfi_common.c index f3c6c71b37d3..3763385fcffa 100644 --- a/msm/vidc/hfi_common.c +++ b/msm/vidc/hfi_common.c @@ -3239,7 +3239,7 @@ static void __process_sys_error(struct venus_hfi_device *device) static void __flush_debug_queue(struct venus_hfi_device *device, u8 *packet) { bool local_packet = false; - enum vidc_msg_prio log_level = msm_vidc_debug; + enum vidc_msg_prio log_level = msm_vidc_debug & FW_LOGMASK; if (!device) { dprintk(VIDC_ERR, "%s: Invalid params\n", __func__); @@ -3260,7 +3260,7 @@ static void __flush_debug_queue(struct venus_hfi_device *device, u8 *packet) * Local packek is used when error occurred. * It is good to print these logs to printk as well. */ - log_level |= VIDC_PRINTK; + log_level |= FW_PRINTK; } while (!__iface_dbgq_read(device, packet)) { @@ -3286,7 +3286,7 @@ static void __flush_debug_queue(struct venus_hfi_device *device, u8 *packet) * from the message fixes this to print it in a single * line. */ - dprintk(log_level, "%s", &pkt->rg_msg_data[1]); + dprintk_firmware(log_level, "%s", &pkt->rg_msg_data[1]); } } diff --git a/msm/vidc/msm_vidc_debug.h b/msm/vidc/msm_vidc_debug.h index f34978288c23..181683965fbb 100644 --- a/msm/vidc/msm_vidc_debug.h +++ b/msm/vidc/msm_vidc_debug.h @@ -89,6 +89,27 @@ extern bool msm_vidc_cvp_usage; } \ } while (0) +#define dprintk_firmware(__level, __fmt, ...) \ + do { \ + if (msm_vidc_debug & __level) { \ + if (msm_vidc_debug & FW_FTRACE) { \ + char trace_logbuf[MAX_TRACER_LOG_LENGTH]; \ + int log_length = snprintf(trace_logbuf, \ + MAX_TRACER_LOG_LENGTH, \ + VIDC_DBG_TAG __fmt, \ + get_debug_level_str(__level), \ + ##__VA_ARGS__); \ + trace_msm_vidc_printf(trace_logbuf, \ + log_length); \ + } \ + if (msm_vidc_debug & FW_PRINTK) { \ + pr_info(VIDC_DBG_TAG __fmt, \ + get_debug_level_str(__level), \ + ##__VA_ARGS__); \ + } \ + } \ + } while (0) + #define dprintk_ratelimit(__level, __fmt, arg...) \ do { \ if (msm_vidc_check_ratelimit()) { \