Annotation of sys/arch/hp300/dev/diofbvar.h, Revision 1.1
1.1 ! nbrk 1: /* $OpenBSD: diofbvar.h,v 1.10 2006/08/11 18:33:13 miod Exp $ */
! 2:
! 3: /*
! 4: * Copyright (c) 2005, Miodrag Vallat
! 5: *
! 6: * Redistribution and use in source and binary forms, with or without
! 7: * modification, are permitted provided that the following conditions
! 8: * are met:
! 9: * 1. Redistributions of source code must retain the above copyright
! 10: * notice, this list of conditions and the following disclaimer.
! 11: * 2. Redistributions in binary form must reproduce the above copyright
! 12: * notice, this list of conditions and the following disclaimer in the
! 13: * documentation and/or other materials provided with the distribution.
! 14: *
! 15: * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
! 16: * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
! 17: * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
! 18: * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
! 19: * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
! 20: * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
! 21: * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
! 22: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
! 23: * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
! 24: * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! 25: * POSSIBILITY OF SUCH DAMAGE.
! 26: */
! 27: /*
! 28: * Copyright (c) 1988 University of Utah.
! 29: * Copyright (c) 1990, 1993
! 30: * The Regents of the University of California. All rights reserved.
! 31: *
! 32: * This code is derived from software contributed to Berkeley by
! 33: * the Systems Programming Group of the University of Utah Computer
! 34: * Science Department.
! 35: *
! 36: * Redistribution and use in source and binary forms, with or without
! 37: * modification, are permitted provided that the following conditions
! 38: * are met:
! 39: * 1. Redistributions of source code must retain the above copyright
! 40: * notice, this list of conditions and the following disclaimer.
! 41: * 2. Redistributions in binary form must reproduce the above copyright
! 42: * notice, this list of conditions and the following disclaimer in the
! 43: * documentation and/or other materials provided with the distribution.
! 44: * 3. Neither the name of the University nor the names of its contributors
! 45: * may be used to endorse or promote products derived from this software
! 46: * without specific prior written permission.
! 47: *
! 48: * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
! 49: * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
! 50: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
! 51: * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
! 52: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
! 53: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
! 54: * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
! 55: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
! 56: * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
! 57: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
! 58: * SUCH DAMAGE.
! 59: */
! 60:
! 61: #ifdef _KERNEL
! 62:
! 63: struct diocmap {
! 64: u_int8_t r[256], g[256], b[256];
! 65: };
! 66:
! 67: /*
! 68: * Minimal frame buffer state structure.
! 69: */
! 70: struct diofb {
! 71: caddr_t regkva; /* KVA of registers */
! 72: caddr_t fbkva; /* KVA of framebuffer */
! 73:
! 74: caddr_t regaddr; /* control registers physaddr */
! 75: caddr_t fbaddr; /* frame buffer physaddr */
! 76:
! 77: u_int fbsize; /* frame buffer size */
! 78: u_int fbwidth; /* frame buffer width */
! 79: u_int fbheight; /* frame buffer height */
! 80: u_int dwidth; /* displayed part width */
! 81: u_int dheight; /* displayed part height */
! 82:
! 83: u_int planes; /* number of planes */
! 84: u_int planemask; /* and related mask */
! 85:
! 86: /* rasops information */
! 87: struct rasops_info ri;
! 88:
! 89: /* color information */
! 90: struct diocmap cmap;
! 91:
! 92: /* wsdisplay information */
! 93: struct wsscreen_descr wsd;
! 94: struct wsscreen_list wsl;
! 95: struct wsscreen_descr *scrlist[1];
! 96: int nscreens;
! 97: u_int mapmode;
! 98:
! 99: /* blockmove routine */
! 100: int (*bmv)(struct diofb *, u_int16_t, u_int16_t, u_int16_t,
! 101: u_int16_t, u_int16_t, u_int16_t, int16_t, int16_t);
! 102: };
! 103:
! 104: /* Replacement Rules (rops) */
! 105: #define RR_CLEAR 0x0
! 106: #define RR_COPY 0x3
! 107: #define RR_XOR 0x6
! 108: #define RR_INVERT 0xa
! 109: #define RR_COPYINVERTED 0xc
! 110:
! 111: void diofb_cnattach(struct diofb *);
! 112: void diofb_end_attach(void *, struct wsdisplay_accessops *, struct diofb *,
! 113: int, const char *);
! 114: int diofb_fbinquire(struct diofb *, int, struct diofbreg *);
! 115: void diofb_fbsetup(struct diofb *);
! 116: int diofb_getcmap(struct diofb *, struct wsdisplay_cmap *);
! 117: void diofb_resetcmap(struct diofb *);
! 118:
! 119: int diofb_alloc_attr(void *, int, int, int, long *);
! 120: int diofb_alloc_screen(void *, const struct wsscreen_descr *, void **,
! 121: int *, int *, long *);
! 122: void diofb_free_screen(void *, void *);
! 123: paddr_t diofb_mmap(void *, off_t, int);
! 124: int diofb_show_screen(void *, void *, int, void (*)(void *, int, int),
! 125: void *);
! 126:
! 127: int diofb_mono_windowmove(struct diofb *, u_int16_t, u_int16_t, u_int16_t,
! 128: u_int16_t, u_int16_t, u_int16_t, int16_t, int16_t);
! 129:
! 130: /* Console support */
! 131: void dvboxcninit(void);
! 132: void gboxcninit(void);
! 133: void hypercninit(void);
! 134: void rboxcninit(void);
! 135: void topcatcninit(void);
! 136: void tvrxcninit(void);
! 137: extern struct diofb diofb_cn; /* struct diofb for console device */
! 138:
! 139: #endif
! 140:
! 141: /*
! 142: * In mapped mode, mmap() will provide the following layout:
! 143: * 0 - (DIOFB_REGSPACE - 1) frame buffer registers
! 144: * DIOFB_REGSPACE onwards frame buffer memory
! 145: */
! 146: #define DIOFB_REGSPACE 0x020000
CVSweb