Date: Thu, 14 Jun 2012 21:49:12 GMT From: Brooks Davis <brooks@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 212864 for review Message-ID: <201206142149.q5ELnCTo041584@skunkworks.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@212864?ac=10 Change 212864 by brooks@brooks_ecr_current on 2012/06/14 21:48:53 Also add LOCAL_LIB_DIRS to SUBDIRS. Otherwise their products don't get installed. Affected files ... .. //depot/projects/ctsrd/beribsd/src/Makefile.inc1#4 edit .. //depot/projects/ctsrd/beribsd/src/ctsrd-lib/Makefile#2 edit .. //depot/projects/ctsrd/beribsd/src/ctsrd-lib/libde4tc/Makefile#1 add .. //depot/projects/ctsrd/beribsd/src/ctsrd-lib/libde4tc/de4tc.c#1 add .. //depot/projects/ctsrd/beribsd/src/ctsrd-lib/libde4tc/de4tc.h#1 add .. //depot/projects/ctsrd/beribsd/src/ctsrd/pictview/Makefile#3 edit .. //depot/projects/ctsrd/beribsd/src/ctsrd/pictview/pictview.c#3 edit Differences ... ==== //depot/projects/ctsrd/beribsd/src/Makefile.inc1#4 (text+ko) ==== @@ -89,7 +89,7 @@ # These are last, since it is nice to at least get the base system # rebuilt before you do them. -.for _DIR in ${LOCAL_DIRS} +.for _DIR in ${LOCAL_LIB_DIRS} ${LOCAL_DIRS} .if exists(${.CURDIR}/${_DIR}/Makefile) SUBDIR+= ${_DIR} .endif ==== //depot/projects/ctsrd/beribsd/src/ctsrd-lib/Makefile#2 (text+ko) ==== @@ -3,6 +3,7 @@ .include <bsd.own.mk> -SUBDIR= libvuln_png +SUBDIR= libde4tc \ + libvuln_png .include <bsd.subdir.mk> ==== //depot/projects/ctsrd/beribsd/src/ctsrd/pictview/Makefile#3 (text+ko) ==== @@ -9,7 +9,7 @@ WARNS= 0 -LDADD+= -lvuln_png -lz -lm +LDADD+= -lde4tc -lvuln_png -lz -lm # Disable the stack protector, we want to be vulnerable SSP_CFLAGS= ==== //depot/projects/ctsrd/beribsd/src/ctsrd/pictview/pictview.c#3 (text+ko) ==== @@ -39,6 +39,10 @@ #include <errno.h> #include <err.h> #include <stdbool.h> + +#include <de4tc.h> + +#if DIKE // endian.h not available in Linux? // #include <sys/endian.h> #include <sys/mman.h> @@ -63,11 +67,16 @@ // number of lines in the line pattern static const int num_lines_pattern = 600; +#endif // send keyboard output to stdout by default static int kbdfd = 0; +u_int32_t *fb_buf; +#if DIKE + + /***************************************************************************** * hack around endian issue * TODO: replace with endian library call (but not present in Linux?) @@ -413,6 +422,7 @@ } } */ +#endif /* DIKE */ void @@ -456,7 +466,6 @@ // while no pinch gesture, draw... while(!((touch_count==2) && (touch_gesture==0x49))) { // try to filter out short lived touch releases - multitouch_pole(); multitouch_filter(); if((touch_count<1) || (touch_count>2)) @@ -481,6 +490,7 @@ } +#if DIKE /***************************************************************************** * PNG image loader *****************************************************************************/ @@ -586,9 +596,9 @@ for(x=0; x<maxwidth; x++) imgbuf[x+y*maxwidth] = 0; } +#endif - /***************************************************************************** * On screen keyboard *****************************************************************************/ @@ -664,13 +674,14 @@ prev_keymode = keymode; // display keyboard for(j=0; (j<(fb_width*fb_height)) && (j<fb_width*keyYpos); j++) - pfbp[j] = 0; + fb_buf[j] = 0; for(k=0; (j<(fb_width*fb_height)) && (k<(fb_width*keyboard_height)); k++) { - pfbp[j] = keyboard_imgs[keymode][k]; + fb_buf[j] = keyboard_imgs[keymode][k]; j++; } for(;(j<fb_width*fb_height); j++) - pfbp[j] = 0; + fb_buf[j] = 0; + fb_post(fb_buf); } multitouch_pole(); @@ -848,7 +859,8 @@ // display background for(j=0; j<fb_width*fb_height; j++) - pfbp[j] = pictview_imgs[0][j]; + fb_buf[j] = pictview_imgs[0][j]; + fb_post(fb_buf); // display photos as tiles for(yi=0; yi<tile; yi++) @@ -860,8 +872,9 @@ int img = imgmap[xi][yi]; for(y=0; y<fb_height/scale; y++) for(x=0; x<fb_width/scale; x++) - pfbp[x+x0+(y+y0)*fb_width] = pictview_imgs[img][(x+y*fb_width)*scale]; + fb_buf[x+x0+(y+y0)*fb_width] = pictview_imgs[img][(x+y*fb_width)*scale]; } + fb_post(fb_buf); // display on fb_fade2on(); @@ -906,8 +919,9 @@ touch_release = true; k=y*fb_width; for(x=0; x<fb_width; x++) - pfbp[x+k] = pictview_imgs[display_image][x+k]; + fb_buf[x+k] = pictview_imgs[display_image][x+k]; } + fb_post(fb_buf); fb_fade2on(); // wait for touch to be released @@ -929,7 +943,8 @@ display_image = next_display_image; pan_direction = -1; for(k=0; k<fb_width*fb_height; k++) - pfbp[k] = pictview_imgs[display_image][k]; + fb_buf[k] = pictview_imgs[display_image][k]; + fb_post(fb_buf); } // printf("prev=%1d, state=%1d, c=%1d\n", prev_state, state, touch_count); @@ -960,10 +975,11 @@ for(y=0; y<fb_height; y++) { k = y*fb_width; for(x=prev_touch_x0; x<touch_x0; x++) - pfbp[x+k] = pictview_imgs[img0][x+k]; + fb_buf[x+k] = pictview_imgs[img0][x+k]; for(x=touch_x0; x<=prev_touch_x0; x++) - pfbp[x+k] = pictview_imgs[img1][x+k]; - } + fb_buf[x+k] = pictview_imgs[img1][x+k]; + } + fb_post(fb_buf); prev_touch_x0 = touch_x0; } } @@ -981,8 +997,7 @@ for(j=1; j<=pictview_num_photo; j++) { // printf("display image %1d\n",j); fb_fade2off(); - for(k=0; k<fb_width*fb_height; k++) - pfbp[k] = pictview_imgs[j][k]; + fb_post(pictview_imgs[j]); fb_fade2on(); sleep(3); } @@ -1022,6 +1037,8 @@ pid_t pid; char *devpath; + fb_buf = malloc(sizeof(*fb_buf) * fb_width * fb_height); + // initialise framebuffers and mtl control for mmap access fb_init(); fb_text_cursor(255, 255); @@ -1069,9 +1086,7 @@ pictview(); - close(ctrlfd); - close(dispfd); - close(textfd); + fb_fini(); printf("The End\n"); return 0; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201206142149.q5ELnCTo041584>