2000-12-30 04:41:51 +03:00
|
|
|
/* $NetBSD: wsdisplayvar.h,v 1.18 2000/12/30 01:41:52 sato Exp $ */
|
1998-03-22 17:24:02 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* 3. All advertising materials mentioning features or use of this software
|
|
|
|
* must display the following acknowledgement:
|
|
|
|
* This product includes software developed by Christopher G. Demetriou
|
|
|
|
* for the NetBSD Project.
|
|
|
|
* 4. The name of the author may not be used to endorse or promote products
|
|
|
|
* derived from this software without specific prior written permission
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
struct device;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* WSDISPLAY interfaces
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Emulation functions, for displays that can support glass-tty terminal
|
|
|
|
* emulations. These are character oriented, with row and column
|
|
|
|
* numbers starting at zero in the upper left hand corner of the
|
|
|
|
* screen.
|
|
|
|
*
|
|
|
|
* These are used only when emulating a terminal. Therefore, displays
|
|
|
|
* drivers which cannot emulate terminals do not have to provide them.
|
|
|
|
*
|
|
|
|
* There is a "void *" cookie provided by the display driver associated
|
|
|
|
* with these functions, which is passed to them when they are invoked.
|
|
|
|
*/
|
|
|
|
struct wsdisplay_emulops {
|
|
|
|
void (*cursor) __P((void *c, int on, int row, int col));
|
1999-02-12 14:25:23 +03:00
|
|
|
int (*mapchar) __P((void *, int, unsigned int *));
|
1998-06-21 01:52:49 +04:00
|
|
|
void (*putchar) __P((void *c, int row, int col,
|
|
|
|
u_int uc, long attr));
|
1998-03-22 17:24:02 +03:00
|
|
|
void (*copycols) __P((void *c, int row, int srccol, int dstcol,
|
|
|
|
int ncols));
|
|
|
|
void (*erasecols) __P((void *c, int row, int startcol,
|
1998-05-15 00:49:55 +04:00
|
|
|
int ncols, long));
|
1998-03-22 17:24:02 +03:00
|
|
|
void (*copyrows) __P((void *c, int srcrow, int dstrow,
|
|
|
|
int nrows));
|
1998-05-15 00:49:55 +04:00
|
|
|
void (*eraserows) __P((void *c, int row, int nrows, long));
|
|
|
|
int (*alloc_attr) __P((void *c, int fg, int bg, int flags, long *));
|
|
|
|
/* fg / bg values. Made identical to ANSI terminal color codes. */
|
|
|
|
#define WSCOL_BLACK 0
|
|
|
|
#define WSCOL_RED 1
|
|
|
|
#define WSCOL_GREEN 2
|
|
|
|
#define WSCOL_BROWN 3
|
|
|
|
#define WSCOL_BLUE 4
|
|
|
|
#define WSCOL_MAGENTA 5
|
|
|
|
#define WSCOL_CYAN 6
|
|
|
|
#define WSCOL_WHITE 7
|
|
|
|
/* flag values: */
|
|
|
|
#define WSATTR_REVERSE 1
|
|
|
|
#define WSATTR_HILIT 2
|
|
|
|
#define WSATTR_BLINK 4
|
|
|
|
#define WSATTR_UNDERLINE 8
|
|
|
|
#define WSATTR_WSCOLORS 16
|
|
|
|
/* XXX need a free_attr() ??? */
|
1998-03-22 17:24:02 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
struct wsscreen_descr {
|
|
|
|
char *name;
|
|
|
|
int ncols, nrows;
|
|
|
|
const struct wsdisplay_emulops *textops;
|
|
|
|
int fontwidth, fontheight;
|
1998-05-15 00:49:55 +04:00
|
|
|
int capabilities;
|
|
|
|
#define WSSCREEN_WSCOLORS 1 /* minimal color capability */
|
|
|
|
#define WSSCREEN_REVERSE 2 /* can display reversed */
|
|
|
|
#define WSSCREEN_HILIT 4 /* can highlight (however) */
|
|
|
|
#define WSSCREEN_BLINK 8 /* can blink */
|
|
|
|
#define WSSCREEN_UNDERLINE 16 /* can underline */
|
1998-03-22 17:24:02 +03:00
|
|
|
};
|
|
|
|
|
1999-01-13 19:21:02 +03:00
|
|
|
struct wsdisplay_font;
|
1998-03-22 17:24:02 +03:00
|
|
|
/*
|
|
|
|
* Display access functions, invoked by user-land programs which require
|
|
|
|
* direct device access, such as X11.
|
|
|
|
*
|
|
|
|
* There is a "void *" cookie provided by the display driver associated
|
|
|
|
* with these functions, which is passed to them when they are invoked.
|
|
|
|
*/
|
|
|
|
struct wsdisplay_accessops {
|
|
|
|
int (*ioctl) __P((void *v, u_long cmd, caddr_t data, int flag,
|
|
|
|
struct proc *p));
|
2000-06-26 08:55:19 +04:00
|
|
|
paddr_t (*mmap) __P((void *v, off_t off, int prot));
|
1998-03-22 17:24:02 +03:00
|
|
|
int (*alloc_screen) __P((void *, const struct wsscreen_descr *,
|
1998-05-15 00:49:55 +04:00
|
|
|
void **, int *, int *, long *));
|
1998-03-22 17:24:02 +03:00
|
|
|
void (*free_screen) __P((void *, void *));
|
1999-12-06 21:52:23 +03:00
|
|
|
int (*show_screen) __P((void *, void *, int,
|
|
|
|
void (*) (void *, int, int), void *));
|
1999-01-13 19:21:02 +03:00
|
|
|
int (*load_font) __P((void *, void *, struct wsdisplay_font *));
|
2000-12-30 04:41:51 +03:00
|
|
|
void (*pollc) __P((void *, int));
|
1998-03-22 17:24:02 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Attachment information provided by wsdisplaydev devices when attaching
|
|
|
|
* wsdisplay units.
|
|
|
|
*/
|
|
|
|
struct wsdisplaydev_attach_args {
|
|
|
|
const struct wsdisplay_accessops *accessops; /* access ops */
|
|
|
|
void *accesscookie; /* access cookie */
|
|
|
|
};
|
|
|
|
|
|
|
|
/* passed to wscons by the video driver to tell about its capabilities */
|
|
|
|
struct wsscreen_list {
|
|
|
|
int nscreens;
|
|
|
|
const struct wsscreen_descr **screens;
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Attachment information provided by wsemuldisplaydev devices when attaching
|
|
|
|
* wsdisplay units.
|
|
|
|
*/
|
|
|
|
struct wsemuldisplaydev_attach_args {
|
|
|
|
int console; /* is it console? */
|
1998-05-15 00:49:55 +04:00
|
|
|
const struct wsscreen_list *scrdata; /* screen cfg info */
|
1998-03-22 17:24:02 +03:00
|
|
|
const struct wsdisplay_accessops *accessops; /* access ops */
|
|
|
|
void *accesscookie; /* access cookie */
|
|
|
|
};
|
|
|
|
|
1998-07-29 02:01:24 +04:00
|
|
|
#include "locators.h"
|
|
|
|
|
|
|
|
#define wsemuldisplaydevcf_console cf_loc[WSEMULDISPLAYDEVCF_CONSOLE] /* spec'd as console? */
|
|
|
|
#define WSEMULDISPLAYDEVCF_CONSOLE_UNK (WSEMULDISPLAYDEVCF_CONSOLE_DEFAULT)
|
1998-03-22 17:24:02 +03:00
|
|
|
|
1998-06-12 02:00:04 +04:00
|
|
|
struct wscons_syncops {
|
1999-01-26 17:22:14 +03:00
|
|
|
int (*detach) __P((void *, int, void (*)(void *, int, int), void *));
|
|
|
|
int (*attach) __P((void *, int, void (*)(void *, int, int), void *));
|
1998-06-12 02:00:04 +04:00
|
|
|
int (*check) __P((void *));
|
|
|
|
void (*destroy) __P((void *));
|
|
|
|
};
|
|
|
|
|
1998-03-22 17:24:02 +03:00
|
|
|
/*
|
|
|
|
* Autoconfiguration helper functions.
|
|
|
|
*/
|
|
|
|
void wsdisplay_cnattach __P((const struct wsscreen_descr *, void *,
|
1998-05-15 00:49:55 +04:00
|
|
|
int, int, long));
|
1998-03-22 17:24:02 +03:00
|
|
|
int wsdisplaydevprint __P((void *, const char *));
|
|
|
|
int wsemuldisplaydevprint __P((void *, const char *));
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Console interface.
|
|
|
|
*/
|
|
|
|
void wsdisplay_cnputc __P((dev_t dev, int i));
|
1998-06-12 02:00:04 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* for use by compatibility code
|
|
|
|
*/
|
|
|
|
struct wsdisplay_softc;
|
|
|
|
struct wsscreen;
|
|
|
|
int wsscreen_attach_sync __P((struct wsscreen *,
|
|
|
|
const struct wscons_syncops *, void *));
|
|
|
|
int wsscreen_detach_sync __P((struct wsscreen *));
|
|
|
|
int wsscreen_lookup_sync __P((struct wsscreen *,
|
|
|
|
const struct wscons_syncops *, void **));
|
|
|
|
|
|
|
|
int wsdisplay_maxscreenidx __P((struct wsdisplay_softc *));
|
|
|
|
int wsdisplay_screenstate __P((struct wsdisplay_softc *, int));
|
|
|
|
int wsdisplay_getactivescreen __P((struct wsdisplay_softc *));
|
|
|
|
int wsscreen_switchwait __P((struct wsdisplay_softc *, int));
|
|
|
|
|
|
|
|
int wsdisplay_internal_ioctl __P((struct wsdisplay_softc *sc,
|
|
|
|
struct wsscreen *,
|
|
|
|
u_long cmd, caddr_t data,
|
|
|
|
int flag, struct proc *p));
|
|
|
|
|
1999-10-19 04:03:18 +04:00
|
|
|
int wsdisplay_usl_ioctl1 __P((struct wsdisplay_softc *,
|
|
|
|
u_long, caddr_t, int, struct proc *));
|
|
|
|
|
|
|
|
int wsdisplay_usl_ioctl2 __P((struct wsdisplay_softc *, struct wsscreen *,
|
1998-06-12 02:00:04 +04:00
|
|
|
u_long, caddr_t, int, struct proc *));
|
1999-01-09 18:44:45 +03:00
|
|
|
|
|
|
|
int wsdisplay_cfg_ioctl __P((struct wsdisplay_softc *sc,
|
|
|
|
u_long cmd, caddr_t data,
|
|
|
|
int flag, struct proc *p));
|
1999-10-12 20:47:41 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* for general use
|
|
|
|
*/
|
2000-09-10 13:39:57 +04:00
|
|
|
#define WSDISPLAY_NULLSCREEN -1
|
1999-10-12 20:47:41 +04:00
|
|
|
void wsdisplay_switchtoconsole __P((void));
|
2000-09-10 15:44:13 +04:00
|
|
|
const struct wsscreen_descr *
|
|
|
|
wsdisplay_screentype_pick __P((const struct wsscreen_list *, const char *));
|