Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
d53898ad
Commit
d53898ad
authored
Oct 17, 2002
by
James Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a cursor api.
parent
66ccf1ad
Changes
29
Show whitespace changes
Inline
Side-by-side
Showing
29 changed files
with
381 additions
and
186 deletions
+381
-186
drivers/video/Makefile
drivers/video/Makefile
+1
-0
drivers/video/anakinfb.c
drivers/video/anakinfb.c
+1
-0
drivers/video/aty/atyfb_base.c
drivers/video/aty/atyfb_base.c
+2
-2
drivers/video/aty128fb.c
drivers/video/aty128fb.c
+5
-17
drivers/video/clps711xfb.c
drivers/video/clps711xfb.c
+1
-4
drivers/video/console/fbcon-accel.c
drivers/video/console/fbcon-accel.c
+176
-35
drivers/video/console/fbcon.c
drivers/video/console/fbcon.c
+50
-54
drivers/video/dnfb.c
drivers/video/dnfb.c
+1
-0
drivers/video/fbgen.c
drivers/video/fbgen.c
+88
-57
drivers/video/fm2fb.c
drivers/video/fm2fb.c
+1
-0
drivers/video/g364fb.c
drivers/video/g364fb.c
+7
-3
drivers/video/hitfb.c
drivers/video/hitfb.c
+1
-0
drivers/video/hpfb.c
drivers/video/hpfb.c
+1
-0
drivers/video/macfb.c
drivers/video/macfb.c
+1
-0
drivers/video/maxinefb.c
drivers/video/maxinefb.c
+1
-0
drivers/video/neofb.c
drivers/video/neofb.c
+1
-0
drivers/video/offb.c
drivers/video/offb.c
+1
-0
drivers/video/pmag-ba-fb.c
drivers/video/pmag-ba-fb.c
+1
-0
drivers/video/pmagb-b-fb.c
drivers/video/pmagb-b-fb.c
+1
-0
drivers/video/q40fb.c
drivers/video/q40fb.c
+1
-0
drivers/video/sgivwfb.c
drivers/video/sgivwfb.c
+1
-0
drivers/video/skeletonfb.c
drivers/video/skeletonfb.c
+6
-0
drivers/video/tdfxfb.c
drivers/video/tdfxfb.c
+1
-0
drivers/video/tx3912fb.c
drivers/video/tx3912fb.c
+1
-0
drivers/video/vesafb.c
drivers/video/vesafb.c
+1
-0
drivers/video/vfb.c
drivers/video/vfb.c
+9
-8
drivers/video/vga16fb.c
drivers/video/vga16fb.c
+1
-0
include/linux/fb.h
include/linux/fb.h
+17
-5
include/video/fbcon.h
include/video/fbcon.h
+2
-1
No files found.
drivers/video/Makefile
View file @
d53898ad
...
...
@@ -11,6 +11,7 @@ export-objs := fbmem.o fbcmap.o fbgen.o fbmon.o modedb.o cyber2000fb.o
obj-$(CONFIG_AGP)
+=
agp/
obj-$(CONFIG_DRM)
+=
drm/
obj-$(CONFIG_VT)
+=
console/
# Add fbmon.o back into obj-$(CONFIG_FB) in 2.5.x
obj-$(CONFIG_FB)
+=
fbmem.o fbcmap.o modedb.o fbgen.o
...
...
drivers/video/anakinfb.c
View file @
d53898ad
...
...
@@ -66,6 +66,7 @@ static struct fb_ops anakinfb_ops = {
.
fb_fillrect
=
cfb_fillrect
,
.
fb_copyarea
=
cfb_copyarea
,
.
fb_imageblit
=
cfb_imageblit
,
.
fb_cursor
=
cfb_cursor
,
};
int
__init
...
...
drivers/video/aty/atyfb_base.c
View file @
d53898ad
...
...
@@ -158,7 +158,7 @@ extern void atyfb_imageblit(struct fb_info *info, struct fb_image *image);
static
int
atyfb_mmap
(
struct
fb_info
*
info
,
struct
file
*
file
,
struct
vm_area_struct
*
vma
);
#endif
static
int
atyfb_
rasterimg
(
struct
fb_info
*
info
,
int
start
);
static
int
atyfb_
sync
(
struct
fb_info
*
info
);
/*
* Internal routines
...
...
@@ -1126,7 +1126,7 @@ static int atyfb_ioctl(struct inode *inode, struct file *file, u_int cmd,
return
0
;
}
static
int
atyfb_
rasterimg
(
struct
fb_info
*
info
,
int
start
)
static
int
atyfb_
sync
(
struct
fb_info
*
info
)
{
struct
atyfb_par
*
par
=
(
struct
atyfb_par
*
)
info
->
par
;
...
...
drivers/video/aty128fb.c
View file @
d53898ad
...
...
@@ -234,7 +234,6 @@ static struct fb_fix_screeninfo aty128fb_fix __initdata = {
.
accel
=
FB_ACCEL_ATI_RAGE128
,
};
static
const
char
*
aty128fb_name
=
"ATY Rage128"
;
static
char
fontname
[
40
]
__initdata
=
{
0
};
static
int
noaccel
__initdata
=
0
;
...
...
@@ -360,7 +359,7 @@ static int aty128fb_pan_display(struct fb_var_screeninfo *var, int con,
static
int
aty128fb_blank
(
int
blank
,
struct
fb_info
*
fb
);
static
int
aty128fb_ioctl
(
struct
inode
*
inode
,
struct
file
*
file
,
u_int
cmd
,
u_long
arg
,
int
con
,
struct
fb_info
*
info
);
static
int
aty128fb_
rasterimg
(
struct
fb_info
*
info
,
int
start
);
static
int
aty128fb_
sync
(
struct
fb_info
*
info
);
/*
* Interface to the low level console driver
...
...
@@ -397,22 +396,21 @@ static struct fb_ops aty128fb_ops = {
.
fb_set_var
=
gen_set_var
,
.
fb_check_var
=
aty128fb_check_var
,
.
fb_set_par
=
aty128fb_set_par
,
.
fb_get_cmap
=
gen_get_cmap
,
.
fb_set_cmap
=
gen_set_cmap
,
.
fb_setcolreg
=
aty128fb_setcolreg
,
.
fb_pan_display
=
aty128fb_pan_display
,
.
fb_blank
=
aty128fb_blank
,
.
fb_ioctl
=
aty128fb_ioctl
,
.
fb_sync
=
aty128fb_sync
,
#if 0
.fb_fillrect = aty128fb_fillrect,
.fb_copyarea = aty128fb_copyarea,
.fb_imageblit = aty128fb_imageblit,
.fb_rasterimg = aty128fb_rasterimg,
#else
.
fb_fillrect
=
cfb_fillrect
,
.
fb_copyarea
=
cfb_copyarea
,
.
fb_imageblit
=
cfb_imageblit
,
#endif
.
fb_cursor
=
cfb_cursor
,
};
#ifdef CONFIG_PMAC_BACKLIGHT
...
...
@@ -1398,17 +1396,15 @@ aty128_st_pal(u_int regno, u_int red, u_int green, u_int blue,
}
static
int
aty128fb_
rasterimg
(
struct
fb_info
*
info
,
int
start
)
aty128fb_
sync
(
struct
fb_info
*
info
)
{
struct
aty128fb_par
*
par
=
info
->
par
;
if
(
par
->
blitter_may_be_busy
)
wait_for_idle
(
par
);
return
0
;
}
int
__init
aty128fb_setup
(
char
*
options
)
{
...
...
@@ -1507,13 +1503,8 @@ aty128_init(struct fb_info *info, const char *name)
printk
(
"%dk %s
\n
"
,
par
->
vram_size
/
1024
,
par
->
mem
->
name
);
/* fill in info */
strcpy
(
info
->
modename
,
aty128fb_name
);
info
->
node
=
NODEV
;
info
->
fbops
=
&
aty128fb_ops
;
strcpy
(
info
->
fontname
,
fontname
);
info
->
changevar
=
NULL
;
info
->
switch_con
=
gen_switch
;
info
->
updatevar
=
gen_update_var
;
info
->
flags
=
FBINFO_FLAG_DEFAULT
;
#ifdef CONFIG_PMAC_PBOOK
...
...
@@ -1591,10 +1582,8 @@ aty128_init(struct fb_info *info, const char *name)
info
->
var
=
var
;
fb_alloc_cmap
(
&
info
->
cmap
,
256
,
0
);
gen_set_disp
(
-
1
,
info
);
var
.
activate
=
FB_ACTIVATE_NOW
;
gen_set_var
(
&
var
,
-
1
,
info
);
aty128_init_engine
(
par
);
...
...
@@ -1616,7 +1605,7 @@ aty128_init(struct fb_info *info, const char *name)
#endif
printk
(
KERN_INFO
"fb%d: %s frame buffer device on %s
\n
"
,
GET_FB_IDX
(
info
->
node
),
aty128fb_name
,
name
);
GET_FB_IDX
(
info
->
node
),
info
->
fix
.
id
,
name
);
return
1
;
/* success! */
}
...
...
@@ -1693,7 +1682,6 @@ aty128_pci_register(struct pci_dev *pdev,
info
->
par
=
par
;
info
->
disp
=
&
lump
->
disp
;
info
->
fix
=
aty128fb_fix
;
info
->
currcon
=
-
1
;
info
->
pseudo_palette
=
lump
->
pseudo_palette
;
par
->
pdev
=
pdev
;
...
...
drivers/video/clps711xfb.c
View file @
d53898ad
...
...
@@ -214,14 +214,12 @@ static struct fb_ops clps7111fb_ops = {
.
owner
=
THIS_MODULE
,
.
fb_check_var
=
clps7111fb_check_var
,
.
fb_set_par
=
clps7111fb_set_par
,
.
fb_set_var
=
gen_set_var
,
.
fb_set_cmap
=
gen_set_cmap
,
.
fb_get_cmap
=
gen_get_cmap
,
.
fb_setcolreg
=
clps7111fb_setcolreg
,
.
fb_blank
=
clps7111fb_blank
,
.
fb_fillrect
=
cfb_fillrect
,
.
fb_copyarea
=
cfb_copyarea
,
.
fb_imageblit
=
cfb_imageblit
,
.
fb_cursor
=
cfb_cursor
,
};
static
int
...
...
@@ -373,7 +371,6 @@ int __init clps711xfb_init(void)
memset
(
cfb
,
0
,
sizeof
(
*
cfb
));
strcpy
(
cfb
->
fix
.
id
,
"clps711x"
);
cfb
->
currcon
=
-
1
;
cfb
->
fbops
=
&
clps7111fb_ops
;
cfb
->
flags
=
FBINFO_FLAG_DEFAULT
;
...
...
drivers/video/console/fbcon-accel.c
View file @
d53898ad
...
...
@@ -39,13 +39,13 @@ void fbcon_accel_bmove(struct display *p, int sy, int sx, int dy, int dx,
info
->
fbops
->
fb_copyarea
(
info
,
&
area
);
}
void
fbcon_accel_clear
(
struct
vc_data
*
vc
,
struct
display
*
p
,
int
sy
,
int
sx
,
int
height
,
int
width
)
void
fbcon_accel_clear
(
struct
vc_data
*
vc
,
struct
display
*
p
,
int
sy
,
int
sx
,
int
height
,
int
width
)
{
struct
fb_info
*
info
=
p
->
fb_info
;
struct
fb_fillrect
region
;
region
.
color
=
attr_bgcol_ec
(
p
,
vc
);
region
.
color
=
attr_bgcol_ec
(
p
,
vc
);
region
.
dx
=
sx
*
fontwidth
(
p
);
region
.
dy
=
sy
*
fontheight
(
p
);
region
.
width
=
width
*
fontwidth
(
p
);
...
...
@@ -60,7 +60,7 @@ void fbcon_accel_putc(struct vc_data *vc, struct display *p, int c, int yy,
{
struct
fb_info
*
info
=
p
->
fb_info
;
unsigned
short
charmask
=
p
->
charmask
;
unsigned
int
width
=
((
fontwidth
(
p
)
+
7
)
>>
3
);
unsigned
int
width
=
((
fontwidth
(
p
)
+
7
)
>>
3
);
struct
fb_image
image
;
image
.
fg_color
=
attr_fgcol
(
p
,
c
);
...
...
@@ -70,7 +70,7 @@ void fbcon_accel_putc(struct vc_data *vc, struct display *p, int c, int yy,
image
.
width
=
fontwidth
(
p
);
image
.
height
=
fontheight
(
p
);
image
.
depth
=
1
;
image
.
data
=
p
->
fontdata
+
(
c
&
charmask
)
*
fontheight
(
p
)
*
width
;
image
.
data
=
p
->
fontdata
+
(
c
&
charmask
)
*
fontheight
(
p
)
*
width
;
info
->
fbops
->
fb_imageblit
(
info
,
&
image
);
}
...
...
@@ -80,7 +80,7 @@ void fbcon_accel_putcs(struct vc_data *vc, struct display *p,
{
struct
fb_info
*
info
=
p
->
fb_info
;
unsigned
short
charmask
=
p
->
charmask
;
unsigned
int
width
=
((
fontwidth
(
p
)
+
7
)
>>
3
);
unsigned
int
width
=
((
fontwidth
(
p
)
+
7
)
>>
3
);
struct
fb_image
image
;
u16
c
=
scr_readw
(
s
);
...
...
@@ -127,7 +127,7 @@ void fbcon_accel_clear_margins(struct vc_data *vc, struct display *p,
unsigned
int
bs
=
info
->
var
.
yres
-
bh
;
struct
fb_fillrect
region
;
region
.
color
=
attr_bgcol_ec
(
p
,
vc
);
region
.
color
=
attr_bgcol_ec
(
p
,
vc
);
region
.
rop
=
ROP_COPY
;
if
(
rw
&&
!
bottom_only
)
{
...
...
@@ -147,6 +147,146 @@ void fbcon_accel_clear_margins(struct vc_data *vc, struct display *p,
}
}
void
fbcon_accel_cursor
(
struct
display
*
p
,
int
flags
,
int
xx
,
int
yy
)
{
static
u32
palette_index
[
2
];
static
struct
fb_index
index
=
{
2
,
palette_index
};
static
char
mask
[
64
],
image
[
64
],
*
dest
;
static
int
fgcolor
,
bgcolor
,
shape
,
width
,
height
;
struct
fb_info
*
info
=
p
->
fb_info
;
struct
fbcursor
cursor
;
int
c
;
char
*
font
;
cursor
.
set
=
FB_CUR_SETPOS
;
if
(
width
!=
fontwidth
(
p
)
||
height
!=
fontheight
(
p
))
{
width
=
fontwidth
(
p
);
height
=
fontheight
(
p
);
cursor
.
set
|=
FB_CUR_SETSIZE
;
}
if
((
p
->
conp
->
vc_cursor_type
&
0x0f
)
!=
shape
)
{
shape
=
p
->
conp
->
vc_cursor_type
&
0x0f
;
cursor
.
set
|=
FB_CUR_SETSHAPE
;
}
c
=
scr_readw
((
u16
*
)
p
->
cursor_pos
);
if
(
fgcolor
!=
(
int
)
attr_fgcol
(
p
,
c
)
||
bgcolor
!=
(
int
)
attr_bgcol
(
p
,
c
))
{
fgcolor
=
(
int
)
attr_fgcol
(
p
,
c
);
bgcolor
=
(
int
)
attr_bgcol
(
p
,
c
);
cursor
.
set
|=
FB_CUR_SETCMAP
;
}
c
&=
p
->
charmask
;
font
=
p
->
fontdata
+
(
c
*
((
width
+
7
)
/
8
)
*
height
);
if
(
font
!=
dest
)
{
dest
=
font
;
cursor
.
set
|=
FB_CUR_SETDEST
;
}
if
(
flags
&
FB_CUR_SETCUR
)
cursor
.
enable
=
1
;
else
cursor
.
enable
=
0
;
if
(
cursor
.
set
&
FB_CUR_SETCMAP
)
{
palette_index
[
0
]
=
bgcolor
;
palette_index
[
1
]
=
fgcolor
;
}
if
(
cursor
.
set
&
FB_CUR_SETSIZE
)
{
memset
(
image
,
0xff
,
64
);
cursor
.
set
|=
FB_CUR_SETSHAPE
;
}
if
(
cursor
.
set
&
FB_CUR_SETSHAPE
)
{
int
w
,
cur_height
,
size
,
i
=
0
;
w
=
(
width
+
7
)
/
8
;
switch
(
shape
)
{
case
CUR_NONE
:
cur_height
=
0
;
break
;
case
CUR_UNDERLINE
:
cur_height
=
(
height
<
10
)
?
1
:
2
;
break
;
case
CUR_LOWER_THIRD
:
cur_height
=
height
/
3
;
break
;
case
CUR_LOWER_HALF
:
cur_height
=
height
/
2
;
break
;
case
CUR_TWO_THIRDS
:
cur_height
=
(
height
*
2
)
/
3
;
break
;
case
CUR_BLOCK
:
default:
cur_height
=
height
;
break
;
}
size
=
(
height
-
cur_height
)
*
w
;
while
(
size
--
)
mask
[
i
++
]
=
0
;
size
=
cur_height
*
w
;
while
(
size
--
)
mask
[
i
++
]
=
0xff
;
}
cursor
.
size
.
x
=
width
;
cursor
.
size
.
y
=
height
;
cursor
.
pos
.
x
=
xx
*
width
;
cursor
.
pos
.
y
=
yy
*
height
;
cursor
.
image
=
image
;
cursor
.
mask
=
mask
;
cursor
.
dest
=
dest
;
cursor
.
rop
=
ROP_XOR
;
cursor
.
index
=
&
index
;
cursor
.
depth
=
1
;
if
(
info
->
fbops
->
fb_cursor
)
info
->
fbops
->
fb_cursor
(
info
,
&
cursor
);
else
{
int
i
,
size
=
((
cursor
.
size
.
x
+
7
)
/
8
)
*
cursor
.
size
.
y
;
struct
fb_image
image
;
static
char
data
[
64
];
image
.
bg_color
=
cursor
.
index
->
entry
[
0
];
image
.
fg_color
=
cursor
.
index
->
entry
[
1
];
if
(
cursor
.
enable
)
{
switch
(
cursor
.
rop
)
{
case
ROP_XOR
:
for
(
i
=
0
;
i
<
size
;
i
++
)
data
[
i
]
=
(
cursor
.
image
[
i
]
&
cursor
.
mask
[
i
])
^
cursor
.
dest
[
i
];
break
;
case
ROP_COPY
:
default:
for
(
i
=
0
;
i
<
size
;
i
++
)
data
[
i
]
=
cursor
.
image
[
i
]
&
cursor
.
mask
[
i
];
break
;
}
}
else
memcpy
(
data
,
&
cursor
.
dest
,
size
);
image
.
dx
=
cursor
.
pos
.
x
;
image
.
dy
=
cursor
.
pos
.
y
;
image
.
width
=
cursor
.
size
.
x
;
image
.
height
=
cursor
.
size
.
y
;
image
.
depth
=
cursor
.
depth
;
image
.
data
=
data
;
if
(
info
->
fbops
->
fb_imageblit
)
info
->
fbops
->
fb_imageblit
(
info
,
&
image
);
}
}
/*
* `switch' for the low level operations
*/
...
...
@@ -158,8 +298,9 @@ struct display_switch fbcon_accel = {
.
putc
=
fbcon_accel_putc
,
.
putcs
=
fbcon_accel_putcs
,
.
revc
=
fbcon_accel_revc
,
.
clear_margins
=
fbcon_accel_clear_margins
,
.
fontwidthmask
=
FONTWIDTHRANGE
(
1
,
16
)
.
clear_margins
=
fbcon_accel_clear_margins
,
.
cursor
=
fbcon_accel_cursor
,
.
fontwidthmask
=
FONTWIDTHRANGE
(
1
,
16
)
};
#ifdef MODULE
...
...
@@ -171,10 +312,10 @@ int init_module(void)
}
void
cleanup_module
(
void
)
{}
{
}
#endif
/* MODULE */
/*
* Visible symbols for modules
*/
...
...
drivers/video/console/fbcon.c
View file @
d53898ad
...
...
@@ -929,7 +929,6 @@ static void fbcon_putcs(struct vc_data *conp, const unsigned short *s, int count
vbl_cursor_cnt
=
CURSOR_DRAW_DELAY
;
}
static
void
fbcon_cursor
(
struct
vc_data
*
conp
,
int
mode
)
{
int
unit
=
conp
->
vc_num
;
...
...
@@ -947,14 +946,6 @@ static void fbcon_cursor(struct vc_data *conp, int mode)
}
else
if
(
softback_lines
)
fbcon_set_origin
(
conp
);
/* do we have a hardware cursor ? */
if
(
p
->
dispsw
->
cursor
)
{
p
->
cursor_x
=
conp
->
vc_x
;
p
->
cursor_y
=
y
;
p
->
dispsw
->
cursor
(
p
,
mode
,
p
->
cursor_x
,
real_y
(
p
,
p
->
cursor_y
));
return
;
}
/* Avoid flickering if there's no real change. */
if
(
p
->
cursor_x
==
conp
->
vc_x
&&
p
->
cursor_y
==
y
&&
(
mode
==
CM_ERASE
)
==
!
cursor_on
)
...
...
@@ -962,10 +953,11 @@ static void fbcon_cursor(struct vc_data *conp, int mode)
cursor_on
=
0
;
if
(
cursor_drawn
)
p
->
dispsw
->
revc
(
p
,
p
->
cursor_x
,
real_y
(
p
,
p
->
cursor_y
));
p
->
dispsw
->
cursor
(
p
,
0
,
p
->
cursor_x
,
real_y
(
p
,
p
->
cursor_y
));
p
->
cursor_x
=
conp
->
vc_x
;
p
->
cursor_y
=
y
;
p
->
cursor_pos
=
conp
->
vc_pos
;
switch
(
mode
)
{
case
CM_ERASE
:
...
...
@@ -974,13 +966,13 @@ static void fbcon_cursor(struct vc_data *conp, int mode)
case
CM_MOVE
:
case
CM_DRAW
:
if
(
cursor_drawn
)
p
->
dispsw
->
revc
(
p
,
p
->
cursor_x
,
real_y
(
p
,
p
->
cursor_y
));
p
->
dispsw
->
cursor
(
p
,
FB_CUR_SETCUR
,
p
->
cursor_x
,
real_y
(
p
,
p
->
cursor_y
));
vbl_cursor_cnt
=
CURSOR_DRAW_DELAY
;
cursor_on
=
1
;
break
;
}
}
}
static
void
fbcon_vbl_handler
(
int
irq
,
void
*
dummy
,
struct
pt_regs
*
fp
)
{
...
...
@@ -990,9 +982,13 @@ static void fbcon_vbl_handler(int irq, void *dummy, struct pt_regs *fp)
return
;
if
(
vbl_cursor_cnt
&&
--
vbl_cursor_cnt
==
0
)
{
int
flag
;
p
=
&
fb_display
[
fg_console
];
if
(
p
->
dispsw
->
revc
)
p
->
dispsw
->
revc
(
p
,
p
->
cursor_x
,
real_y
(
p
,
p
->
cursor_y
));
flag
=
0
;
if
(
!
cursor_drawn
)
flag
=
FB_CUR_SETCUR
;
p
->
dispsw
->
cursor
(
p
,
flag
,
p
->
cursor_x
,
real_y
(
p
,
p
->
cursor_y
));
cursor_drawn
^=
1
;
vbl_cursor_cnt
=
cursor_blink_rate
;
}
...
...
drivers/video/dnfb.c
View file @
d53898ad
...
...
@@ -121,6 +121,7 @@ static struct fb_ops dn_fb_ops = {
.
fb_fillrect
=
cfb_fillrect
,
.
fb_copyarea
=
dnfb_copyarea
,
.
fb_imageblit
=
cfb_imageblit
,
.
fb_cursor
=
cfb_cursor
,
};
struct
fb_var_screeninfo
dnfb_var
__initdata
=
{
...
...
drivers/video/fbgen.c
View file @
d53898ad
...
...
@@ -40,13 +40,54 @@ int fb_set_var(struct fb_var_screeninfo *var, struct fb_info *info)
info
->
fbops
->
fb_set_par
(
info
);
if
(
info
->
fbops
->
fb_pan_display
)
info
->
fbops
->
fb_pan_display
(
&
info
->
var
,
info
);
info
->
fbops
->
fb_pan_display
(
&
info
->
var
,
info
);
fb_set_cmap
(
&
info
->
cmap
,
1
,
info
);
}
}
return
0
;
}
int
cfb_cursor
(
struct
fb_info
*
info
,
struct
fbcursor
*
cursor
)
{
int
i
,
size
=
((
cursor
->
size
.
x
+
7
)
/
8
)
*
cursor
->
size
.
y
;
struct
fb_image
image
;
static
char
data
[
64
];
image
.
bg_color
=
cursor
->
index
->
entry
[
0
];
image
.
fg_color
=
cursor
->
index
->
entry
[
1
];
if
(
cursor
->
depth
==
1
)
{
if
(
cursor
->
enable
)
{
switch
(
cursor
->
rop
)
{
case
ROP_XOR
:
for
(
i
=
0
;
i
<
size
;
i
++
)
data
[
i
]
=
(
cursor
->
image
[
i
]
&
cursor
->
mask
[
i
])
^
cursor
->
dest
[
i
];
break
;
case
ROP_COPY
:
default:
for
(
i
=
0
;
i
<
size
;
i
++
)
data
[
i
]
=
cursor
->
image
[
i
]
&
cursor
->
mask
[
i
];
break
;
}
}
else
memcpy
(
data
,
cursor
->
dest
,
size
);
image
.
dx
=
cursor
->
pos
.
x
;
image
.
dy
=
cursor
->
pos
.
y
;
image
.
width
=
cursor
->
size
.
x
;
image
.
height
=
cursor
->
size
.
y
;
image
.
depth
=
cursor
->
depth
;
image
.
data
=
data
;
if
(
info
->
fbops
->
fb_imageblit
)
info
->
fbops
->
fb_imageblit
(
info
,
&
image
);
}
}
int
fb_pan_display
(
struct
fb_var_screeninfo
*
var
,
struct
fb_info
*
info
)
{
int
xoffset
=
var
->
xoffset
;
...
...
@@ -72,18 +113,6 @@ int fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
return
0
;
}
/* ---- Helper functions --------------------------------------------------- */
/**
* fb_blank - blank the screen
* @blank: boolean, 0 unblank, 1 blank
* @info: frame buffer info structure
*
* Blank the screen on device @info.
*
*/
int
fb_blank
(
int
blank
,
struct
fb_info
*
info
)
{
struct
fb_cmap
cmap
;
...
...
@@ -92,7 +121,7 @@ int fb_blank(int blank, struct fb_info *info)
if
(
info
->
fbops
->
fb_blank
&&
!
info
->
fbops
->
fb_blank
(
blank
,
info
))
return
0
;
if
(
blank
)
{
memset
(
black
,
0
,
16
*
sizeof
(
u16
));
memset
(
black
,
0
,
16
*
sizeof
(
u16
));
cmap
.
red
=
black
;
cmap
.
green
=
black
;
cmap
.
blue
=
black
;
...
...
@@ -104,7 +133,8 @@ int fb_blank(int blank, struct fb_info *info)
if
(
info
->
cmap
.
len
)
fb_set_cmap
(
&
info
->
cmap
,
1
,
info
);
else
{
int
size
=
info
->
var
.
bits_per_pixel
==
16
?
64
:
256
;
int
size
=
info
->
var
.
bits_per_pixel
==
16
?
64
:
256
;
fb_set_cmap
(
fb_default_cmap
(
size
),
1
,
info
);
}
}
...
...
@@ -113,6 +143,7 @@ int fb_blank(int blank, struct fb_info *info)
/* generic frame buffer operations */
EXPORT_SYMBOL
(
fb_set_var
);
EXPORT_SYMBOL
(
cfb_cursor
);
EXPORT_SYMBOL
(
fb_pan_display
);
EXPORT_SYMBOL
(
fb_blank
);
...
...
drivers/video/fm2fb.c
View file @
d53898ad
...
...
@@ -178,6 +178,7 @@ static struct fb_ops fm2fb_ops = {
.
fb_fillrect
=
cfb_fillrect
,
.
fb_copyarea
=
cfb_copyarea
,
.
fb_imageblit
=
cfb_imageblit
,
.
fb_cursor
=
cfb_cursor
,
};
/*
...
...
drivers/video/g364fb.c
View file @
d53898ad
...
...
@@ -111,6 +111,7 @@ static int g364fb_pan_display(struct fb_var_screeninfo *var,
static
int
g364fb_setcolreg
(
u_int
regno
,
u_int
red
,
u_int
green
,
u_int
blue
,
u_int
transp
,
struct
fb_info
*
info
);
static
int
g364fb_cursor
(
struct
fb_info
*
info
,
struct
fb_cursor
*
cursor
);
static
int
g364fb_blank
(
int
blank
,
struct
fb_info
*
info
);
static
struct
fb_ops
g364fb_ops
=
{
...
...
@@ -121,11 +122,13 @@ static struct fb_ops g364fb_ops = {
.
fb_fillrect
=
cfb_fillrect
,
.
fb_copyarea
=
cfb_copyarea
,
.
fb_imageblit
=
cfb_imageblit
,
.
fb_cursor
=
g364fb_cursor
,
};
void
fbcon_g364fb_cursor
(
struct
display
*
p
,
int
mode
,
int
x
,
int
y
)
int
g364fb_cursor
(
struct
fb_info
*
info
,
struct
fb_cursor
*
cursor
)
{
switch
(
mode
)
{
switch
(
cursor
->
enable
)
{
case
CM_ERASE
:
*
(
unsigned
int
*
)
CTLA_REG
|=
CURS_TOGGLE
;
break
;
...
...
@@ -135,9 +138,10 @@ void fbcon_g364fb_cursor(struct display *p, int mode, int x, int y)
*
(
unsigned
int
*
)
CTLA_REG
&=
~
CURS_TOGGLE
;
*
(
unsigned
int
*
)
CURS_POS_REG
=
((
x
*
fontwidth
(
p
))
<<
12
)
|
((
y
*
fontheight
(
p
))
-
p
->
var
.
yoffset
);
info
->
var
.
yoffset
);
break
;
}
return
0
;
}
/*
...
...
drivers/video/hitfb.c
View file @
d53898ad
...
...
@@ -128,6 +128,7 @@ static struct fb_ops hitfb_ops = {
.
fb_fillrect
=
cfb_fillrect
,
.
fb_copyarea
=
cfb_copyarea
,
.
fb_imageblit
=
cfb_imageblit
,
.
fb_cursor
=
cfb_cursor
,
};
int
__init
hitfb_init
(
void
)
...
...
drivers/video/hpfb.c
View file @
d53898ad
...
...
@@ -105,6 +105,7 @@ static struct fb_ops hpfb_ops = {
.
fb_fillrect
=
cfb_fillrect
,
.
fb_copyarea
=
hpfb_copyarea
,
.
fb_imageblit
=
cfb_imageblit
,
.
fb_cursor
=
cfb_cursor
,
};
#define TOPCAT_FBOMSB 0x5d
...
...
drivers/video/macfb.c
View file @
d53898ad
...
...
@@ -589,6 +589,7 @@ static struct fb_ops macfb_ops = {
.
fb_fillrect
=
cfb_fillrect
,
.
fb_copyarea
=
cfb_copyarea
,
.
fb_imageblit
=
cfb_imageblit
,
.
fb_cursor
=
cfb_cursor
,
};
void
__init
macfb_setup
(
char
*
options
,
int
*
ints
)
...
...
drivers/video/maxinefb.c
View file @
d53898ad
...
...
@@ -114,6 +114,7 @@ static struct fb_ops maxinefb_ops = {
.
fb_fillrect
=
cfb_fillrect
,
.
fb_copyarea
=
cfb_copyarea
,
.
fb_imageblit
=
cfb_imageblit
,
.
fb_cursor
=
cfb_cursor
,
};
int
__init
maxinefb_init
(
void
)
...
...
drivers/video/neofb.c
View file @
d53898ad
...
...
@@ -1393,6 +1393,7 @@ static struct fb_ops neofb_ops = {
.
fb_fillrect
=
cfb_fillrect
,
.
fb_copyarea
=
cfb_copyarea
,
.
fb_imageblit
=
cfb_imageblit
,
.
fb_cursor
=
cfb_cursor
,
};
/* --------------------------------------------------------------------- */
...
...
drivers/video/offb.c
View file @
d53898ad
...
...
@@ -86,6 +86,7 @@ static struct fb_ops offb_ops = {
.
fb_fillrect
=
cfb_fillrect
,
.
fb_copyarea
=
cfb_copyarea
,
.
fb_imageblit
=
cfb_imageblit
,
.
fb_cursor
=
cfb_cursor
,
};
/*
...
...
drivers/video/pmag-ba-fb.c
View file @
d53898ad
...
...
@@ -112,6 +112,7 @@ static struct fb_ops pmagbafb_ops = {
.
fb_fillrect
=
cfb_fillrect
,
.
fb_copyarea
=
cfb_copyarea
,
.
fb_imageblit
=
cfb_imageblit
,
.
fb_cursor
=
cfb_cursor
,
}
int
__init
pmagbafb_init_one
(
int
slot
)
...
...
drivers/video/pmagb-b-fb.c
View file @
d53898ad
...
...
@@ -115,6 +115,7 @@ static struct fb_ops pmagbbfb_ops = {
.
fb_fillrect
=
cfb_fillrect
,
.
fb_copyarea
=
cfb_copyarea
,
.
fb_imageblit
=
cfb_imageblit
,
.
fb_cursor
=
cfb_cursor
,
};
int
__init
pmagbbfb_init_one
(
int
slot
)
...
...
drivers/video/q40fb.c
View file @
d53898ad
...
...
@@ -70,6 +70,7 @@ static struct fb_ops q40fb_ops = {
.
fb_fillrect
=
cfb_fillrect
,
.
fb_copyarea
=
cfb_copyarea
,
.
fb_imageblit
=
cfb_imageblit
,
.
fb_cursor
=
cfb_cursor
,
};
static
int
q40fb_setcolreg
(
unsigned
regno
,
unsigned
red
,
unsigned
green
,
...
...
drivers/video/sgivwfb.c
View file @
d53898ad
...
...
@@ -105,6 +105,7 @@ static struct fb_ops sgivwfb_ops = {
.
fb_fillrect
=
cfb_fillrect
,
.
fb_copyarea
=
cfb_copyarea
,
.
fb_imageblit
=
cfb_imageblit
,
.
fb_cursor
=
cfb_cursor
,
.
fb_mmap
=
sgivwfb_mmap
,
};
...
...
drivers/video/skeletonfb.c
View file @
d53898ad
...
...
@@ -283,6 +283,12 @@ static int xxxfb_setcolreg(unsigned regno, unsigned red, unsigned green,
return
0
;
}
/**
* xxxfb_cursor -
*
* Returns negative errno on error, or zero on success.
*/
/**
* xxxfb_pan_display - NOT a required function. Pans the display.
* @var: frame buffer variable screen structure
...
...
drivers/video/tdfxfb.c
View file @
d53898ad
...
...
@@ -176,6 +176,7 @@ static struct fb_ops tdfxfb_ops = {
.
fb_fillrect
=
tdfxfb_fillrect
,
.
fb_copyarea
=
tdfxfb_copyarea
,
.
fb_imageblit
=
tdfxfb_imageblit
,
.
fb_cursor
=
cfb_cursor
,
};
/*
...
...
drivers/video/tx3912fb.c
View file @
d53898ad
...
...
@@ -98,6 +98,7 @@ static struct fb_ops tx3912fb_ops = {
.
fb_fillrect
=
cfb_fillrect
,
.
fb_copyarea
=
cfb_copyarea
,
.
fb_imageblit
=
cfb_imageblit
,
.
fb_cursor
=
cfb_cursor
,
};
static
int
tx3912fb_check_var
(
struct
fb_var_screeninfo
*
var
,
struct
fb_info
*
info
)
...
...
drivers/video/vesafb.c
View file @
d53898ad
...
...
@@ -175,6 +175,7 @@ static struct fb_ops vesafb_ops = {
.
fb_fillrect
=
cfb_fillrect
,
.
fb_copyarea
=
cfb_copyarea
,
.
fb_imageblit
=
cfb_imageblit
,
.
fb_cursor
=
cfb_cursor
,
};
int
__init
vesafb_setup
(
char
*
options
)
...
...
drivers/video/vfb.c
View file @
d53898ad
...
...
@@ -93,14 +93,15 @@ static int vfb_mmap(struct fb_info *info, struct file *file,
struct
vm_area_struct
*
vma
);
static
struct
fb_ops
vfb_ops
=
{
.
fb_check_var
vfb_check_var
,
.
fb_set_par
vfb_set_par
,
.
fb_setcolreg
vfb_setcolreg
,
.
fb_pan_display
vfb_pan_display
,
.
fb_fillrect
cfb_fillrect
,
.
fb_copyarea
cfb_copyarea
,
.
fb_imageblit
cfb_imageblit
,
.
fb_mmap
vfb_mmap
,
.
fb_check_var
=
vfb_check_var
,
.
fb_set_par
=
vfb_set_par
,
.
fb_setcolreg
=
vfb_setcolreg
,
.
fb_pan_display
=
vfb_pan_display
,
.
fb_fillrect
=
cfb_fillrect
,
.
fb_copyarea
=
cfb_copyarea
,
.
fb_imageblit
=
cfb_imageblit
,
.
fb_cursor
=
cfb_cursor
,
.
fb_mmap
=
vfb_mmap
,
};
/*
...
...
drivers/video/vga16fb.c
View file @
d53898ad
...
...
@@ -1054,6 +1054,7 @@ static struct fb_ops vga16fb_ops = {
.
fb_pan_display
=
vga16fb_pan_display
,
.
fb_blank
=
vga16fb_blank
,
.
fb_imageblit
=
vga16fb_imageblit
,
.
fb_cursor
=
cfb_cursor
,
};
int
vga16fb_setup
(
char
*
options
)
...
...
include/linux/fb.h
View file @
d53898ad
...
...
@@ -222,6 +222,11 @@ struct fb_cmap {
__u16
*
transp
;
/* transparency, can be NULL */
};
struct
fb_index
{
__u32
len
;
/* number of entries */
__u32
*
entry
;
/* "pseudopalette" color index entries */
};
struct
fb_con2fbmap
{
__u32
console
;
__u32
framebuffer
;
...
...
@@ -268,7 +273,9 @@ struct fb_vblank {
#define FB_CUR_SETHOT 0x04
#define FB_CUR_SETCMAP 0x08
#define FB_CUR_SETSHAPE 0x10
#define FB_CUR_SETALL 0x1F
#define FB_CUR_SETDEST 0x20
#define FB_CUR_SETSIZE 0x40
#define FB_CUR_SETALL 0xFF
struct
fbcurpos
{
__u16
x
,
y
;
...
...
@@ -277,12 +284,16 @@ struct fbcurpos {
struct
fbcursor
{
__u16
set
;
/* what to set */
__u16
enable
;
/* cursor on/off */
__u8
rop
;
/* bitop operation */
__u8
depth
;
/* color depth of image */
struct
fbcurpos
pos
;
/* cursor position */
struct
fbcurpos
hot
;
/* cursor hot spot */
struct
fb_cmap
cmap
;
/* color map info */
struct
fbcurpos
size
;
/* cursor bit map size */
struct
fb_cmap
cmap
;
/* color map info */
struct
fb_index
*
index
;
char
*
image
;
/* cursor image bits */
char
*
mask
;
/* cursor mask bits */
char
*
dest
;
/* destination */
};
/* Internal HW accel */
...
...
@@ -314,7 +325,7 @@ struct fb_image {
__u32
height
;
__u32
fg_color
;
/* Only used when a mono bitmap */
__u32
bg_color
;
__u8
depth
;
/* D
pe
th of the image */
__u8
depth
;
/* D
ep
th of the image */
char
*
data
;
/* Pointer to image data */
};
...
...
@@ -351,8 +362,6 @@ struct fb_ops {
int
(
*
fb_check_var
)(
struct
fb_var_screeninfo
*
var
,
struct
fb_info
*
info
);
/* set the video mode according to par */
int
(
*
fb_set_par
)(
struct
fb_info
*
info
);
/* cursor control */
int
(
*
fb_cursor
)(
struct
fb_info
*
info
,
struct
fbcursor
*
cursor
);
/* set color register */
int
(
*
fb_setcolreg
)(
unsigned
regno
,
unsigned
red
,
unsigned
green
,
unsigned
blue
,
unsigned
transp
,
struct
fb_info
*
info
);
...
...
@@ -366,6 +375,8 @@ struct fb_ops {
void
(
*
fb_copyarea
)(
struct
fb_info
*
info
,
struct
fb_copyarea
*
region
);
/* Draws a image to the display */
void
(
*
fb_imageblit
)(
struct
fb_info
*
info
,
struct
fb_image
*
image
);
/* Draws cursor */
int
(
*
fb_cursor
)(
struct
fb_info
*
info
,
struct
fbcursor
*
cursor
);
/* perform polling on fb device */
int
(
*
fb_poll
)(
struct
fb_info
*
info
,
poll_table
*
wait
);
/* wait for blit idle, optional */
...
...
@@ -451,6 +462,7 @@ struct fb_info {
extern
int
fb_set_var
(
struct
fb_var_screeninfo
*
var
,
struct
fb_info
*
info
);
extern
int
fb_pan_display
(
struct
fb_var_screeninfo
*
var
,
struct
fb_info
*
info
);
extern
int
fb_blank
(
int
blank
,
struct
fb_info
*
info
);
extern
int
cfb_cursor
(
struct
fb_info
*
info
,
struct
fbcursor
*
cursor
);
extern
void
cfb_fillrect
(
struct
fb_info
*
info
,
struct
fb_fillrect
*
rect
);
extern
void
cfb_copyarea
(
struct
fb_info
*
info
,
struct
fb_copyarea
*
area
);
extern
void
cfb_imageblit
(
struct
fb_info
*
info
,
struct
fb_image
*
image
);
...
...
include/video/fbcon.h
View file @
d53898ad
...
...
@@ -36,7 +36,7 @@ struct display_switch {
void
(
*
putcs
)(
struct
vc_data
*
conp
,
struct
display
*
p
,
const
unsigned
short
*
s
,
int
count
,
int
yy
,
int
xx
);
void
(
*
revc
)(
struct
display
*
p
,
int
xx
,
int
yy
);
void
(
*
cursor
)(
struct
display
*
p
,
int
mode
,
int
xx
,
int
yy
);
void
(
*
cursor
)(
struct
display
*
p
,
int
flags
,
int
xx
,
int
yy
);
int
(
*
set_font
)(
struct
display
*
p
,
int
width
,
int
height
);
void
(
*
clear_margins
)(
struct
vc_data
*
conp
,
struct
display
*
p
,
int
bottom_only
);
...
...
@@ -69,6 +69,7 @@ struct display {
int
vrows
;
/* number of virtual rows */
unsigned
short
cursor_x
;
/* current cursor position */
unsigned
short
cursor_y
;
unsigned
long
cursor_pos
;
int
fgcol
;
/* text colors */
int
bgcol
;
u_long
next_line
;
/* offset to one line below */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment