11 #ifndef _VIDEO_FBCON_H
12 #define _VIDEO_FBCON_H
14 #include <linux/types.h>
20 #define FBCON_FLAGS_INIT 1
21 #define FBCON_FLAGS_CURSOR_TIMER 2
60 const unsigned short *
s,
int count,
int yy,
int xx,
65 int softback_lines,
int fg,
int bg);
93 #define attr_fgcol(fgshift,s) \
94 (((s) >> (fgshift)) & 0x0f)
95 #define attr_bgcol(bgshift,s) \
96 (((s) >> (bgshift)) & 0x0f)
99 #define attr_bold(s) \
101 #define attr_reverse(s) \
103 #define attr_underline(s) \
105 #define attr_blink(s) \
109 static inline int mono_col(
const struct fb_info *
info)
112 max_len =
max(info->
var.green.length, info->
var.red.length);
113 max_len =
max(info->
var.blue.length, max_len);
114 return (~(0xfff << max_len)) & 0xff;
117 static inline int attr_col_ec(
int shift,
struct vc_data *
vc,
135 col = mono_col(info);
139 fg = is_mono01 ? col : 0;
140 bg = is_mono01 ? 0 : col;
143 fg = is_mono01 ? 0 : col;
144 bg = is_mono01 ? col : 0;
147 return is_fg ? fg :
bg;
150 #define attr_bgcol_ec(bgshift, vc, info) attr_col_ec(bgshift, vc, info, 0)
151 #define attr_fgcol_ec(fgshift, vc, info) attr_col_ec(fgshift, vc, info, 1)
154 #define REFCOUNT(fd) (((int *)(fd))[-1])
155 #define FNTSIZE(fd) (((int *)(fd))[-2])
156 #define FNTCHARCNT(fd) (((int *)(fd))[-3])
157 #define FNTSUM(fd) (((int *)(fd))[-4])
158 #define FONT_EXTRA_WORDS 4
210 #define SCROLL_MOVE 0x001
211 #define SCROLL_PAN_MOVE 0x002
212 #define SCROLL_WRAP_MOVE 0x003
213 #define SCROLL_REDRAW 0x004
214 #define SCROLL_PAN_REDRAW 0x005
216 #ifdef CONFIG_FB_TILEBLITTING
222 #define FBCON_ATTRIBUTE_UNDERLINE 1
223 #define FBCON_ATTRIBUTE_REVERSE 2
224 #define FBCON_ATTRIBUTE_BOLD 4
226 static inline int real_y(
struct display *
p,
int ypos)
231 return ypos < rows ? ypos : ypos -
rows;
235 static inline int get_attribute(
struct fb_info *info,
u16 c)
251 #define FBCON_SWAP(i,r,v) ({ \
252 typeof(r) _r = (r); \
253 typeof(v) _v = (v); \
254 (void) (&_r == &_v); \
255 (i == FB_ROTATE_UR || i == FB_ROTATE_UD) ? _r : _v; })
257 #ifdef CONFIG_FRAMEBUFFER_CONSOLE_ROTATION
260 #define fbcon_set_rotate(x) do {} while(0)