141480Smckusick /* 241480Smckusick * Copyright (c) 1988 University of Utah. 363146Sbostic * Copyright (c) 1990, 1993 463146Sbostic * The Regents of the University of California. All rights reserved. 541480Smckusick * 641480Smckusick * This code is derived from software contributed to Berkeley by 741480Smckusick * the Systems Programming Group of the University of Utah Computer 841480Smckusick * Science Department. 941480Smckusick * 1041480Smckusick * %sccs.include.redist.c% 1141480Smckusick * 12*64474Shibler * from: Utah $Hdr: grfvar.h 1.11 93/08/13$ 1341480Smckusick * 14*64474Shibler * @(#)grfvar.h 8.2 (Berkeley) 09/09/93 1541480Smckusick */ 1641480Smckusick 1749311Shibler /* internal structure of lock page */ 1841480Smckusick #define GRFMAXLCK 256 1949311Shibler struct grf_lockpage { 2049311Shibler u_char gl_locks[GRFMAXLCK]; 2149311Shibler }; 2249311Shibler #define gl_lockslot gl_locks[0] 2341480Smckusick 2453923Shibler /* 2553923Shibler * Static configuration info for display types 2653923Shibler */ 2753923Shibler struct grfsw { 2853923Shibler int gd_hwid; /* id returned by hardware */ 2953923Shibler int gd_swid; /* id to be returned by software */ 3053923Shibler char *gd_desc; /* description printed at config time */ 3153923Shibler int (*gd_init)(); /* boot time init routine */ 3253923Shibler int (*gd_mode)(); /* misc function routine */ 3353923Shibler }; 3453923Shibler 3541480Smckusick /* per display info */ 3641480Smckusick struct grf_softc { 3741480Smckusick int g_flags; /* software flags */ 3853923Shibler struct grfsw *g_sw; /* static configuration info */ 3949311Shibler caddr_t g_regkva; /* KVA of registers */ 4049311Shibler caddr_t g_fbkva; /* KVA of framebuffer */ 4149311Shibler struct grfinfo g_display; /* hardware description (for ioctl) */ 4249311Shibler struct grf_lockpage *g_lock; /* lock page associated with device */ 4341480Smckusick struct proc *g_lockp; /* process holding lock */ 4449311Shibler short *g_pid; /* array of pids with device open */ 4541480Smckusick int g_lockpslot; /* g_pid entry of g_lockp */ 4649311Shibler caddr_t g_data; /* device dependent data */ 4741480Smckusick }; 4841480Smckusick 4941480Smckusick /* flags */ 5041480Smckusick #define GF_ALIVE 0x01 5141480Smckusick #define GF_OPEN 0x02 5241480Smckusick #define GF_EXCLUDE 0x04 5341480Smckusick #define GF_WANTED 0x08 5441480Smckusick #define GF_BSDOPEN 0x10 5541480Smckusick #define GF_HPUXOPEN 0x20 5641480Smckusick 5741480Smckusick /* requests to mode routine */ 5841480Smckusick #define GM_GRFON 1 5941480Smckusick #define GM_GRFOFF 2 6041480Smckusick #define GM_GRFOVON 3 6141480Smckusick #define GM_GRFOVOFF 4 6253923Shibler #define GM_DESCRIBE 5 63*64474Shibler #define GM_MAP 6 64*64474Shibler #define GM_UNMAP 7 6541480Smckusick 6641480Smckusick /* minor device interpretation */ 6741480Smckusick #define GRFOVDEV 0x10 /* overlay planes */ 6841480Smckusick #define GRFIMDEV 0x20 /* images planes */ 6941480Smckusick #define GRFUNIT(d) ((d) & 0x7) 7041480Smckusick 7141480Smckusick #ifdef KERNEL 7241480Smckusick extern struct grf_softc grf_softc[]; 7353923Shibler extern struct grfsw grfsw[]; 7453923Shibler extern int ngrfsw; 7541480Smckusick #endif 76