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
87203ecd
Commit
87203ecd
authored
Dec 01, 2002
by
James Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ported riva and vga16fb over to new api. Thanks Antonia Daplas!!! More optimizations in fbcon.c
parent
96b01c31
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
710 additions
and
865 deletions
+710
-865
drivers/video/Makefile
drivers/video/Makefile
+1
-1
drivers/video/console/fbcon.c
drivers/video/console/fbcon.c
+84
-58
drivers/video/riva/Makefile
drivers/video/riva/Makefile
+1
-1
drivers/video/riva/accel.c
drivers/video/riva/accel.c
+0
-427
drivers/video/riva/fbdev.c
drivers/video/riva/fbdev.c
+502
-324
drivers/video/riva/rivafb.h
drivers/video/riva/rivafb.h
+8
-2
drivers/video/vga16fb.c
drivers/video/vga16fb.c
+114
-52
No files found.
drivers/video/Makefile
View file @
87203ecd
...
...
@@ -69,7 +69,7 @@ obj-$(CONFIG_FB_MAXINE) += maxinefb.o cfbfillrect.o cfbcopyarea.o cfbi
obj-$(CONFIG_FB_TX3912)
+=
tx3912fb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
obj-$(CONFIG_FB_MATROX)
+=
matrox/
obj-$(CONFIG_FB_RIVA)
+=
riva/
obj-$(CONFIG_FB_RIVA)
+=
riva/
cfbfillrect.o cfbcopyarea.o cfbimgblt.o
obj-$(CONFIG_FB_SIS)
+=
sis/
obj-$(CONFIG_FB_ATY)
+=
aty/ cfbimgblt.o
...
...
drivers/video/console/fbcon.c
View file @
87203ecd
This diff is collapsed.
Click to expand it.
drivers/video/riva/Makefile
View file @
87203ecd
...
...
@@ -4,6 +4,6 @@
obj-$(CONFIG_FB_RIVA)
+=
rivafb.o
rivafb-objs
:=
fbdev.o riva_hw.o
accel.o
rivafb-objs
:=
fbdev.o riva_hw.o
include
$(TOPDIR)/Rules.make
drivers/video/riva/accel.c
deleted
100644 → 0
View file @
96b01c31
This diff is collapsed.
Click to expand it.
drivers/video/riva/fbdev.c
View file @
87203ecd
This diff is collapsed.
Click to expand it.
drivers/video/riva/rivafb.h
View file @
87203ecd
...
...
@@ -3,7 +3,6 @@
#include <linux/config.h>
#include <linux/fb.h>
#include <video/fbcon.h>
#include "riva_hw.h"
/* GGI compatibility macros */
...
...
@@ -23,6 +22,10 @@ struct riva_regs {
RIVA_HW_STATE
ext
;
};
typedef
struct
{
unsigned
char
red
,
green
,
blue
,
transp
;
}
riva_cfb8_cmap_t
;
struct
riva_par
{
RIVA_HW_INST
riva
;
/* interface to riva_hw.c */
...
...
@@ -32,7 +35,10 @@ struct riva_par {
struct
riva_regs
initial_state
;
/* initial startup video mode */
struct
riva_regs
current_state
;
struct
riva_cursor
*
cursor
;
riva_cfb8_cmap_t
cmap
[
256
];
/* VGA DAC palette cache */
u32
riva_palette
[
16
];
u32
cursor_data
[
32
*
32
/
4
];
int
cursor_reset
;
#ifdef CONFIG_MTRR
struct
{
int
vram
;
int
vram_valid
;
}
mtrr
;
#endif
...
...
drivers/video/vga16fb.c
View file @
87203ecd
...
...
@@ -1062,8 +1062,10 @@ void vga_8planes_copyarea(struct fb_info *info, struct fb_copyarea *area)
}
}
else
{
line_ofs
=
info
->
fix
.
line_length
-
area
->
width
;
dest
=
info
->
screen_base
+
area
->
dx
+
area
->
width
+
(
area
->
dy
+
height
-
1
)
*
info
->
fix
.
line_length
;
src
=
info
->
screen_base
+
area
->
sx
+
area
->
width
+
(
area
->
sy
+
height
-
1
)
*
info
->
fix
.
line_length
;
dest
=
info
->
screen_base
+
area
->
dx
+
area
->
width
+
(
area
->
dy
+
height
-
1
)
*
info
->
fix
.
line_length
;
src
=
info
->
screen_base
+
area
->
sx
+
area
->
width
+
(
area
->
sy
+
height
-
1
)
*
info
->
fix
.
line_length
;
while
(
height
--
)
{
for
(
x
=
0
;
x
<
area
->
width
;
x
++
)
{
--
src
;
...
...
@@ -1147,8 +1149,10 @@ void vga16fb_copyarea(struct fb_info *info, struct fb_copyarea *area)
dst
+=
line_ofs
;
}
}
else
{
dst
=
info
->
screen_base
+
(
area
->
dx
/
8
)
+
width
+
(
area
->
dy
+
height
-
1
)
*
info
->
fix
.
line_length
;
src
=
info
->
screen_base
+
(
area
->
sx
/
8
)
+
width
+
(
area
->
sy
+
height
-
1
)
*
info
->
fix
.
line_length
;
dst
=
info
->
screen_base
+
(
area
->
dx
/
8
)
+
width
+
(
area
->
dy
+
height
-
1
)
*
info
->
fix
.
line_length
;
src
=
info
->
screen_base
+
(
area
->
sx
/
8
)
+
width
+
(
area
->
sy
+
height
-
1
)
*
info
->
fix
.
line_length
;
while
(
height
--
)
{
for
(
x
=
0
;
x
<
width
;
x
++
)
{
dst
--
;
...
...
@@ -1224,68 +1228,120 @@ void vga_8planes_imageblit(struct fb_info *info, struct fb_image *image)
void
vga_imageblit_expand
(
struct
fb_info
*
info
,
struct
fb_image
*
image
)
{
char
*
where
=
info
->
screen_base
+
(
image
->
dx
/
image
->
width
)
+
image
->
dy
*
info
->
fix
.
line_length
;
char
*
where
=
info
->
screen_base
+
(
image
->
dx
/
8
)
+
image
->
dy
*
info
->
fix
.
line_length
;
struct
vga16fb_par
*
par
=
(
struct
vga16fb_par
*
)
info
->
par
;
u8
*
cdat
=
image
->
data
;
int
y
;
u8
*
cdat
=
image
->
data
,
*
dst
;
int
x
,
y
;
switch
(
info
->
fix
.
type
)
{
case
FB_TYPE_VGA_PLANES
:
if
(
info
->
fix
.
type_aux
==
FB_AUX_VGA_PLANES_VGA4
)
{
if
(
par
->
isVGA
)
{
setmode
(
2
);
setop
(
0
);
setsr
(
0xf
);
setcolor
(
image
->
fg_color
);
selectmask
();
setmask
(
0xff
);
writeb
(
image
->
bg_color
,
where
);
rmb
();
readb
(
where
);
/* fill latches */
setmode
(
3
);
wmb
();
for
(
y
=
0
;
y
<
image
->
height
;
y
++
,
where
+=
info
->
fix
.
line_length
)
writeb
(
cdat
[
y
],
where
);
wmb
();
}
else
{
setmode
(
0
);
setop
(
0
);
setsr
(
0xf
);
setcolor
(
image
->
bg_color
);
selectmask
();
setmask
(
0xff
);
for
(
y
=
0
;
y
<
image
->
height
;
y
++
,
where
+=
info
->
fix
.
line_length
)
rmw
(
where
);
where
-=
info
->
fix
.
line_length
*
y
;
setcolor
(
image
->
fg_color
);
selectmask
();
for
(
y
=
0
;
y
<
image
->
height
;
y
++
,
where
+=
info
->
fix
.
line_length
)
if
(
cdat
[
y
])
{
setmask
(
cdat
[
y
]);
rmw
(
where
);
case
FB_TYPE_VGA_PLANES
:
if
(
info
->
fix
.
type_aux
==
FB_AUX_VGA_PLANES_VGA4
)
{
if
(
par
->
isVGA
)
{
setmode
(
2
);
setop
(
0
);
setsr
(
0xf
);
setcolor
(
image
->
fg_color
);
selectmask
();
setmask
(
0xff
);
writeb
(
image
->
bg_color
,
where
);
rmb
();
readb
(
where
);
/* fill latches */
setmode
(
3
);
wmb
();
for
(
y
=
0
;
y
<
image
->
height
;
y
++
)
{
dst
=
where
;
for
(
x
=
image
->
width
/
8
;
x
--
;)
writeb
(
*
cdat
++
,
dst
++
);
where
+=
info
->
fix
.
line_length
;
}
wmb
();
}
else
{
setmode
(
0
);
setop
(
0
);
setsr
(
0xf
);
setcolor
(
image
->
bg_color
);
selectmask
();
setmask
(
0xff
);
for
(
y
=
0
;
y
<
image
->
height
;
y
++
)
{
dst
=
where
;
for
(
x
=
image
->
width
/
8
;
x
--
;){
rmw
(
dst
);
setcolor
(
image
->
fg_color
);
selectmask
();
if
(
*
cdat
)
{
setmask
(
*
cdat
++
);
rmw
(
dst
++
);
}
}
where
+=
info
->
fix
.
line_length
;
}
}
else
vga_8planes_imageblit
(
info
,
image
);
break
;
}
}
else
vga_8planes_imageblit
(
info
,
image
);
break
;
#ifdef FBCON_HAS_VGA
case
FB_TYPE_TEXT
:
break
;
case
FB_TYPE_TEXT
:
break
;
#endif
case
FB_TYPE_PACKED_PIXELS
:
default:
cfb_imageblit
(
info
,
image
);
break
;
case
FB_TYPE_PACKED_PIXELS
:
default:
cfb_imageblit
(
info
,
image
);
break
;
}
}
void
vga_imageblit_color
(
struct
fb_info
*
info
,
struct
fb_image
*
image
)
{
/*
* Draw logo
*/
struct
vga16fb_par
*
par
=
(
struct
vga16fb_par
*
)
info
->
par
;
char
*
where
=
info
->
screen_base
+
image
->
dy
*
info
->
fix
.
line_length
+
image
->
dx
/
8
;
char
*
cdat
=
image
->
data
,
*
dst
;
int
x
,
y
;
switch
(
info
->
fix
.
type
)
{
case
FB_TYPE_VGA_PLANES
:
if
(
info
->
fix
.
type_aux
==
FB_AUX_VGA_PLANES_VGA4
&&
par
->
isVGA
)
{
setsr
(
0xf
);
setop
(
0
);
setmode
(
0
);
for
(
y
=
0
;
y
<
image
->
height
;
y
++
)
{
for
(
x
=
0
;
x
<
image
->
width
;
x
++
)
{
dst
=
where
+
x
/
8
;
setcolor
(
*
cdat
);
selectmask
();
setmask
(
1
<<
(
7
-
(
x
%
8
)));
fb_readb
(
dst
);
fb_writeb
(
0
,
dst
);
cdat
++
;
}
where
+=
info
->
fix
.
line_length
;
}
}
break
;
case
FB_TYPE_PACKED_PIXELS
:
cfb_imageblit
(
info
,
image
);
break
;
default:
break
;
}
}
void
vga16fb_imageblit
(
struct
fb_info
*
info
,
struct
fb_image
*
image
)
{
if
(
image
->
depth
==
1
)
vga_imageblit_expand
(
info
,
image
);
else
if
(
image
->
depth
==
info
->
var
.
bits_per_pixel
)
vga_imageblit_color
(
info
,
image
);
}
static
struct
fb_ops
vga16fb_ops
=
{
...
...
@@ -1298,6 +1354,7 @@ static struct fb_ops vga16fb_ops = {
.
fb_fillrect
=
vga16fb_fillrect
,
.
fb_copyarea
=
vga16fb_copyarea
,
.
fb_imageblit
=
vga16fb_imageblit
,
.
fb_cursor
=
soft_cursor
,
};
int
vga16fb_setup
(
char
*
options
)
...
...
@@ -1349,6 +1406,11 @@ int __init vga16fb_init(void)
i
=
(
vga16fb_defined
.
bits_per_pixel
==
8
)
?
256
:
16
;
fb_alloc_cmap
(
&
vga16fb
.
cmap
,
i
,
0
);
if
(
vga16fb_check_var
(
&
vga16fb
.
var
,
&
vga16fb
))
return
-
EINVAL
;
vga16fb_update_fix
(
&
vga16fb
);
if
(
register_framebuffer
(
&
vga16fb
)
<
0
)
{
iounmap
(
vga16fb
.
screen_base
);
return
-
EINVAL
;
...
...
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