msm: vidc: fix f/w logging route

Fix to independently control f/w logging route.

Change-Id: I81b57995cb9619d2dee9c43547e86cc3f08d3778
Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
This commit is contained in:
Shi Zhongbo 2019-05-22 11:24:16 +08:00
commit cc5f9c5409
2 changed files with 24 additions and 3 deletions

View file

@ -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]);
}
}

View file

@ -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()) { \