Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!rice!sun-spots-request From: rocket!bull!houvener@uunet.uu.net (Bob Houvener) Newsgroups: comp.sys.sun Subject: cgfour fb doesn't wait for vertical retrace Keywords: Software Message-ID: <106@brazos.Rice.edu> Date: 12 Jul 89 02:29:33 GMT Sender: root@rice.edu Organization: Sun-Spots Lines: 119 Approved: Sun-Spots@rice.edu X-Sun-Spots-Digest: Volume 8, Issue 69, message 9 of 16 The docs claim that the cgfour will wait till vertical retrace to change the color buffer. The following program shows that it doesn't. Sun support said "gee your right". Can someone help me find a way to sync to the monitor? Please reply via mail too uunet!rocket!houvener compile with cc -g -o test1.exe test1.c millisec.c -lm -lsuntool -lsunwindow -lpixrect ----test1.c /************************************************************************ test.c program to test FBIOVERTICAL signal ************************************************************************/ #include #include #include #include #include unsigned char red[256]; unsigned char blue[256]; unsigned char green[256]; struct fbcmap cmap = { 0, 256, red, green, blue }; int cg2; int errno; int i; int return_val = 9999; long clock(), cputime; main() { cg2 = open("/dev/cgfour0", O_RDWR); if(cg2 == (-1)) { perror("open()"); exit(errno); } return_val = ioctl(cg2, FBIOGETCMAP, &cmap); if(return_val == (-1)) { perror("ioctl(fb, FBIOGETCMAP, &cmap)"); exit(errno); } for(i=cmap.index; i #include long millisec() { struct timeb now; ftime (&now); return ((now.time & 0xfffff) * 1000 + now.millitm); }