Browse Source

video: driver: introduction of new debug print

Introduce d_vpr_hs to print both VIDC_HIGH or
VIDC_STAT log.

Change-Id: Ie7bfa8df033b30689eca6ad6a4637978730eadf7
Signed-off-by: Ankush Mitra <[email protected]>
Ankush Mitra 2 years ago
parent
commit
908ab6358b

+ 2 - 0
driver/vidc/inc/msm_vidc_debug.h

@@ -130,6 +130,8 @@ enum vidc_msg_prio {
 #define d_vpr_t(__fmt, ...) dprintk_core(VIDC_PKT,  "pkt ", __fmt, ##__VA_ARGS__)
 #define d_vpr_b(__fmt, ...) dprintk_core(VIDC_BUS,  "bus ", __fmt, ##__VA_ARGS__)
 #define d_vpr_s(__fmt, ...) dprintk_core(VIDC_STAT, "stat", __fmt, ##__VA_ARGS__)
+#define d_vpr_hs(__fmt, ...) \
+	dprintk_core(VIDC_HIGH | VIDC_STAT, "high", __fmt, ##__VA_ARGS__)
 
 #define dprintk_ratelimit(__level, __level_str, __fmt, ...) \
 	do { \

+ 3 - 3
driver/vidc/src/msm_vidc_driver.c

@@ -309,7 +309,7 @@ int msm_vidc_add_buffer_stats(struct msm_vidc_inst *inst,
 	}
 	core = inst->core;
 
-	if (!(msm_vidc_debug & VIDC_STAT))
+	if (!(msm_vidc_debug & VIDC_LOW))
 		return 0;
 
 	/* stats applicable only to input & output buffers */
@@ -353,7 +353,7 @@ int msm_vidc_remove_buffer_stats(struct msm_vidc_inst *inst,
 	}
 	core = inst->core;
 
-	if (!(msm_vidc_debug & VIDC_STAT))
+	if (!(msm_vidc_debug & VIDC_LOW))
 		return 0;
 
 	/* stats applicable only to input & output buffers */
@@ -407,7 +407,7 @@ int msm_vidc_remove_buffer_stats(struct msm_vidc_inst *inst,
 		/* remove stats node */
 		if (remove_stat) {
 			list_del_init(&stats->list);
-			print_buffer_stats(VIDC_STAT, "stat", inst, stats);
+			print_buffer_stats(VIDC_LOW, "low ", inst, stats);
 			msm_vidc_pool_free(inst, stats);
 		}
 	}

+ 2 - 2
driver/vidc/src/resources.c

@@ -1222,9 +1222,9 @@ static int print_residency_stats(struct msm_vidc_core *core, struct clock_info *
 
 	/* print residency percent for each clock */
 	list_for_each_entry(residency, &cl->residency_list, list) {
-		d_vpr_h("%s: %s clock rate [%d] total %lluus residency %u%%\n",
+		d_vpr_hs("%s: %s clock rate [%d] total %lluus residency %u%%\n",
 			__func__, cl->name, residency->rate, residency->total_time_us,
-			residency->total_time_us * 100 / total_time_us);
+			(residency->total_time_us * 100 + total_time_us - 1) / total_time_us);
 	}
 
 	return rc;