From: Nikhil Devshatwar Date: Wed, 3 Sep 2014 12:55:16 +0000 (+0530) Subject: dmabuftest: Remove switch thread logic X-Git-Url: https://git.ti.com/gitweb?p=glsdk%2Fomapdrmtest.git;a=commitdiff_plain;h=f23355dd96a8ccd1061d5be8cc321b3d8b41a3df;hp=c758b2fa68b76fe5a07066521a7a5e09f2374275 dmabuftest: Remove switch thread logic With the kmscube display, multiple captures need not be switched All of the videos(upto six) can be rendered on the cube. Remove the display thread logic so that all the threads post the captured buffer to display library. Also remove the fullscreen / overlay mode of displaying Signed-off-by: Nikhil Devshatwar --- diff --git a/dmabuftest.c b/dmabuftest.c index ff6b98f..ab6e1d6 100644 --- a/dmabuftest.c +++ b/dmabuftest.c @@ -24,18 +24,10 @@ #define CNT 500000 #define MAX_CAP 6 -pthread_t active_thread; - -enum display_area { - FULL, - OVERLAY -}; - struct thr_data { struct display *disp; struct v4l2 *v4l2; uint32_t fourcc, width, height; - enum display_area area; }; static void @@ -63,11 +55,8 @@ capture_loop(void *arg) uint32_t width = data->width, height = data->height; struct buffer **buffers, *capt; - pthread_t tid; int ret, i; - tid = pthread_self(); - buffers = disp_get_vid_buffers(disp, NBUF, fourcc, width, height); if (!buffers) { return NULL; @@ -78,13 +67,6 @@ capture_loop(void *arg) return NULL; } - if(data->area == OVERLAY) { - for (i = 0; i < NBUF; i++) { - buffers[i]->noScale = true; - get_overlay_plane(disp, buffers[i]); - } - } - for (i = 0; i < NBUF; i++) { v4l2_qbuf(v4l2, buffers[i]); } @@ -93,21 +75,11 @@ capture_loop(void *arg) for (i = 1; i < CNT; i++) { capt = v4l2_dqbuf(v4l2); - if(active_thread == tid) { - switch(data->area) { - case FULL: - ret = disp_post_vid_buffer(disp, capt, - 0, 0, width, height); - break; - case OVERLAY: - ret = disp_post_vid_buffer(disp, capt, - 0, 0, width, height); - break; - } - if (ret) { - MSG("Quitting"); - return NULL; - } + ret = disp_post_vid_buffer(disp, capt, + 0, 0, width, height); + if (ret) { + ERROR("Post buffer failed"); + return NULL; } v4l2_qbuf(v4l2, capt); } @@ -160,7 +132,6 @@ main(int argc, char **argv) } tdata[i].disp = disp; tdata[i].v4l2 = v4l2; - tdata[i].area = FULL; } if (check_args(argc, argv)) { @@ -175,15 +146,6 @@ main(int argc, char **argv) MSG("Failed creating thread"); } } - active_thread = threads[0]; - - while(1) { - c = getchar(); - if(c == 's') { - idx = (idx + 1) % multi; - active_thread = threads[idx]; - } - } for (i = 0; i < multi; i++) { pthread_join(threads[i], &result);