2 * linux/drivers/video/console/fbcon.h -- Low level frame buffer based console driver
4 * Copyright (C) 1997 Geert Uytterhoeven
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file COPYING in the main directory of this archive
11 #ifndef _VIDEO_FBCON_H
12 #define _VIDEO_FBCON_H
14 #include <linux/config.h>
15 #include <linux/types.h>
16 #include <linux/vt_buffer.h>
17 #include <linux/vt_kern.h>
22 * This is the interface between the low-level console driver and the
23 * low-level frame buffer device
27 /* Filled in by the frame buffer device */
28 u_short inverse; /* != 0 text black on white as default */
29 /* Filled in by the low-level console driver */
31 int userfont; /* != 0 if fontdata kmalloc()ed */
32 u_short scrollmode; /* Scroll Method */
33 short yscroll; /* Hardware scrolling */
34 int vrows; /* number of virtual rows */
38 /* drivers/video/console/fbcon.c */
39 extern char con2fb_map[MAX_NR_CONSOLES];
40 extern int set_con2fb_map(int unit, int newidx);
47 #define attr_fgcol(fgshift,s) \
48 (((s) >> (fgshift)) & 0x0f)
49 #define attr_bgcol(bgshift,s) \
50 (((s) >> (bgshift)) & 0x0f)
51 #define attr_bgcol_ec(bgshift,vc) \
52 ((vc) ? (((vc)->vc_video_erase_char >> (bgshift)) & 0x0f) : 0)
53 #define attr_fgcol_ec(fgshift,vc) \
54 ((vc) ? (((vc)->vc_video_erase_char >> (fgshift)) & 0x0f) : 0)
57 #define attr_bold(s) \
59 #define attr_reverse(s, inverse) \
60 (((s) & 0x800) ^ (inverse ? 0x800 : 0))
61 #define attr_underline(s) \
63 #define attr_blink(s) \
71 #define __SCROLL_YPAN 0x001
72 #define __SCROLL_YWRAP 0x002
73 #define __SCROLL_YMOVE 0x003
74 #define __SCROLL_YREDRAW 0x004
75 #define __SCROLL_YMASK 0x00f
76 #define __SCROLL_YFIXED 0x010
77 #define __SCROLL_YNOMOVE 0x020
78 #define __SCROLL_YPANREDRAW 0x040
79 #define __SCROLL_YNOPARTIAL 0x080
81 /* Only these should be used by the drivers */
82 /* Which one should you use? If you have a fast card and slow bus,
83 then probably just 0 to indicate fbcon should choose between
84 YWRAP/YPAN+MOVE/YMOVE. On the other side, if you have a fast bus
85 and even better if your card can do fonting (1->8/32bit painting),
86 you should consider either SCROLL_YREDRAW (if your card is
87 able to do neither YPAN/YWRAP), or SCROLL_YNOMOVE.
88 The best is to test it with some real life scrolling (usually, not
89 all lines on the screen are filled completely with non-space characters,
90 and REDRAW performs much better on such lines, so don't cat a file
91 with every line covering all screen columns, it would not be the right
94 #define SCROLL_YREDRAW (__SCROLL_YFIXED|__SCROLL_YREDRAW)
95 #define SCROLL_YNOMOVE (__SCROLL_YNOMOVE|__SCROLL_YPANREDRAW)
97 /* SCROLL_YNOPARTIAL, used in combination with the above, is for video
98 cards which can not handle using panning to scroll a portion of the
99 screen without excessive flicker. Panning will only be used for
102 /* Namespace consistency */
103 #define SCROLL_YNOPARTIAL __SCROLL_YNOPARTIAL
105 extern int fb_console_init(void);
107 #endif /* _VIDEO_FBCON_H */