viddec3test: add profiling for render times
authorRob Clark <rob@ti.com>
Tue, 31 Jan 2012 16:27:26 +0000 (10:27 -0600)
committerRob Clark <rob@ti.com>
Tue, 31 Jan 2012 16:27:26 +0000 (10:27 -0600)
util/util.h
viddec3test.c

index cba6234b73dd131228a2444e96bea0966bbfb08a..23e423391e1ba9849a972a909eb255000244136d 100644 (file)
@@ -177,7 +177,9 @@ mark(long *last)
        struct timeval t;
        gettimeofday(&t, NULL);
        if (last) {
        struct timeval t;
        gettimeofday(&t, NULL);
        if (last) {
-               return t.tv_usec - *last;
+               long delta = t.tv_usec - *last;
+               *last = t.tv_usec;
+               return delta;
        }
        return t.tv_usec;
 }
        }
        return t.tv_usec;
 }
index 6ee59fd700037cd95ef359abcf1597215f4dfe76..9e0fa0476e9368195039df81d0b58f1cb6f17098 100644 (file)
@@ -64,6 +64,7 @@ main(int argc, char **argv)
        XDM2_BufDesc *outBufs;
        VIDDEC3_InArgs *inArgs;
        VIDDEC3_OutArgs *outArgs;
        XDM2_BufDesc *outBufs;
        VIDDEC3_InArgs *inArgs;
        VIDDEC3_OutArgs *outArgs;
+       suseconds_t tdisp;
 
        MSG("Opening Display..");
        disp = disp_open(argc, argv);
 
        MSG("Opening Display..");
        disp = disp_open(argc, argv);
@@ -199,10 +200,12 @@ main(int argc, char **argv)
        outArgs = dce_alloc(sizeof(IVIDDEC3_OutArgs));
        outArgs->size = sizeof(IVIDDEC3_OutArgs);
 
        outArgs = dce_alloc(sizeof(IVIDDEC3_OutArgs));
        outArgs->size = sizeof(IVIDDEC3_OutArgs);
 
+       tdisp = mark(NULL);
+
        while (inBufs->numBufs && outBufs->numBufs) {
                struct buffer *buf;
                int n;
        while (inBufs->numBufs && outBufs->numBufs) {
                struct buffer *buf;
                int n;
-               suseconds_t t;
+               suseconds_t tproc;
 
                buf = disp_get_vid_buffer(disp);
                if (!buf) {
 
                buf = disp_get_vid_buffer(disp);
                if (!buf) {
@@ -226,9 +229,9 @@ main(int argc, char **argv)
                outBufs->descs[0].buf = (XDAS_Int8 *)omap_bo_handle(buf->bo[0]);
                outBufs->descs[1].buf = (XDAS_Int8 *)omap_bo_handle(buf->bo[1]);
 
                outBufs->descs[0].buf = (XDAS_Int8 *)omap_bo_handle(buf->bo[0]);
                outBufs->descs[1].buf = (XDAS_Int8 *)omap_bo_handle(buf->bo[1]);
 
-               t = mark(NULL);
+               tproc = mark(NULL);
                err = VIDDEC3_process(codec, inBufs, outBufs, inArgs, outArgs);
                err = VIDDEC3_process(codec, inBufs, outBufs, inArgs, outArgs);
-               MSG("processed returned in: %ldus", (long int)mark(&t));
+               MSG("processed returned in: %ldus", (long int)mark(&tproc));
                if (err) {
                        ERROR("process returned error: %d", err);
                        ERROR("extendedError: %08x", outArgs->extendedError);
                if (err) {
                        ERROR("process returned error: %d", err);
                        ERROR("extendedError: %08x", outArgs->extendedError);
@@ -248,6 +251,7 @@ main(int argc, char **argv)
                        disp_post_vid_buffer(disp, buf, r->topLeft.x, r->topLeft.y,
                                        r->bottomRight.x - r->topLeft.x,
                                        r->bottomRight.y - r->topLeft.y);
                        disp_post_vid_buffer(disp, buf, r->topLeft.x, r->topLeft.y,
                                        r->bottomRight.x - r->topLeft.x,
                                        r->bottomRight.y - r->topLeft.y);
+                       MSG("display in: %ldus", (long int)mark(&tdisp));
                }
 
                for (i = 0; outArgs->freeBufID[i]; i++) {
                }
 
                for (i = 0; outArgs->freeBufID[i]; i++) {