Subject: grf Stuff
To: None <macbsd-development@NetBSD.ORG>
From: Tres Hofmeister <tres@rap.ucar.EDU>
List: macbsd-development
Date: 01/19/1995 01:27:47
	Here's a bit of information on what several (well, three)
kernels think about the internal and external (Micron Xceed Color 30)
on my SE/30, in the hopes that it might prove useful to those working
on the console stuff.

	Neither dt nor X will run on my external display, but both are
happy on the internal.  The program I used to output this stuff is
included below.

	The latest (?) MRG kernel from puma and the netbsd.patched
kernel from the "old" directory both produced identical results.  Not
surprising, I suppose.  The only place they differed from the generic
kernel is in what they think the frame buffer size is, but since none
of the kernels work anyway, it seems this is irrelevant?

	Anyway, I had it around, so I thought I'd send it out.  If it's
just noise, my apologies, and feel free to delete it before you read
it...  ;-)

Generic 1.0 kernel, built on my system from the 1.0 sources, internal:
gd_id: 8
gd_regaddr: 0
gd_regsize: 0
gd_fbaddr: 0xfe008040
gd_fbsize: 175104	(MRG kernels: 21888)
gd_colors: 1
gd_planes: 1
gd_fbwidth: 512
gd_fbheight: 342
gd_fbrowbytes: 64
gd_dwidth: 512
gd_dheight: 342
gd_pad[]: (Not used...)

Generic 1.0 kernel, built on my system from the 1.0 sources, external:
gd_id: 8
gd_regaddr: 0
gd_regsize: 0
gd_fbaddr: 0xf9000400
gd_fbsize: 307200	(MRG kernels: 491520)
gd_colors: 1
gd_planes: 1
gd_fbwidth: 640
gd_fbheight: 480
gd_fbrowbytes: 1024
gd_dwidth: 640
gd_dheight: 480
gd_pad[]: (Not used...)

The program:

#include <fcntl.h>
#include <sys/ioctl.h>
#include <machine/grfioctl.h>

main(argc, argv)
    int   argc;
    char  *argv[];
    int fd;
    struct grfinfo foo;
    struct grfinfo *gp = &foo;

    if ((fd = open(argv[1], O_RDONLY)) == -1)

    if (ioctl (fd, GRFIOCGINFO, gp) == -1)
	perror ("GRFIOCGINFO");

    printf("gd_id: %i\n", gp->gd_id);
    printf("gd_regaddr: %#0x\n", gp->gd_regaddr);
    printf("gd_regsize: %i\n", gp->gd_regsize);
    printf("gd_fbaddr: %#0x\n", gp->gd_fbaddr);
    printf("gd_fbsize: %i\n", gp->gd_fbsize);
    printf("gd_colors: %hi\n", gp->gd_colors);
    printf("gd_planes: %hi\n", gp->gd_planes);
    printf("gd_fbwidth: %i\n", gp->gd_fbwidth);
    printf("gd_fbheight: %i\n", gp->gd_fbheight);
    printf("gd_fbrowbytes: %i\n", gp->gd_fbrowbytes);
    printf("gd_dwidth: %i\n", gp->gd_dwidth);
    printf("gd_dheight: %i\n", gp->gd_dheight);
    printf("gd_pad[]: (Not used...)\n");

    /* int	gd_id;			/* HPUX identifier */
    /* caddr_t	gd_regaddr;		/* control registers physaddr */
    /* int	gd_regsize;		/* control registers size */
    /* caddr_t	gd_fbaddr;		/* frame buffer physaddr */
    /* int	gd_fbsize;		/* frame buffer size */
    /* short	gd_colors;		/* number of colors */
    /* short	gd_planes;		/* number of planes */

    /* new stuff */

    /* int	gd_fbwidth;		/* frame buffer width */
    /* int	gd_fbheight;		/* frame buffer height */
    /* int	gd_fbrowbytes;		/* frame buffer rowbytes */
    /* int	gd_dwidth;		/* displayed part width */
    /* int	gd_dheight;		/* displayed part height */
    /* int	gd_pad[6];		/* for future expansion */

Tres Hofmeister