summaryrefslogtreecommitdiff
path: root/drivers/mxc
diff options
context:
space:
mode:
authorJason Chen <b02280@freescale.com>2012-01-11 14:03:42 +0800
committerJason Liu <r64343@freescale.com>2012-01-19 12:41:29 +0800
commitc283666f057a20e96340ed27de0c5c1172fd13bc (patch)
treeba36f127eefe931d4d2247b84e315a36d2794f1a /drivers/mxc
parent619c97387db67ce79f2f848e55dd425524b4b560 (diff)
ENGR00171731 ipuv3 dev: add time statistic for each task
add time statistic for each task Signed-off-by: Jason Chen <b02280@freescale.com>
Diffstat (limited to 'drivers/mxc')
-rw-r--r--drivers/mxc/ipu3/ipu_device.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/drivers/mxc/ipu3/ipu_device.c b/drivers/mxc/ipu3/ipu_device.c
index 9395d8a6661c..15d7d1119c79 100644
--- a/drivers/mxc/ipu3/ipu_device.c
+++ b/drivers/mxc/ipu3/ipu_device.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2005-2011 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright 2005-2012 Freescale Semiconductor, Inc. All Rights Reserved.
*/
/*
@@ -42,6 +42,8 @@
#include "ipu_regs.h"
#include "ipu_param_mem.h"
+#undef TIME_CALC
+
/* Strucutures and variables for exporting MXC IPU as device*/
typedef enum {
STATE_OK = 0,
@@ -1262,6 +1264,13 @@ int ipu_queue_task(struct ipu_task *task)
struct ipu_task_entry *tsk;
int ret;
u32 tmp_task_no;
+#ifdef TIME_CALC
+ struct timespec begin;
+ struct timespec end;
+ long time_per_frame;
+
+ getnstimeofday(&begin);
+#endif
tsk = create_task_entry(task);
if (IS_ERR(tsk))
@@ -1279,6 +1288,17 @@ int ipu_queue_task(struct ipu_task *task)
ret = queue_split_task(tsk);
else
ret = queue_task(tsk);
+
+#ifdef TIME_CALC
+ getnstimeofday(&end);
+ if (end.tv_sec > begin.tv_sec) {
+ time_per_frame = (end.tv_sec - begin.tv_sec) * NSEC_PER_SEC;
+ time_per_frame += end.tv_nsec;
+ } else
+ time_per_frame = end.tv_nsec;
+ time_per_frame -= begin.tv_nsec;
+ dev_info(tsk->dev, "task take time %ld us\n", time_per_frame/1000);
+#endif
done:
kfree(tsk);
return ret;