aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/fbio.h
diff options
context:
space:
mode:
authorKazutaka YOKOTA <yokota@FreeBSD.org>1999-06-22 14:14:06 +0000
committerKazutaka YOKOTA <yokota@FreeBSD.org>1999-06-22 14:14:06 +0000
commit6e8394b8baa7d5d9153ab90de6824bcd19b3b4e1 (patch)
tree9e351e9bc1321f8edd02ee62faa03602423b4604 /sys/sys/fbio.h
parent6ca65df0a7aafa67751b58ef83e58b556aa627ca (diff)
downloadsrc-6e8394b8baa7d5d9153ab90de6824bcd19b3b4e1.tar.gz
src-6e8394b8baa7d5d9153ab90de6824bcd19b3b4e1.zip
The second phase of syscons reorganization.
- Split syscons source code into manageable chunks and reorganize some of complicated functions. - Many static variables are moved to the softc structure. - Added a new key function, PREV. When this key is pressed, the vty immediately before the current vty will become foreground. Analogue to PREV, which is usually assigned to the PrntScrn key. PR: kern/10113 Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de> - Modified the kernel console input function sccngetc() so that it handles function keys properly. - Reorganized the screen update routine. - VT switching code is reorganized. It now should be slightly more robust than before. - Added the DEVICE_RESUME function so that syscons no longer hooks the APM resume event directly. - New kernel configuration options: SC_NO_CUTPASTE, SC_NO_FONT_LOADING, SC_NO_HISTORY and SC_NO_SYSMOUSE. Various parts of syscons can be omitted so that the kernel size is reduced. SC_PIXEL_MODE Made the VESA 800x600 mode an option, rather than a standard part of syscons. SC_DISABLE_DDBKEY Disables the `debug' key combination. SC_ALT_MOUSE_IMAGE Inverse the character cell at the mouse cursor position in the text console, rather than drawing an arrow on the screen. Submitted by: Nick Hibma (n_hibma@FreeBSD.ORG) SC_DFLT_FONT makeoptions "SC_DFLT_FONT=_font_name_" Include the named font as the default font of syscons. 16-line, 14-line and 8-line font data will be compiled in. This option replaces the existing STD8X16FONT option, which loads 16-line font data only. - The VGA driver is split into /sys/dev/fb/vga.c and /sys/isa/vga_isa.c. - The video driver provides a set of ioctl commands to manipulate the frame buffer. - New kernel configuration option: VGA_WIDTH90 Enables 90 column modes: 90x25, 90x30, 90x43, 90x50, 90x60. These modes are mot always supported by the video card. PR: i386/7510 Submitted by: kbyanc@freedomnet.com and alexv@sui.gda.itesm.mx. - The header file machine/console.h is reorganized; its contents is now split into sys/fbio.h, sys/kbio.h (a new file) and sys/consio.h (another new file). machine/console.h is still maintained for compatibility reasons. - Kernel console selection/installation routines are fixed and slightly rebumped so that it should now be possible to switch between the interanl kernel console (sc or vt) and a remote kernel console (sio) again, as it was in 2.x, 3.0 and 3.1. - Screen savers and splash screen decoders Because of the header file reorganization described above, screen savers and splash screen decoders are slightly modified. After this update, /sys/modules/syscons/saver.h is no longer necessary and is removed.
Notes
Notes: svn path=/head/; revision=48104
Diffstat (limited to 'sys/sys/fbio.h')
-rw-r--r--sys/sys/fbio.h289
1 files changed, 286 insertions, 3 deletions
diff --git a/sys/sys/fbio.h b/sys/sys/fbio.h
index 5dca5992c1c1..c4b51537f0fa 100644
--- a/sys/sys/fbio.h
+++ b/sys/sys/fbio.h
@@ -36,12 +36,17 @@
*
* @(#)fbio.h 8.2 (Berkeley) 10/30/93
*
- * $Id$
+ * $Id: fbio.h,v 1.5 1997/02/22 09:45:12 peter Exp $
*/
#ifndef _SYS_FBIO_H_
#define _SYS_FBIO_H_
+#ifndef KERNEL
+#include <sys/types.h>
+#endif
+#include <sys/ioccom.h>
+
/*
* Frame buffer ioctls (from Sprite, trimmed to essentials for X11).
*/
@@ -72,7 +77,15 @@
#define FBTYPE_RESERVED2 18 /* reserved, do not use */
#define FBTYPE_RESERVED1 19 /* reserved, do not use */
-#define FBTYPE_LASTPLUSONE 20 /* max number of fbs (change as add) */
+#define FBTYPE_MDA 20
+#define FBTYPE_HERCULES 21
+#define FBTYPE_CGA 22
+#define FBTYPE_EGA 23
+#define FBTYPE_VGA 24
+#define FBTYPE_PC98 25
+#define FBTYPE_TGA 26
+
+#define FBTYPE_LASTPLUSONE 27 /* max number of fbs (change as add) */
/*
* Frame buffer descriptor as returned by FBIOGTYPE.
@@ -188,4 +201,274 @@ struct fbcursor {
/* get maximum cursor size */
#define FBIOGCURMAX _IOR('F', 28, struct fbcurpos)
-#endif
+/* The new style frame buffer ioctls. */
+
+/* video mode information block */
+struct video_info {
+ int vi_mode; /* mode number, see below */
+ int vi_flags;
+#define V_INFO_COLOR (1 << 0)
+#define V_INFO_GRAPHICS (1 << 1)
+#define V_INFO_LINEAR (1 << 2)
+#define V_INFO_VESA (1 << 3)
+ int vi_width;
+ int vi_height;
+ int vi_cwidth;
+ int vi_cheight;
+ int vi_depth;
+ int vi_planes;
+ u_int vi_window; /* physical address */
+ size_t vi_window_size;
+ size_t vi_window_gran;
+ u_int vi_buffer; /* physical address */
+ size_t vi_buffer_size;
+ int vi_mem_model;
+#define V_INFO_MM_OTHER (-1)
+#define V_INFO_MM_TEXT 0
+#define V_INFO_MM_PLANAR 1
+#define V_INFO_MM_PACKED 2
+#define V_INFO_MM_DIRECT 3
+#define V_INFO_MM_CGA 100
+#define V_INFO_MM_HGC 101
+ /* for MM_PACKED and MM_DIRECT only */
+ int vi_pixel_size; /* in bytes */
+ /* for MM_DIRECT only */
+ int vi_pixel_fields[4]; /* RGB and reserved fields */
+ int vi_pixel_fsizes[4];
+ /* reserved */
+ u_char vi_reserved[64];
+};
+typedef struct video_info video_info_t;
+
+/* adapter infromation block */
+struct video_adapter {
+ int va_index;
+ int va_type;
+#define KD_OTHER 0 /* unknown */
+#define KD_MONO 1 /* monochrome adapter */
+#define KD_HERCULES 2 /* hercules adapter */
+#define KD_CGA 3 /* color graphics adapter */
+#define KD_EGA 4 /* enhanced graphics adapter */
+#define KD_VGA 5 /* video graphics adapter */
+#define KD_PC98 6 /* PC-98 display */
+#define KD_TGA 7 /* TGA */
+ char *va_name;
+ int va_unit;
+ int va_minor;
+ int va_flags;
+#define V_ADP_COLOR (1 << 0)
+#define V_ADP_MODECHANGE (1 << 1)
+#define V_ADP_STATESAVE (1 << 2)
+#define V_ADP_STATELOAD (1 << 3)
+#define V_ADP_FONT (1 << 4)
+#define V_ADP_PALETTE (1 << 5)
+#define V_ADP_BORDER (1 << 6)
+#define V_ADP_VESA (1 << 7)
+#define V_ADP_PROBED (1 << 16)
+#define V_ADP_INITIALIZED (1 << 17)
+#define V_ADP_REGISTERED (1 << 18)
+ int va_io_base;
+ int va_io_size;
+ int va_crtc_addr;
+ int va_mem_base;
+ int va_mem_size;
+ vm_offset_t va_window; /* virtual address */
+ size_t va_window_size;
+ size_t va_window_gran;
+ u_int va_window_orig;
+ vm_offset_t va_buffer; /* virtual address */
+ size_t va_buffer_size;
+ int va_initial_mode;
+ int va_initial_bios_mode;
+ int va_mode;
+ struct video_info va_info;
+ int va_line_width;
+ struct {
+ int x;
+ int y;
+ } va_disp_start;
+ void *va_token;
+};
+typedef struct video_adapter video_adapter_t;
+
+struct video_adapter_info {
+ int va_index;
+ int va_type;
+ char va_name[16];
+ int va_unit;
+ int va_flags;
+ int va_io_base;
+ int va_io_size;
+ int va_crtc_addr;
+ int va_mem_base;
+ int va_mem_size;
+ u_int va_window; /* virtual address */
+ size_t va_window_size;
+ size_t va_window_gran;
+ u_int va_unused0;
+ size_t va_buffer_size;
+ int va_initial_mode;
+ int va_initial_bios_mode;
+ int va_mode;
+ int va_line_width;
+ struct {
+ int x;
+ int y;
+ } va_disp_start;
+ u_int va_window_orig;
+ /* reserved */
+ u_char va_reserved[64];
+};
+typedef struct video_adapter_info video_adapter_info_t;
+
+/* some useful video adapter index */
+#define V_ADP_PRIMARY 0
+#define V_ADP_SECONDARY 1
+
+/* video mode numbers */
+
+#define M_B40x25 0 /* black & white 40 columns */
+#define M_C40x25 1 /* color 40 columns */
+#define M_B80x25 2 /* black & white 80 columns */
+#define M_C80x25 3 /* color 80 columns */
+#define M_BG320 4 /* black & white graphics 320x200 */
+#define M_CG320 5 /* color graphics 320x200 */
+#define M_BG640 6 /* black & white graphics 640x200 hi-res */
+#define M_EGAMONO80x25 7 /* ega-mono 80x25 */
+#define M_CG320_D 13 /* ega mode D */
+#define M_CG640_E 14 /* ega mode E */
+#define M_EGAMONOAPA 15 /* ega mode F */
+#define M_CG640x350 16 /* ega mode 10 */
+#define M_ENHMONOAPA2 17 /* ega mode F with extended memory */
+#define M_ENH_CG640 18 /* ega mode 10* */
+#define M_ENH_B40x25 19 /* ega enhanced black & white 40 columns */
+#define M_ENH_C40x25 20 /* ega enhanced color 40 columns */
+#define M_ENH_B80x25 21 /* ega enhanced black & white 80 columns */
+#define M_ENH_C80x25 22 /* ega enhanced color 80 columns */
+#define M_VGA_C40x25 23 /* vga 8x16 font on color */
+#define M_VGA_C80x25 24 /* vga 8x16 font on color */
+#define M_VGA_M80x25 25 /* vga 8x16 font on mono */
+
+#define M_VGA11 26 /* vga 640x480 2 colors */
+#define M_BG640x480 26
+#define M_VGA12 27 /* vga 640x480 16 colors */
+#define M_CG640x480 27
+#define M_VGA13 28 /* vga 320x200 256 colors */
+#define M_VGA_CG320 28
+
+#define M_VGA_C80x50 30 /* vga 8x8 font on color */
+#define M_VGA_M80x50 31 /* vga 8x8 font on color */
+#define M_VGA_C80x30 32 /* vga 8x16 font on color */
+#define M_VGA_M80x30 33 /* vga 8x16 font on color */
+#define M_VGA_C80x60 34 /* vga 8x8 font on color */
+#define M_VGA_M80x60 35 /* vga 8x8 font on color */
+#define M_VGA_CG640 36 /* vga 640x400 256 color */
+#define M_VGA_MODEX 37 /* vga 320x240 256 color */
+
+#define M_VGA_C90x25 40 /* vga 8x16 font on color */
+#define M_VGA_M90x25 41 /* vga 8x16 font on mono */
+#define M_VGA_C90x30 42 /* vga 8x16 font on color */
+#define M_VGA_M90x30 43 /* vga 8x16 font on mono */
+#define M_VGA_C90x43 44 /* vga 8x8 font on color */
+#define M_VGA_M90x43 45 /* vga 8x8 font on mono */
+#define M_VGA_C90x50 46 /* vga 8x8 font on color */
+#define M_VGA_M90x50 47 /* vga 8x8 font on mono */
+#define M_VGA_C90x60 48 /* vga 8x8 font on color */
+#define M_VGA_M90x60 49 /* vga 8x8 font on mono */
+
+#define M_ENH_B80x43 0x70 /* ega black & white 80x43 */
+#define M_ENH_C80x43 0x71 /* ega color 80x43 */
+
+#define M_PC98_80x25 98 /* PC98 80x25 */
+#define M_PC98_80x30 99 /* PC98 80x30 */
+
+#define M_HGC_P0 0xe0 /* hercules graphics - page 0 @ B0000 */
+#define M_HGC_P1 0xe1 /* hercules graphics - page 1 @ B8000 */
+#define M_MCA_MODE 0xff /* monochrome adapter mode */
+
+#define M_TEXT_80x25 200 /* generic text modes */
+#define M_TEXT_80x30 201
+#define M_TEXT_80x43 202
+#define M_TEXT_80x50 203
+#define M_TEXT_80x60 204
+#define M_TEXT_132x25 205
+#define M_TEXT_132x30 206
+#define M_TEXT_132x43 207
+#define M_TEXT_132x50 208
+#define M_TEXT_132x60 209
+
+#define M_VESA_BASE 0x100 /* VESA mode number base */
+#define M_VESA_CG640x400 0x100 /* 640x400, 256 color */
+#define M_VESA_CG640x480 0x101 /* 640x480, 256 color */
+#define M_VESA_800x600 0x102 /* 800x600, 16 color */
+#define M_VESA_CG800x600 0x103 /* 800x600, 256 color */
+#define M_VESA_1024x768 0x104 /* 1024x768, 16 color */
+#define M_VESA_CG1024x768 0x105 /* 1024x768, 256 color */
+#define M_VESA_1280x1024 0x106 /* 1280x1024, 16 color */
+#define M_VESA_CG1280x1024 0x107 /* 1280x1024, 256 color */
+#define M_VESA_C80x60 0x108 /* 8x8 font */
+#define M_VESA_C132x25 0x109 /* 8x16 font */
+#define M_VESA_C132x43 0x10a /* 8x14 font */
+#define M_VESA_C132x50 0x10b /* 8x8 font */
+#define M_VESA_C132x60 0x10c /* 8x8 font */
+#define M_VESA_32K_320 0x10d /* 320x200, 5:5:5 */
+#define M_VESA_64K_320 0x10e /* 320x200, 5:6:5 */
+#define M_VESA_FULL_320 0x10f /* 320x200, 8:8:8 */
+#define M_VESA_32K_640 0x110 /* 640x480, 5:5:5 */
+#define M_VESA_64K_640 0x111 /* 640x480, 5:6:5 */
+#define M_VESA_FULL_640 0x112 /* 640x480, 8:8:8 */
+#define M_VESA_32K_800 0x113 /* 800x600, 5:5:5 */
+#define M_VESA_64K_800 0x114 /* 800x600, 5:6:5 */
+#define M_VESA_FULL_800 0x115 /* 800x600, 8:8:8 */
+#define M_VESA_32K_1024 0x116 /* 1024x768, 5:5:5 */
+#define M_VESA_64K_1024 0x117 /* 1024x768, 5:6:5 */
+#define M_VESA_FULL_1024 0x118 /* 1024x768, 8:8:8 */
+#define M_VESA_32K_1280 0x119 /* 1280x1024, 5:5:5 */
+#define M_VESA_64K_1280 0x11a /* 1280x1024, 5:6:5 */
+#define M_VESA_FULL_1280 0x11b /* 1280x1024, 8:8:8 */
+#define M_VESA_MODE_MAX 0x1ff
+
+struct video_display_start {
+ int x;
+ int y;
+};
+typedef struct video_display_start video_display_start_t;
+
+struct video_color_palette {
+ int index; /* first element (zero-based) */
+ int count; /* number of elements */
+ u_char *red; /* red */
+ u_char *green; /* green */
+ u_char *blue; /* blue */
+ u_char *transparent; /* may be NULL */
+};
+typedef struct video_color_palette video_color_palette_t;
+
+/* adapter info. */
+#define FBIO_ADAPTER _IOR('F', 100, int)
+#define FBIO_ADPTYPE _IOR('F', 101, int)
+#define FBIO_ADPINFO _IOR('F', 102, struct video_adapter_info)
+
+/* video mode control */
+#define FBIO_MODEINFO _IOWR('F', 103, struct video_info)
+#define FBIO_FINDMODE _IOWR('F', 104, struct video_info)
+#define FBIO_GETMODE _IOR('F', 105, int)
+#define FBIO_SETMODE _IOW('F', 106, int)
+
+/* get/set frame buffer window origin */
+#define FBIO_GETWINORG _IOR('F', 107, u_int)
+#define FBIO_SETWINORG _IOW('F', 108, u_int)
+
+/* get/set display start address */
+#define FBIO_GETDISPSTART _IOR('F', 109, video_display_start_t)
+#define FBIO_SETDISPSTART _IOW('F', 110, video_display_start_t)
+
+/* get/set scan line width */
+#define FBIO_GETLINEWIDTH _IOR('F', 111, u_int)
+#define FBIO_SETLINEWIDTH _IOW('F', 112, u_int)
+
+/* color palette control */
+#define FBIO_GETPALETTE _IOW('F', 113, video_color_palette_t)
+#define FBIO_SETPALETTE _IOW('F', 114, video_color_palette_t)
+
+#endif /* !_SYS_FBIO_H_ */