Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!cs.utexas.edu!rice!sun-spots-request From: david@eng.sun.com (Xemu Division, Velcro Industries) Newsgroups: comp.sys.sun Subject: Re: detecting the cg6 board Keywords: Miscellaneous Message-ID: <8144@brazos.Rice.edu> Date: 24 May 90 17:45:16 GMT Sender: root@rice.edu Organization: Sun-Spots Lines: 36 Approved: Sun-Spots@rice.edu X-Refs: Original: v9n182 X-Sun-Spots-Digest: Volume 9, Issue 182, message 10 In article <8102@brazos.Rice.edu> pcad!eddy@uunet.uu.net (Eduardo Juncosa) writes: >I am trying to detect within a program whether the SPARC station that is >executing the program had a cg6 graphics accelerator board installed. SUN >suggested I do a pr_open("/dev/cgsix0"). The person at Sun who suggested this should be shot (well, at least corrected) because a) there is no need for a /dev/cgsix0 device (/dev/fb works just fine) and b) there is such a thing as a multi-headed system you know! Probably the best way to do this is to get a file descriptor pointing to the frame buffer device and then use the FBIOGATTR ioctl. For example, in a SunView program you might do something like... int fd; struct screen screen; struct fbgattr fbattr; win_screenget((int) window_get(win, WIN_FD), &screen); if ((fd = open(screen.scr_fbname, 2, 0)) < 0) { /* error */ } if (ioctl(fd, FBIOGATTR, &fbattr) < 0 || fbattr.fbtype.fb_type != FBTYPE_SUNFAST_COLOR) { /* it's not a cg6 */ } else { /* it is a cg6 */ } (void) close(fd); David DiGiacomo, Sun Microsystems, Mt. View, CA david@eng.sun.com