Commit 32705156 authored by James Simmons's avatar James Simmons

Merge maxwell.earthlink.net:/usr/src/linus-2.5

into maxwell.earthlink.net:/usr/src/fbdev-2.5
parents 4eaa387e 00b1d58d
...@@ -2785,6 +2785,19 @@ S: Klosterweg 28 / i309 ...@@ -2785,6 +2785,19 @@ S: Klosterweg 28 / i309
S: 76131 Karlsruhe S: 76131 Karlsruhe
S: Germany S: Germany
N: James Simmons
E: jsimmons@users.sf.net
D: Frame buffer device maintainer
D: input layer developement
D: tty/console layer
D: various mipsel devices
S: 115 Carmel Avenue
S: El Cerrito CA 94530
S: USA
N: Chris Vance
E: cvance@tislabs.com
N: Jaspreet Singh N: Jaspreet Singh
E: jaspreet@sangoma.com E: jaspreet@sangoma.com
W: www.sangoma.com W: www.sangoma.com
......
...@@ -365,7 +365,7 @@ KAO --> ...@@ -365,7 +365,7 @@ KAO -->
!Edrivers/video/fbmem.c !Edrivers/video/fbmem.c
</sect1> </sect1>
<sect1><title>Frame Buffer Console</title> <sect1><title>Frame Buffer Console</title>
!Edrivers/video/fbcon.c !Edrivers/video/console/fbcon.c
</sect1> </sect1>
<sect1><title>Frame Buffer Colormap</title> <sect1><title>Frame Buffer Colormap</title>
!Edrivers/video/fbcmap.c !Edrivers/video/fbcmap.c
...@@ -385,7 +385,7 @@ KAO --> ...@@ -385,7 +385,7 @@ KAO -->
!Idrivers/video/macmodes.c !Idrivers/video/macmodes.c
</sect1> </sect1>
<sect1><title>Frame Buffer Fonts</title> <sect1><title>Frame Buffer Fonts</title>
!Idrivers/video/fonts.c !Idrivers/video/console/fonts.c
</sect1> </sect1>
</chapter> </chapter>
<!-- Needs ksyms to list additional exported symbols, but no specific doc. <!-- Needs ksyms to list additional exported symbols, but no specific doc.
......
...@@ -591,6 +591,13 @@ M: kevin.curtis@farsite.co.uk ...@@ -591,6 +591,13 @@ M: kevin.curtis@farsite.co.uk
W: http://www.farsite.co.uk/ W: http://www.farsite.co.uk/
S: Supported S: Supported
FRAMEBUFFER LAYER
P: James Simmons, Geert Uytterhoeven
M: jsimmons@users.sf.net, geert@linux-m68k.org
L: linux-fbdev-devel@lists.sourceforge.net
W: http://www.linux-fbdev.org
S: Supported
FILE LOCKING (flock() and fcntl()/lockf()) FILE LOCKING (flock() and fcntl()/lockf())
P: Matthew Wilcox P: Matthew Wilcox
M: matthew@wil.cx M: matthew@wil.cx
......
...@@ -668,7 +668,7 @@ defconfig: ...@@ -668,7 +668,7 @@ defconfig:
CLEAN_FILES += \ CLEAN_FILES += \
include/linux/compile.h \ include/linux/compile.h \
vmlinux System.map \ vmlinux System.map \
drivers/char/consolemap_deftbl.c drivers/video/promcon_tbl.c \ drivers/char/consolemap_deftbl.c drivers/video/console/promcon_tbl.c \
drivers/char/conmakehash \ drivers/char/conmakehash \
drivers/char/drm/*-mod.c \ drivers/char/drm/*-mod.c \
drivers/char/defkeymap.c drivers/char/qtronixmap.c \ drivers/char/defkeymap.c drivers/char/qtronixmap.c \
......
...@@ -348,22 +348,7 @@ source drivers/media/Config.in ...@@ -348,22 +348,7 @@ source drivers/media/Config.in
source fs/Config.in source fs/Config.in
if [ "$CONFIG_VT" = "y" ]; then source drivers/video/Config.in
mainmenu_option next_comment
comment 'Console drivers'
bool 'VGA text console' CONFIG_VGA_CONSOLE
# if [ "$CONFIG_PCI" = "y" -a "$CONFIG_VGA_CONSOLE" = "y" ]; then
# bool ' Allow VGA on any bus?' CONFIG_VGA_HOSE
# if [ "$CONFIG_VGA_HOSE" = "y" ]; then
# define_bool CONFIG_DUMMY_CONSOLE y
# fi
# fi
source drivers/video/Config.in
if [ "$CONFIG_FB" = "y" ]; then
define_bool CONFIG_PCI_CONSOLE y
fi
endmenu
fi
mainmenu_option next_comment mainmenu_option next_comment
comment 'Sound' comment 'Sound'
......
...@@ -498,15 +498,7 @@ source drivers/media/Config.in ...@@ -498,15 +498,7 @@ source drivers/media/Config.in
source fs/Config.in source fs/Config.in
if [ "$CONFIG_VT" = "y" ]; then source drivers/video/Config.in
mainmenu_option next_comment
comment 'Console drivers'
if [ "$CONFIG_ARCH_ACORN" != "y" -a "$CONFIG_ARCH_EBSA110" != "y" ]; then
bool 'VGA text console' CONFIG_VGA_CONSOLE
fi
source drivers/video/Config.in
endmenu
fi
if [ "$CONFIG_ARCH_ACORN" = "y" -o \ if [ "$CONFIG_ARCH_ACORN" = "y" -o \
"$CONFIG_ARCH_CLPS7500" = "y" -o \ "$CONFIG_ARCH_CLPS7500" = "y" -o \
......
...@@ -418,17 +418,7 @@ source drivers/media/Config.in ...@@ -418,17 +418,7 @@ source drivers/media/Config.in
source fs/Config.in source fs/Config.in
if [ "$CONFIG_VT" = "y" ]; then source drivers/video/Config.in
mainmenu_option next_comment
comment 'Console drivers'
bool 'VGA text console' CONFIG_VGA_CONSOLE
bool 'Video mode selection support' CONFIG_VIDEO_SELECT
if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
tristate 'MDA text console (dual-headed) (EXPERIMENTAL)' CONFIG_MDA_CONSOLE
source drivers/video/Config.in
fi
endmenu
fi
mainmenu_option next_comment mainmenu_option next_comment
comment 'Sound' comment 'Sound'
......
...@@ -229,16 +229,7 @@ fi # HP_SIM ...@@ -229,16 +229,7 @@ fi # HP_SIM
source fs/Config.in source fs/Config.in
if [ "$CONFIG_IA64_HP_SIM" = "n" ]; then if [ "$CONFIG_IA64_HP_SIM" = "n" ]; then
if [ "$CONFIG_VT" = "y" ]; then source drivers/video/Config.in
mainmenu_option next_comment
comment 'Console drivers'
bool 'VGA text console' CONFIG_VGA_CONSOLE
source drivers/video/Config.in
if [ "$CONFIG_FB" = "y" ]; then
define_bool CONFIG_PCI_CONSOLE y
fi
endmenu
fi
mainmenu_option next_comment mainmenu_option next_comment
comment 'Sound' comment 'Sound'
......
...@@ -527,12 +527,7 @@ endmenu ...@@ -527,12 +527,7 @@ endmenu
source fs/Config.in source fs/Config.in
if [ "$CONFIG_VT" = "y" ]; then source drivers/video/Config.in
mainmenu_option next_comment
comment 'Console drivers'
source drivers/video/Config.in
endmenu
fi
mainmenu_option next_comment mainmenu_option next_comment
comment 'Kernel hacking' comment 'Kernel hacking'
......
...@@ -449,16 +449,7 @@ fi ...@@ -449,16 +449,7 @@ fi
source fs/Config.in source fs/Config.in
if [ "$CONFIG_VT" = "y" ]; then source drivers/video/Config.in
mainmenu_option next_comment
comment 'Console drivers'
bool 'VGA text console' CONFIG_VGA_CONSOLE
if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
tristate 'MDA text console (dual-headed) (EXPERIMENTAL)' CONFIG_MDA_CONSOLE
source drivers/video/Config.in
fi
endmenu
fi
if [ "$CONFIG_DECSTATION" != "y" ]; then if [ "$CONFIG_DECSTATION" != "y" ]; then
mainmenu_option next_comment mainmenu_option next_comment
......
...@@ -199,20 +199,7 @@ source drivers/media/Config.in ...@@ -199,20 +199,7 @@ source drivers/media/Config.in
source fs/Config.in source fs/Config.in
if [ "$CONFIG_VT" = "y" ]; then source drivers/video/Config.in
mainmenu_option next_comment
comment 'Console drivers'
source drivers/video/Config.in
if [ "$CONFIG_SGI_IP22" = "y" ]; then
tristate 'SGI Newport Console support' CONFIG_SGI_NEWPORT_CONSOLE
if [ "$CONFIG_SGI_NEWPORT_CONSOLE" != "y" ]; then
define_bool CONFIG_DUMMY_CONSOLE y
else
define_bool CONFIG_FONT_8x16 y
fi
fi
endmenu
fi
if [ "$CONFIG_PROC_FS" = "y" ]; then if [ "$CONFIG_PROC_FS" = "y" ]; then
define_bool CONFIG_KCORE_ELF y define_bool CONFIG_KCORE_ELF y
......
...@@ -168,24 +168,7 @@ if [ "$CONFIG_SOUND" != "n" ]; then ...@@ -168,24 +168,7 @@ if [ "$CONFIG_SOUND" != "n" ]; then
fi fi
endmenu endmenu
if [ "$CONFIG_VT" = "y" ]; then source drivers/video/Config.in
mainmenu_option next_comment
comment 'Console drivers'
source drivers/video/Config.in
# bool 'IODC console' CONFIG_IODC_CONSOLE
bool 'STI console' CONFIG_STI_CONSOLE
if [ "$CONFIG_IODC_CONSOLE" = "n" ]; then
if [ "$CONFIG_GSC_PS2" = "y" ]; then
define_bool CONFIG_DUMMY_CONSOLE y
fi
fi
if [ "$CONFIG_STI_CONSOLE" = "y" ]; then
define_bool CONFIG_DUMMY_CONSOLE y
fi
endmenu
fi
# endmenu
mainmenu_option next_comment mainmenu_option next_comment
comment 'Kernel hacking' comment 'Kernel hacking'
......
...@@ -459,14 +459,7 @@ source net/irda/Config.in ...@@ -459,14 +459,7 @@ source net/irda/Config.in
source drivers/isdn/Config.in source drivers/isdn/Config.in
mainmenu_option next_comment
comment 'Console drivers'
if [ "$CONFIG_4xx" != "y" -a "$CONFIG_8xx" != "y" ]; then
bool 'VGA text console' CONFIG_VGA_CONSOLE
fi
source drivers/video/Config.in source drivers/video/Config.in
endmenu
if [ "$CONFIG_PPC_ISERIES" = "y" ]; then if [ "$CONFIG_PPC_ISERIES" = "y" ]; then
mainmenu_option next_comment mainmenu_option next_comment
......
...@@ -152,12 +152,7 @@ source drivers/media/Config.in ...@@ -152,12 +152,7 @@ source drivers/media/Config.in
source fs/Config.in source fs/Config.in
if [ "$CONFIG_VT" = "y" ]; then source drivers/video/Config.in
mainmenu_option next_comment
comment 'Console drivers'
source drivers/video/Config.in
endmenu
fi
mainmenu_option next_comment mainmenu_option next_comment
comment 'Sound' comment 'Sound'
......
...@@ -336,18 +336,7 @@ source fs/Config.in ...@@ -336,18 +336,7 @@ source fs/Config.in
source drivers/media/Config.in source drivers/media/Config.in
if [ "$CONFIG_VT" = "y" ]; then source drivers/video/Config.in
mainmenu_option next_comment
comment 'Console drivers'
bool 'VGA text console' CONFIG_VGA_CONSOLE
bool 'Video mode selection support' CONFIG_VIDEO_SELECT
if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
tristate 'MDA text console (dual-headed) (EXPERIMENTAL)' CONFIG_MDA_CONSOLE
source drivers/video/Config.in
fi
endmenu
fi
mainmenu_option next_comment mainmenu_option next_comment
comment 'Sound' comment 'Sound'
......
...@@ -60,14 +60,7 @@ source drivers/parport/Config.in ...@@ -60,14 +60,7 @@ source drivers/parport/Config.in
dep_tristate ' Parallel printer support' CONFIG_PRINTER $CONFIG_PARPORT dep_tristate ' Parallel printer support' CONFIG_PRINTER $CONFIG_PARPORT
endmenu endmenu
mainmenu_option next_comment
comment 'Console drivers'
bool 'PROM console' CONFIG_PROM_CONSOLE
if [ "$CONFIG_PROM_CONSOLE" != "y" ]; then
define_bool CONFIG_DUMMY_CONSOLE y
fi
source drivers/video/Config.in source drivers/video/Config.in
endmenu
source drivers/mtd/Config.in source drivers/mtd/Config.in
......
...@@ -74,11 +74,7 @@ if [ "$CONFIG_PCI" = "y" ]; then ...@@ -74,11 +74,7 @@ if [ "$CONFIG_PCI" = "y" ]; then
fi fi
endmenu endmenu
mainmenu_option next_comment
comment 'Console drivers'
bool 'PROM console' CONFIG_PROM_CONSOLE
source drivers/video/Config.in source drivers/video/Config.in
endmenu
source drivers/serial/Config.in source drivers/serial/Config.in
source drivers/sbus/char/Config.in source drivers/sbus/char/Config.in
......
...@@ -188,17 +188,7 @@ source drivers/media/Config.in ...@@ -188,17 +188,7 @@ source drivers/media/Config.in
source fs/Config.in source fs/Config.in
if [ "$CONFIG_VT" = "y" ]; then source drivers/video/Config.in
mainmenu_option next_comment
comment 'Console drivers'
bool 'VGA text console' CONFIG_VGA_CONSOLE
bool 'Video mode selection support' CONFIG_VIDEO_SELECT
if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
tristate 'MDA text console (dual-headed) (EXPERIMENTAL)' CONFIG_MDA_CONSOLE
source drivers/video/Config.in
fi
endmenu
fi
mainmenu_option next_comment mainmenu_option next_comment
comment 'Sound' comment 'Sound'
......
...@@ -17,7 +17,7 @@ obj-$(CONFIG_FC4) += fc4/ ...@@ -17,7 +17,7 @@ obj-$(CONFIG_FC4) += fc4/
obj-$(CONFIG_SCSI) += scsi/ obj-$(CONFIG_SCSI) += scsi/
obj-$(CONFIG_FUSION) += message/ obj-$(CONFIG_FUSION) += message/
obj-$(CONFIG_IEEE1394) += ieee1394/ obj-$(CONFIG_IEEE1394) += ieee1394/
obj-y += cdrom/ obj-y += cdrom/ video/
obj-$(CONFIG_MTD) += mtd/ obj-$(CONFIG_MTD) += mtd/
obj-$(CONFIG_PCMCIA) += pcmcia/ obj-$(CONFIG_PCMCIA) += pcmcia/
obj-$(CONFIG_DIO) += dio/ obj-$(CONFIG_DIO) += dio/
...@@ -27,7 +27,6 @@ obj-$(CONFIG_ALL_PPC) += macintosh/ ...@@ -27,7 +27,6 @@ obj-$(CONFIG_ALL_PPC) += macintosh/
obj-$(CONFIG_MAC) += macintosh/ obj-$(CONFIG_MAC) += macintosh/
obj-$(CONFIG_PNP) += pnp/ obj-$(CONFIG_PNP) += pnp/
obj-$(CONFIG_SGI) += sgi/ obj-$(CONFIG_SGI) += sgi/
obj-$(CONFIG_VT) += video/
obj-$(CONFIG_PARIDE) += block/paride/ obj-$(CONFIG_PARIDE) += block/paride/
obj-$(CONFIG_TC) += tc/ obj-$(CONFIG_TC) += tc/
obj-$(CONFIG_USB) += usb/ obj-$(CONFIG_USB) += usb/
......
CONFIG_FB_SGIVW CONFIG_FB_SGIVW
SGI Visual Workstation support for framebuffer graphics. SGI Visual Workstation support for framebuffer graphics.
CONFIG_VIDEO_SELECT
This enables support for text mode selection on kernel startup. If
you want to take advantage of some high-resolution text mode your
card's BIOS offers, but the traditional Linux utilities like
SVGATextMode don't, you can say Y here and set the mode using the
"vga=" option from your boot loader (lilo or loadlin) or set
"vga=ask" which brings up a video mode menu on kernel startup. (Try
"man bootparam" or see the documentation of your boot loader about
how to pass options to the kernel.)
Read the file <file:Documentation/svga.txt> for more information
about the Video mode selection support. If unsure, say N.
CONFIG_FB CONFIG_FB
The frame buffer device provides an abstraction for the graphics The frame buffer device provides an abstraction for the graphics
hardware. It represents the frame buffer of some video hardware and hardware. It represents the frame buffer of some video hardware and
...@@ -242,14 +229,6 @@ CONFIG_FB_VESA ...@@ -242,14 +229,6 @@ CONFIG_FB_VESA
You will get a boot time penguin logo at no additional cost. Please You will get a boot time penguin logo at no additional cost. Please
read <file:Documentation/fb/vesafb.txt>. If unsure, say Y. read <file:Documentation/fb/vesafb.txt>. If unsure, say Y.
CONFIG_FBCON_VGA_PLANES
This low level frame buffer console driver enable the kernel to use
the 16-color planar modes of the old VGA cards where the bits of
each pixel are separated into 4 planes.
Only answer Y here if you have a (very old) VGA card that isn't VESA
2 compatible.
CONFIG_FB_VGA16 CONFIG_FB_VGA16
This is the frame buffer device driver for VGA 16 color graphic This is the frame buffer device driver for VGA 16 color graphic
cards. Say Y if you have such a card. cards. Say Y if you have such a card.
...@@ -280,58 +259,6 @@ CONFIG_FB_STI ...@@ -280,58 +259,6 @@ CONFIG_FB_STI
Really old HP boxes may not have STI, and must use the PDC BIOS Really old HP boxes may not have STI, and must use the PDC BIOS
console or the IODC BIOS. console or the IODC BIOS.
CONFIG_FBCON_FONTS
Say Y here if you would like to use fonts other than the default
your frame buffer console usually use.
Note that the answer to this question won't directly affect the
kernel: saying N will just cause the configurator to skip all
the questions about foreign fonts.
If unsure, say N (the default choices are safe).
CONFIG_FONT_8x16
This is the "high resolution" font for the VGA frame buffer (the one
provided by the VGA text console 80x25 mode.
If unsure, say Y.
CONFIG_FBCON_FONTWIDTH8_ONLY
Answer Y here will make the kernel provide only the 8x8 fonts (these
are the less readable).
If unsure, say N.
CONFIG_FONT_SUN8x16
This is the high resolution console font for Sun machines. Say Y.
CONFIG_FONT_SUN12x22
This is the high resolution console font for Sun machines with very
big letters (like the letters used in the SPARC PROM). If the
standard font is unreadable for you, say Y, otherwise say N.
CONFIG_FONT_8x8
This is the "high resolution" font for the VGA frame buffer (the one
provided by the text console 80x50 (and higher) modes).
Note that this is a poor quality font. The VGA 8x16 font is quite a
lot more readable.
Given the resolution provided by the frame buffer device, answer N
here is safe.
CONFIG_FONT_6x11
Small console font with Macintosh-style high-half glyphs. Some Mac
framebuffer drivers don't support this one at all.
CONFIG_FONT_PEARL_8x8
Small console font with PC-style control-character and high-half
glyphs.
CONFIG_FONT_ACORN_8x8
Small console font with PC-style control characters and high-half
glyphs.
CONFIG_FB_HGA CONFIG_FB_HGA
Say Y here if you have a Hercules mono graphics card. Say Y here if you have a Hercules mono graphics card.
...@@ -646,79 +573,3 @@ CONFIG_FB_SA1100 ...@@ -646,79 +573,3 @@ CONFIG_FB_SA1100
If you plan to use the LCD display with your SA-1100 system, say If you plan to use the LCD display with your SA-1100 system, say
Y here. Y here.
CONFIG_FBCON_ADVANCED
The frame buffer console uses character drawing routines that are
tailored to the specific organization of pixels in the memory of
your graphics hardware. These are called the low level frame buffer
console drivers. Note that they are used for text console output
only; they are NOT needed for graphical applications.
If you say N here, the needed low level drivers are automatically
enabled, depending on what frame buffer devices you selected above.
This is recommended for most users.
If you say Y here, you have more fine-grained control over which low
level drivers are enabled. You can e.g. leave out low level drivers
for color depths you do not intend to use for text consoles.
Low level frame buffer console drivers can be modules ( = code which
can be inserted and removed from the running kernel whenever you
want). The modules will be called fbcon-*.o. If you want to compile
(some of) them as modules, read <file:Documentation/modules.txt>.
If unsure, say N.
CONFIG_FBCON_MFB
This is the low level frame buffer console driver for monochrome
(2 colors) packed pixels.
CONFIG_FBCON_CFB2
This is the low level frame buffer console driver for 2 bits per
pixel (4 colors) packed pixels.
CONFIG_FBCON_CFB4
This is the low level frame buffer console driver for 4 bits per
pixel (16 colors) packed pixels.
CONFIG_FBCON_CFB8
This is the low level frame buffer console driver for 8 bits per
pixel (256 colors) packed pixels.
CONFIG_FBCON_CFB16
This is the low level frame buffer console driver for 15 or 16 bits
per pixel (32K or 64K colors, also known as `hicolor') packed
pixels.
CONFIG_FBCON_CFB24
This is the low level frame buffer console driver for 24 bits per
pixel (16M colors, also known as `truecolor') packed pixels. It is
NOT for `sparse' 32 bits per pixel mode.
CONFIG_FBCON_CFB32
This is the low level frame buffer console driver for 32 bits per
pixel (16M colors, also known as `truecolor') sparse packed pixels.
CONFIG_FBCON_AFB
This is the low level frame buffer console driver for 1 to 8
bitplanes (2 to 256 colors) on Amiga.
CONFIG_FBCON_ILBM
This is the low level frame buffer console driver for 1 to 8
interleaved bitplanes (2 to 256 colors) on Amiga.
CONFIG_FBCON_IPLAN2P2
This is the low level frame buffer console driver for 2 interleaved
bitplanes (4 colors) on Atari.
CONFIG_FBCON_IPLAN2P4
This is the low level frame buffer console driver for 4 interleaved
bitplanes (16 colors) on Atari.
CONFIG_FBCON_IPLAN2P8
This is the low level frame buffer console driver for 8 interleaved
bitplanes (256 colors) on Atari.
CONFIG_FBCON_HGA
This is the low level frame buffer console driver for Hercules mono
graphics cards.
This diff is collapsed.
...@@ -5,33 +5,12 @@ ...@@ -5,33 +5,12 @@
# All of the (potential) objects that export symbols. # All of the (potential) objects that export symbols.
# This list comes from 'grep -l EXPORT_SYMBOL *.[hc]'. # This list comes from 'grep -l EXPORT_SYMBOL *.[hc]'.
export-objs := fbmem.o fbcmap.o fbcon.o fbmon.o modedb.o \ export-objs := fbmem.o fbcmap.o fbmon.o modedb.o fbgen.o cyber2000fb.o
fbcon-afb.o fbcon-ilbm.o fbcon-accel.o cyber2000fb.o \
fbcon-iplan2p2.o fbcon-iplan2p4.o fbgen.o \
fbcon-iplan2p8.o fbcon-vga-planes.o fbcon-cfb16.o \
fbcon-cfb2.o fbcon-cfb24.o fbcon-cfb32.o fbcon-cfb4.o \
fbcon-cfb8.o fbcon-mfb.o fbcon-hga.o
# Each configuration option enables a list of files. # Each configuration option enables a list of files.
obj-$(CONFIG_DUMMY_CONSOLE) += dummycon.o
obj-$(CONFIG_SGI_NEWPORT_CONSOLE) += newport_con.o
obj-$(CONFIG_PROM_CONSOLE) += promcon.o promcon_tbl.o
obj-$(CONFIG_STI_CONSOLE) += sticon.o sticon-bmode.o sticore.o
obj-$(CONFIG_VGA_CONSOLE) += vgacon.o
obj-$(CONFIG_MDA_CONSOLE) += mdacon.o
obj-$(CONFIG_FONT_SUN8x16) += font_sun8x16.o
obj-$(CONFIG_FONT_SUN12x22) += font_sun12x22.o
obj-$(CONFIG_FONT_8x8) += font_8x8.o
obj-$(CONFIG_FONT_8x16) += font_8x16.o
obj-$(CONFIG_FONT_6x11) += font_6x11.o
obj-$(CONFIG_FONT_PEARL_8x8) += font_pearl_8x8.o
obj-$(CONFIG_FONT_ACORN_8x8) += font_acorn_8x8.o
obj-$(CONFIG_FONT_MINI_4x6) += font_mini_4x6.o
# Add fbmon.o back into obj-$(CONFIG_FB) in 2.5.x # Add fbmon.o back into obj-$(CONFIG_FB) in 2.5.x
obj-$(CONFIG_FB) += fbmem.o fbcmap.o modedb.o fbcon.o fonts.o fbgen.o obj-$(CONFIG_FB) += fbmem.o fbcmap.o modedb.o fbgen.o
# Only include macmodes.o if we have FB support and are PPC # Only include macmodes.o if we have FB support and are PPC
ifeq ($(CONFIG_FB),y) ifeq ($(CONFIG_FB),y)
obj-$(CONFIG_PPC) += macmodes.o obj-$(CONFIG_PPC) += macmodes.o
...@@ -60,7 +39,7 @@ obj-$(CONFIG_FB_SGIVW) += sgivwfb.o cfbfillrect.o cfbcopyarea.o cfbim ...@@ -60,7 +39,7 @@ obj-$(CONFIG_FB_SGIVW) += sgivwfb.o cfbfillrect.o cfbcopyarea.o cfbim
obj-$(CONFIG_FB_3DFX) += tdfxfb.o obj-$(CONFIG_FB_3DFX) += tdfxfb.o
obj-$(CONFIG_FB_MAC) += macfb.o macmodes.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o obj-$(CONFIG_FB_MAC) += macfb.o macmodes.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
obj-$(CONFIG_FB_HP300) += hpfb.o cfbfillrect.o cfbimgblt.o obj-$(CONFIG_FB_HP300) += hpfb.o cfbfillrect.o cfbimgblt.o
obj-$(CONFIG_FB_OF) += offb.o cfbfillrect.o cfbimgblit.o cfbcopyarea.o obj-$(CONFIG_FB_OF) += offb.o cfbfillrect.o cfbimgblt.o cfbcopyarea.o
obj-$(CONFIG_FB_IMSTT) += imsttfb.o obj-$(CONFIG_FB_IMSTT) += imsttfb.o
obj-$(CONFIG_FB_RETINAZ3) += retz3fb.o obj-$(CONFIG_FB_RETINAZ3) += retz3fb.o
obj-$(CONFIG_FB_CLGEN) += clgenfb.o obj-$(CONFIG_FB_CLGEN) += clgenfb.o
...@@ -68,7 +47,7 @@ obj-$(CONFIG_FB_TRIDENT) += tridentfb.o ...@@ -68,7 +47,7 @@ obj-$(CONFIG_FB_TRIDENT) += tridentfb.o
obj-$(CONFIG_FB_S3TRIO) += S3triofb.o obj-$(CONFIG_FB_S3TRIO) += S3triofb.o
obj-$(CONFIG_FB_TGA) += tgafb.o obj-$(CONFIG_FB_TGA) += tgafb.o
obj-$(CONFIG_FB_VESA) += vesafb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o obj-$(CONFIG_FB_VESA) += vesafb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
obj-$(CONFIG_FB_VGA16) += vga16fb.o fbcon-vga-planes.o obj-$(CONFIG_FB_VGA16) += vga16fb.o fbcon-vga-planes.o fbcon-vga8-planes.o
obj-$(CONFIG_FB_VIRGE) += virgefb.o obj-$(CONFIG_FB_VIRGE) += virgefb.o
obj-$(CONFIG_FB_G364) += g364fb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o obj-$(CONFIG_FB_G364) += g364fb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
obj-$(CONFIG_FB_FM2) += fm2fb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o obj-$(CONFIG_FB_FM2) += fm2fb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o
...@@ -88,7 +67,7 @@ obj-$(CONFIG_FB_TX3912) += tx3912fb.o cfbfillrect.o cfbcopyarea.o cfbi ...@@ -88,7 +67,7 @@ obj-$(CONFIG_FB_TX3912) += tx3912fb.o cfbfillrect.o cfbcopyarea.o cfbi
obj-$(CONFIG_FB_MATROX) += matrox/ obj-$(CONFIG_FB_MATROX) += matrox/
obj-$(CONFIG_FB_RIVA) += riva/ obj-$(CONFIG_FB_RIVA) += riva/
obj-$(CONFIG_FB_SIS) += sis/ obj-$(CONFIG_FB_SIS) += sis/ cfbimgblt.o
obj-$(CONFIG_FB_ATY) += aty/ cfbimgblt.o obj-$(CONFIG_FB_ATY) += aty/ cfbimgblt.o
obj-$(CONFIG_FB_SUN3) += sun3fb.o obj-$(CONFIG_FB_SUN3) += sun3fb.o
...@@ -101,28 +80,7 @@ obj-$(CONFIG_FB_E1355) += epson1355fb.o ...@@ -101,28 +80,7 @@ obj-$(CONFIG_FB_E1355) += epson1355fb.o
obj-$(CONFIG_FB_PVR2) += pvr2fb.o obj-$(CONFIG_FB_PVR2) += pvr2fb.o
obj-$(CONFIG_FB_VOODOO1) += sstfb.o obj-$(CONFIG_FB_VOODOO1) += sstfb.o
# Generic Low Level Drivers obj-$(CONFIG_VT) += console/
obj-$(CONFIG_FBCON_AFB) += fbcon-afb.o
obj-$(CONFIG_FBCON_CFB2) += fbcon-cfb2.o
obj-$(CONFIG_FBCON_CFB4) += fbcon-cfb4.o
obj-$(CONFIG_FBCON_CFB8) += fbcon-cfb8.o
obj-$(CONFIG_FBCON_CFB16) += fbcon-cfb16.o
obj-$(CONFIG_FBCON_CFB24) += fbcon-cfb24.o
obj-$(CONFIG_FBCON_CFB32) += fbcon-cfb32.o
obj-$(CONFIG_FBCON_ILBM) += fbcon-ilbm.o
obj-$(CONFIG_FBCON_IPLAN2P2) += fbcon-iplan2p2.o
obj-$(CONFIG_FBCON_IPLAN2P4) += fbcon-iplan2p4.o
obj-$(CONFIG_FBCON_IPLAN2P8) += fbcon-iplan2p8.o
obj-$(CONFIG_FBCON_MFB) += fbcon-mfb.o
obj-$(CONFIG_FBCON_HGA) += fbcon-hga.o
obj-$(CONFIG_FBCON_STI) += fbcon-sti.o
obj-$(CONFIG_FBCON_ACCEL) += fbcon-accel.o
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
$(obj)/promcon_tbl.c: $(src)/prom.uni
$(objtree)/scripts/conmakehash $< | \
sed -e '/#include <[^>]*>/p' -e 's/types/init/' \
-e 's/dfont\(_uni.*\]\)/promfont\1 __initdata/' > $@
...@@ -20,11 +20,8 @@ ...@@ -20,11 +20,8 @@
#include <asm/io.h> #include <asm/io.h>
#include <video/fbcon.h>
static u32 colreg[16]; static u32 colreg[16];
static struct fb_info fb_info; static struct fb_info fb_info;
static struct display display;
static struct fb_var_screeninfo anakinfb_var = { static struct fb_var_screeninfo anakinfb_var = {
.xres = 400, .xres = 400,
...@@ -65,9 +62,6 @@ anakinfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, ...@@ -65,9 +62,6 @@ anakinfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
static struct fb_ops anakinfb_ops = { static struct fb_ops anakinfb_ops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.fb_set_var = gen_set_var,
.fb_get_cmap = gen_get_cmap,
.fb_set_cmap = gen_set_cmap,
.fb_setcolreg = anakinfb_setcolreg, .fb_setcolreg = anakinfb_setcolreg,
.fb_fillrect = cfb_fillrect, .fb_fillrect = cfb_fillrect,
.fb_copyarea = cfb_copyarea, .fb_copyarea = cfb_copyarea,
...@@ -78,20 +72,13 @@ int __init ...@@ -78,20 +72,13 @@ int __init
anakinfb_init(void) anakinfb_init(void)
{ {
memset(&fb_info, 0, sizeof(struct fb_info)); memset(&fb_info, 0, sizeof(struct fb_info));
memset(&display, 0, sizeof(struct display));
strcpy(fb_info.modename, anakinfb_fix.id);
fb_info.node = NODEV; fb_info.node = NODEV;
fb_info.currcon = -1;
fb_info.flags = FBINFO_FLAG_DEFAULT; fb_info.flags = FBINFO_FLAG_DEFAULT;
fb_info.fbops = &anakinfb_ops; fb_info.fbops = &anakinfb_ops;
fb_info.var = anakinfb_var; fb_info.var = anakinfb_var;
fb_info.fix = anakinfb_fix; fb_info.fix = anakinfb_fix;
fb_info.disp = &display;
strcpy(fb_info.fontname, "VGA8x16"); strcpy(fb_info.fontname, "VGA8x16");
fb_info.changevar = NULL;
fb_info.switch_con = gen_switch_con;
fb_info.updatevar = gen_update_var;
if (!(request_mem_region(VGA_START, VGA_SIZE, "vga"))) if (!(request_mem_region(VGA_START, VGA_SIZE, "vga")))
return -ENOMEM; return -ENOMEM;
if (fb_info.screen_base = ioremap(VGA_START, VGA_SIZE)) { if (fb_info.screen_base = ioremap(VGA_START, VGA_SIZE)) {
...@@ -100,10 +87,9 @@ anakinfb_init(void) ...@@ -100,10 +87,9 @@ anakinfb_init(void)
} }
fb_alloc_cmap(&fb_info.cmap, 16, 0); fb_alloc_cmap(&fb_info.cmap, 16, 0);
gen_set_disp(-1, &fb_info);
if (register_framebuffer(&fb_info) < 0) { if (register_framebuffer(&fb_info) < 0) {
iounmap(display.screen_base); iounmap(fb_info.screen_base);
release_mem_region(VGA_START, VGA_SIZE); release_mem_region(VGA_START, VGA_SIZE);
return -EINVAL; return -EINVAL;
} }
......
...@@ -65,9 +65,6 @@ ...@@ -65,9 +65,6 @@
#include <asm/io.h> #include <asm/io.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <video/fbcon.h>
#include "../fbcon-accel.h"
#include <video/mach64.h> #include <video/mach64.h>
#include "atyfb.h" #include "atyfb.h"
...@@ -149,11 +146,11 @@ static int atyfb_check_var(struct fb_var_screeninfo *var, ...@@ -149,11 +146,11 @@ static int atyfb_check_var(struct fb_var_screeninfo *var,
static int atyfb_set_par(struct fb_info *info); static int atyfb_set_par(struct fb_info *info);
static int atyfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, static int atyfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
u_int transp, struct fb_info *info); u_int transp, struct fb_info *info);
static int atyfb_pan_display(struct fb_var_screeninfo *var, int con, static int atyfb_pan_display(struct fb_var_screeninfo *var,
struct fb_info *info); struct fb_info *info);
static int atyfb_blank(int blank, struct fb_info *info); static int atyfb_blank(int blank, struct fb_info *info);
static int atyfb_ioctl(struct inode *inode, struct file *file, u_int cmd, static int atyfb_ioctl(struct inode *inode, struct file *file, u_int cmd,
u_long arg, int con, struct fb_info *info); u_long arg, struct fb_info *info);
extern void atyfb_fillrect(struct fb_info *info, struct fb_fillrect *rect); extern void atyfb_fillrect(struct fb_info *info, struct fb_fillrect *rect);
extern void atyfb_copyarea(struct fb_info *info, struct fb_copyarea *area); extern void atyfb_copyarea(struct fb_info *info, struct fb_copyarea *area);
extern void atyfb_imageblit(struct fb_info *info, struct fb_image *image); extern void atyfb_imageblit(struct fb_info *info, struct fb_image *image);
...@@ -198,21 +195,12 @@ int atyfb_init(void); ...@@ -198,21 +195,12 @@ int atyfb_init(void);
int atyfb_setup(char *); int atyfb_setup(char *);
#endif #endif
int gen_get_var(struct fb_var_screeninfo *var, int con, struct fb_info *info)
{
*var = info->var;
return 0;
}
static struct fb_ops atyfb_ops = { static struct fb_ops atyfb_ops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.fb_open = atyfb_open, .fb_open = atyfb_open,
.fb_release = atyfb_release, .fb_release = atyfb_release,
.fb_set_var = gen_set_var,
.fb_check_var = atyfb_check_var, .fb_check_var = atyfb_check_var,
.fb_set_par = atyfb_set_par, .fb_set_par = atyfb_set_par,
.fb_get_cmap = gen_get_cmap,
.fb_set_cmap = gen_set_cmap,
.fb_setcolreg = atyfb_setcolreg, .fb_setcolreg = atyfb_setcolreg,
.fb_pan_display = atyfb_pan_display, .fb_pan_display = atyfb_pan_display,
.fb_blank = atyfb_blank, .fb_blank = atyfb_blank,
...@@ -694,6 +682,13 @@ static int aty_crtc_to_var(const struct crtc *crtc, ...@@ -694,6 +682,13 @@ static int aty_crtc_to_var(const struct crtc *crtc,
(v_sync_pol ? 0 : FB_SYNC_VERT_HIGH_ACT) | (v_sync_pol ? 0 : FB_SYNC_VERT_HIGH_ACT) |
(c_sync ? FB_SYNC_COMP_HIGH_ACT : 0); (c_sync ? FB_SYNC_COMP_HIGH_ACT : 0);
var->red.msb_right = 0;
var->green.msb_right = 0;
var->blue.offset = 0;
var->blue.msb_right = 0;
var->transp.offset = 0;
var->transp.length = 0;
var->transp.msb_right = 0;
switch (pix_width) { switch (pix_width) {
#if 0 #if 0
case CRTC_PIX_WIDTH_4BPP: case CRTC_PIX_WIDTH_4BPP:
...@@ -702,10 +697,7 @@ static int aty_crtc_to_var(const struct crtc *crtc, ...@@ -702,10 +697,7 @@ static int aty_crtc_to_var(const struct crtc *crtc,
var->red.length = 8; var->red.length = 8;
var->green.offset = 0; var->green.offset = 0;
var->green.length = 8; var->green.length = 8;
var->blue.offset = 0;
var->blue.length = 8; var->blue.length = 8;
var->transp.offset = 0;
var->transp.length = 0;
break; break;
#endif #endif
case CRTC_PIX_WIDTH_8BPP: case CRTC_PIX_WIDTH_8BPP:
...@@ -714,10 +706,7 @@ static int aty_crtc_to_var(const struct crtc *crtc, ...@@ -714,10 +706,7 @@ static int aty_crtc_to_var(const struct crtc *crtc,
var->red.length = 8; var->red.length = 8;
var->green.offset = 0; var->green.offset = 0;
var->green.length = 8; var->green.length = 8;
var->blue.offset = 0;
var->blue.length = 8; var->blue.length = 8;
var->transp.offset = 0;
var->transp.length = 0;
break; break;
case CRTC_PIX_WIDTH_15BPP: /* RGB 555 */ case CRTC_PIX_WIDTH_15BPP: /* RGB 555 */
bpp = 16; bpp = 16;
...@@ -725,10 +714,7 @@ static int aty_crtc_to_var(const struct crtc *crtc, ...@@ -725,10 +714,7 @@ static int aty_crtc_to_var(const struct crtc *crtc,
var->red.length = 5; var->red.length = 5;
var->green.offset = 5; var->green.offset = 5;
var->green.length = 5; var->green.length = 5;
var->blue.offset = 0;
var->blue.length = 5; var->blue.length = 5;
var->transp.offset = 0;
var->transp.length = 0;
break; break;
#if 0 #if 0
case CRTC_PIX_WIDTH_16BPP: /* RGB 565 */ case CRTC_PIX_WIDTH_16BPP: /* RGB 565 */
...@@ -737,10 +723,7 @@ static int aty_crtc_to_var(const struct crtc *crtc, ...@@ -737,10 +723,7 @@ static int aty_crtc_to_var(const struct crtc *crtc,
var->red.length = 5; var->red.length = 5;
var->green.offset = 5; var->green.offset = 5;
var->green.length = 6; var->green.length = 6;
var->blue.offset = 0;
var->blue.length = 5; var->blue.length = 5;
var->transp.offset = 0;
var->transp.length = 0;
break; break;
#endif #endif
case CRTC_PIX_WIDTH_24BPP: /* RGB 888 */ case CRTC_PIX_WIDTH_24BPP: /* RGB 888 */
...@@ -749,10 +732,7 @@ static int aty_crtc_to_var(const struct crtc *crtc, ...@@ -749,10 +732,7 @@ static int aty_crtc_to_var(const struct crtc *crtc,
var->red.length = 8; var->red.length = 8;
var->green.offset = 8; var->green.offset = 8;
var->green.length = 8; var->green.length = 8;
var->blue.offset = 0;
var->blue.length = 8; var->blue.length = 8;
var->transp.offset = 0;
var->transp.length = 0;
break; break;
case CRTC_PIX_WIDTH_32BPP: /* ARGB 8888 */ case CRTC_PIX_WIDTH_32BPP: /* ARGB 8888 */
bpp = 32; bpp = 32;
...@@ -760,7 +740,6 @@ static int aty_crtc_to_var(const struct crtc *crtc, ...@@ -760,7 +740,6 @@ static int aty_crtc_to_var(const struct crtc *crtc,
var->red.length = 8; var->red.length = 8;
var->green.offset = 8; var->green.offset = 8;
var->green.length = 8; var->green.length = 8;
var->blue.offset = 0;
var->blue.length = 8; var->blue.length = 8;
var->transp.offset = 24; var->transp.offset = 24;
var->transp.length = 8; var->transp.length = 8;
...@@ -870,8 +849,7 @@ static int atyfb_set_par(struct fb_info *info) ...@@ -870,8 +849,7 @@ static int atyfb_set_par(struct fb_info *info)
#ifdef CONFIG_BOOTX_TEXT #ifdef CONFIG_BOOTX_TEXT
btext_update_display(info->fix.smem_start, btext_update_display(info->fix.smem_start,
(((par->crtc.h_tot_disp >> 16) & 0xff) + (((par->crtc.h_tot_disp >> 16) & 0xff) + 1) * 8,
1) * 8,
((par->crtc.v_tot_disp >> 16) & 0x7ff) + 1, ((par->crtc.v_tot_disp >> 16) & 0x7ff) + 1,
info->var.bits_per_pixel, info->var.bits_per_pixel,
par->crtc.vxres * info->var.bits_per_pixel / 8); par->crtc.vxres * info->var.bits_per_pixel / 8);
...@@ -905,14 +883,13 @@ static int atyfb_encode_var(struct fb_var_screeninfo *var, ...@@ -905,14 +883,13 @@ static int atyfb_encode_var(struct fb_var_screeninfo *var,
{ {
int err; int err;
memset(var, 0, sizeof(struct fb_var_screeninfo));
if ((err = aty_crtc_to_var(&par->crtc, var))) if ((err = aty_crtc_to_var(&par->crtc, var)))
return err; return err;
var->pixclock = par->pll_ops->pll_to_var(info, &par->pll); var->pixclock = par->pll_ops->pll_to_var(info, &par->pll);
var->height = -1; var->height = -1;
var->width = -1; var->width = -1;
var->nonstd = 0;
return 0; return 0;
} }
...@@ -1018,7 +995,7 @@ static int atyfb_release(struct fb_info *info, int user) ...@@ -1018,7 +995,7 @@ static int atyfb_release(struct fb_info *info, int user)
* This call looks only at xoffset, yoffset and the FB_VMODE_YWRAP flag * This call looks only at xoffset, yoffset and the FB_VMODE_YWRAP flag
*/ */
static int atyfb_pan_display(struct fb_var_screeninfo *var, int con, static int atyfb_pan_display(struct fb_var_screeninfo *var,
struct fb_info *info) struct fb_info *info)
{ {
struct atyfb_par *par = (struct atyfb_par *) info->par; struct atyfb_par *par = (struct atyfb_par *) info->par;
...@@ -1060,7 +1037,7 @@ struct atyclk { ...@@ -1060,7 +1037,7 @@ struct atyclk {
#endif #endif
static int atyfb_ioctl(struct inode *inode, struct file *file, u_int cmd, static int atyfb_ioctl(struct inode *inode, struct file *file, u_int cmd,
u_long arg, int con, struct fb_info *info) u_long arg, struct fb_info *info)
{ {
#if defined(__sparc__) || (defined(DEBUG) && defined(CONFIG_FB_ATY_CT)) #if defined(__sparc__) || (defined(DEBUG) && defined(CONFIG_FB_ATY_CT))
struct atyfb_par *par = (struct atyfb_par *) info->par; struct atyfb_par *par = (struct atyfb_par *) info->par;
...@@ -1442,15 +1419,15 @@ static int aty_power_mgmt(int sleep, struct atyfb_par *par) ...@@ -1442,15 +1419,15 @@ static int aty_power_mgmt(int sleep, struct atyfb_par *par)
static int aty_sleep_notify(struct pmu_sleep_notifier *self, int when) static int aty_sleep_notify(struct pmu_sleep_notifier *self, int when)
{ {
struct fb_info *info; struct fb_info *info;
struct atyfb_par *par = (struct atyfb_par *) info->fb.par; struct atyfb_par *par;
int result; int result;
result = PBOOK_SLEEP_OK; result = PBOOK_SLEEP_OK;
for (info = first_display; info != NULL; info = par->next) { for (info = first_display; info != NULL; info = par->next) {
struct fb_fix_screeninfo fix;
int nb; int nb;
par = (struct atyfb_par *) info->par;
nb = fb_display[fg_console].var.yres * info->fix.line_length; nb = fb_display[fg_console].var.yres * info->fix.line_length;
switch (when) { switch (when) {
...@@ -1469,7 +1446,7 @@ static int aty_sleep_notify(struct pmu_sleep_notifier *self, int when) ...@@ -1469,7 +1446,7 @@ static int aty_sleep_notify(struct pmu_sleep_notifier *self, int when)
if (par->blitter_may_be_busy) if (par->blitter_may_be_busy)
wait_for_idle(par); wait_for_idle(par);
/* Stop accel engine (stop bus mastering) */ /* Stop accel engine (stop bus mastering) */
if (par->accel_flags & FB_ACCELF_TEXT) if (info->var.accel_flags & FB_ACCELF_TEXT)
aty_reset_engine(par); aty_reset_engine(par);
/* Backup fb content */ /* Backup fb content */
...@@ -1562,7 +1539,6 @@ static int __init aty_init(struct fb_info *info, const char *name) ...@@ -1562,7 +1539,6 @@ static int __init aty_init(struct fb_info *info, const char *name)
const char *chipname = NULL, *ramname = NULL, *xtal; const char *chipname = NULL, *ramname = NULL, *xtal;
int j, pll, mclk, gtb_memsize; int j, pll, mclk, gtb_memsize;
struct fb_var_screeninfo var; struct fb_var_screeninfo var;
struct display *disp;
u32 chip_id, i; u32 chip_id, i;
u16 type; u16 type;
u8 rev; u8 rev;
...@@ -1843,18 +1819,10 @@ static int __init aty_init(struct fb_info *info, const char *name) ...@@ -1843,18 +1819,10 @@ static int __init aty_init(struct fb_info *info, const char *name)
fb_memset((void *) info->screen_base, 0, fb_memset((void *) info->screen_base, 0,
info->fix.smem_len); info->fix.smem_len);
disp = info->disp;
strcpy(info->modename, info->fix.id);
info->node = NODEV; info->node = NODEV;
info->fbops = &atyfb_ops; info->fbops = &atyfb_ops;
info->disp = disp;
info->pseudo_palette = pseudo_palette; info->pseudo_palette = pseudo_palette;
info->currcon = -1;
strcpy(info->fontname, fontname); strcpy(info->fontname, fontname);
info->changevar = NULL;
info->switch_con = gen_switch;
info->updatevar = gen_update_var;
info->flags = FBINFO_FLAG_DEFAULT; info->flags = FBINFO_FLAG_DEFAULT;
#ifdef CONFIG_PMAC_BACKLIGHT #ifdef CONFIG_PMAC_BACKLIGHT
...@@ -1979,8 +1947,6 @@ static int __init aty_init(struct fb_info *info, const char *name) ...@@ -1979,8 +1947,6 @@ static int __init aty_init(struct fb_info *info, const char *name)
fb_alloc_cmap(&info->cmap, 256, 0); fb_alloc_cmap(&info->cmap, 256, 0);
gen_set_var(&var, -1, info);
if (register_framebuffer(info) < 0) if (register_framebuffer(info) < 0)
return 0; return 0;
...@@ -2029,27 +1995,17 @@ int __init atyfb_init(void) ...@@ -2029,27 +1995,17 @@ int __init atyfb_init(void)
info = info =
kmalloc(sizeof(struct fb_info) + kmalloc(sizeof(struct fb_info) +
sizeof(struct display), GFP_ATOMIC); sizeof(struct atyfb_par), GFP_ATOMIC);
if (!info) { if (!info) {
printk printk
("atyfb_init: can't alloc fb_info\n"); ("atyfb_init: can't alloc fb_info\n");
return -ENXIO; return -ENXIO;
} }
memset(info, 0, memset(info, 0, sizeof(struct fb_info) +
sizeof(struct fb_info) + sizeof(struct atyfb_par));
sizeof(struct display));
default_par = default_par = (struct atyfb_par *) (info + 1);
kmalloc(sizeof(struct atyfb_par), GFP_ATOMIC);
if (!default_par) {
printk
("atyfb_init: can't alloc atyfb_par\n");
kfree(info);
return -ENXIO;
}
memset(default_par, 0, sizeof(struct atyfb_par));
info->disp = (struct display *) (info + 1);
info->fix = atyfb_fix; info->fix = atyfb_fix;
info->par = default_par; info->par = default_par;
...@@ -2383,7 +2339,6 @@ int __init atyfb_init(void) ...@@ -2383,7 +2339,6 @@ int __init atyfb_init(void)
if (first_display == NULL) if (first_display == NULL)
pmu_register_sleep_notifier pmu_register_sleep_notifier
(&aty_sleep_notifier); (&aty_sleep_notifier);
/* FIXME info->next = first_display; */
default_par->next = first_display; default_par->next = first_display;
#endif #endif
} }
...@@ -2410,7 +2365,7 @@ int __init atyfb_init(void) ...@@ -2410,7 +2365,7 @@ int __init atyfb_init(void)
return -ENOMEM; return -ENOMEM;
} }
memset(info, 0, sizeof(struct fb_info)); memset(info, 0, sizeof(struct fb_info));
info->fix = atyfb_fix; info->fix = atyfb_fix;
/* /*
* Map the video memory (physical address given) to somewhere in the * Map the video memory (physical address given) to somewhere in the
...@@ -2421,7 +2376,7 @@ int __init atyfb_init(void) ...@@ -2421,7 +2376,7 @@ int __init atyfb_init(void)
info->fix.smem_start = info->screen_base; /* Fake! */ info->fix.smem_start = info->screen_base; /* Fake! */
default_par->ati_regbase = (unsigned long)ioremap(phys_guiregbase[m64_num], default_par->ati_regbase = (unsigned long)ioremap(phys_guiregbase[m64_num],
0x10000) + 0xFC00ul; 0x10000) + 0xFC00ul;
info->fix.mmio_start = par->ati_regbase; /* Fake! */ info->fix.mmio_start = default_par->ati_regbase; /* Fake! */
aty_st_le32(CLOCK_CNTL, 0x12345678, default_par); aty_st_le32(CLOCK_CNTL, 0x12345678, default_par);
clock_r = aty_ld_le32(CLOCK_CNTL, default_par); clock_r = aty_ld_le32(CLOCK_CNTL, default_par);
......
...@@ -7,8 +7,6 @@ ...@@ -7,8 +7,6 @@
#include <asm/io.h> #include <asm/io.h>
#include <video/fbcon.h>
#include <video/mach64.h> #include <video/mach64.h>
#include "atyfb.h" #include "atyfb.h"
......
...@@ -11,8 +11,6 @@ ...@@ -11,8 +11,6 @@
#include <asm/io.h> #include <asm/io.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <video/fbcon.h>
#ifdef __sparc__ #ifdef __sparc__
#include <asm/pbm.h> #include <asm/pbm.h>
#include <asm/fbio.h> #include <asm/fbio.h>
......
...@@ -9,8 +9,6 @@ ...@@ -9,8 +9,6 @@
#include <asm/io.h> #include <asm/io.h>
#include <video/fbcon.h>
#include <video/mach64.h> #include <video/mach64.h>
#include "atyfb.h" #include "atyfb.h"
......
This diff is collapsed.
...@@ -38,12 +38,14 @@ ...@@ -38,12 +38,14 @@
void cfb_copyarea(struct fb_info *p, struct fb_copyarea *area) void cfb_copyarea(struct fb_info *p, struct fb_copyarea *area)
{ {
int x2, y2, lineincr, shift, shift_right, shift_left, old_dx, old_dy; int x2, y2, lineincr, shift, shift_right, shift_left, old_dx,
old_dy;
int j, linesize = p->fix.line_length, bpl = sizeof(unsigned long); int j, linesize = p->fix.line_length, bpl = sizeof(unsigned long);
unsigned long start_index, end_index, start_mask, end_mask, last; unsigned long start_index, end_index, start_mask, end_mask, last,
tmp;
unsigned long *dst = NULL, *src = NULL; unsigned long *dst = NULL, *src = NULL;
char *src1, *dst1; char *src1, *dst1;
int tmp, height; int height;
/* clip the destination */ /* clip the destination */
old_dx = area->dx; old_dx = area->dx;
...@@ -84,10 +86,16 @@ void cfb_copyarea(struct fb_info *p, struct fb_copyarea *area) ...@@ -84,10 +86,16 @@ void cfb_copyarea(struct fb_info *p, struct fb_copyarea *area)
lineincr = linesize; lineincr = linesize;
} else { } else {
/* start at the bottom */ /* start at the bottom */
src1 = p->screen_base + (area->sy + area->height-1) * linesize src1 =
+ (((area->sx + area->width - 1) * p->var.bits_per_pixel) >> 3); p->screen_base + (area->sy + area->height -
dst1 = p->screen_base + (area->dy + area->height-1) * linesize 1) * linesize +
+ (((area->dx + area->width - 1) * p->var.bits_per_pixel) >> 3); (((area->sx + area->width -
1) * p->var.bits_per_pixel) >> 3);
dst1 =
p->screen_base + (area->dy + area->height -
1) * linesize +
(((area->dx + area->width -
1) * p->var.bits_per_pixel) >> 3);
lineincr = -linesize; lineincr = -linesize;
} }
...@@ -98,7 +106,7 @@ void cfb_copyarea(struct fb_info *p, struct fb_copyarea *area) ...@@ -98,7 +106,7 @@ void cfb_copyarea(struct fb_info *p, struct fb_copyarea *area)
start_index = ((unsigned long) src1 & (bpl - 1)); start_index = ((unsigned long) src1 & (bpl - 1));
end_index = ((unsigned long) (src1 + n) & (bpl - 1)); end_index = ((unsigned long) (src1 + n) & (bpl - 1));
shift = ((unsigned long) dst1 & (bpl - 1)) - shift = ((unsigned long) dst1 & (bpl - 1)) -
((unsigned long) src1 & (bpl - 1)); ((unsigned long) src1 & (bpl - 1));
start_mask = end_mask = 0; start_mask = end_mask = 0;
if (start_index) { if (start_index) {
...@@ -111,7 +119,6 @@ void cfb_copyarea(struct fb_info *p, struct fb_copyarea *area) ...@@ -111,7 +119,6 @@ void cfb_copyarea(struct fb_info *p, struct fb_copyarea *area)
n -= end_index; n -= end_index;
} }
n /= bpl; n /= bpl;
if (n <= 0) { if (n <= 0) {
if (start_mask) { if (start_mask) {
if (end_mask) if (end_mask)
...@@ -148,16 +155,25 @@ void cfb_copyarea(struct fb_info *p, struct fb_copyarea *area) ...@@ -148,16 +155,25 @@ void cfb_copyarea(struct fb_info *p, struct fb_copyarea *area)
last = (FB_READ(src) & start_mask); last = (FB_READ(src) & start_mask);
if (shift > 0) if (shift > 0)
FB_WRITE(FB_READ(dst) | (last >> shift_right), dst); FB_WRITE(FB_READ(dst) |
(last >>
shift_right),
dst);
for (j = 0; j < n; j++) { for (j = 0; j < n; j++) {
dst++; dst++;
tmp = FB_READ(src); tmp = FB_READ(src);
src++; src++;
FB_WRITE((last << shift_left) | (tmp >> shift_right), dst); FB_WRITE((last <<
shift_left) |
(tmp >>
shift_right),
dst);
last = tmp; last = tmp;
src++; src++;
} }
FB_WRITE(FB_READ(dst) | (last << shift_left), dst); FB_WRITE(FB_READ(dst) |
(last << shift_left),
dst);
src1 += lineincr; src1 += lineincr;
dst1 += lineincr; dst1 += lineincr;
} while (--height); } while (--height);
...@@ -172,16 +188,25 @@ void cfb_copyarea(struct fb_info *p, struct fb_copyarea *area) ...@@ -172,16 +188,25 @@ void cfb_copyarea(struct fb_info *p, struct fb_copyarea *area)
last = (FB_READ(src) & end_mask); last = (FB_READ(src) & end_mask);
if (shift < 0) if (shift < 0)
FB_WRITE(FB_READ(dst) | (last >> shift_right), dst); FB_WRITE(FB_READ(dst) |
(last >>
shift_right),
dst);
for (j = 0; j < n; j++) { for (j = 0; j < n; j++) {
dst--; dst--;
tmp = FB_READ(src); tmp = FB_READ(src);
src--; src--;
FB_WRITE((tmp << shift_left) | (last >> shift_right), dst); FB_WRITE((tmp <<
shift_left) |
(last >>
shift_right),
dst);
last = tmp; last = tmp;
src--; src--;
} }
FB_WRITE(FB_READ(dst) | (last >> shift_right), dst); FB_WRITE(FB_READ(dst) |
(last >> shift_right),
dst);
src1 += lineincr; src1 += lineincr;
dst1 += lineincr; dst1 += lineincr;
} while (--height); } while (--height);
...@@ -191,20 +216,27 @@ void cfb_copyarea(struct fb_info *p, struct fb_copyarea *area) ...@@ -191,20 +216,27 @@ void cfb_copyarea(struct fb_info *p, struct fb_copyarea *area)
if (lineincr > 0) { if (lineincr > 0) {
/* positive increment */ /* positive increment */
do { do {
dst = (unsigned long *) (dst1 - start_index); dst =
src = (unsigned long *) (src1 - start_index); (unsigned long *) (dst1 -
start_index);
src =
(unsigned long *) (src1 -
start_index);
if (start_mask) if (start_mask)
FB_WRITE(FB_READ(src) | start_mask, dst); FB_WRITE(FB_READ(src) |
start_mask, dst);
for (j = 0; j < n; j++) { for (j = 0; j < n; j++) {
FB_WRITE(FB_READ(src), dst); FB_WRITE(FB_READ(src),
dst);
dst++; dst++;
src++; src++;
} }
if (end_mask) if (end_mask)
FB_WRITE(FB_READ(src) | end_mask, dst); FB_WRITE(FB_READ(src) |
end_mask, dst);
src1 += lineincr; src1 += lineincr;
dst1 += lineincr; dst1 += lineincr;
} while (--height); } while (--height);
...@@ -215,9 +247,11 @@ void cfb_copyarea(struct fb_info *p, struct fb_copyarea *area) ...@@ -215,9 +247,11 @@ void cfb_copyarea(struct fb_info *p, struct fb_copyarea *area)
src = (unsigned long *) src1; src = (unsigned long *) src1;
if (start_mask) if (start_mask)
FB_WRITE(FB_READ(src) | start_mask, dst); FB_WRITE(FB_READ(src) |
start_mask, dst);
for (j = 0; j < n; j++) { for (j = 0; j < n; j++) {
FB_WRITE(FB_READ(src), dst); FB_WRITE(FB_READ(src),
dst);
dst--; dst--;
src--; src--;
} }
...@@ -226,5 +260,33 @@ void cfb_copyarea(struct fb_info *p, struct fb_copyarea *area) ...@@ -226,5 +260,33 @@ void cfb_copyarea(struct fb_info *p, struct fb_copyarea *area)
} while (--height); } while (--height);
} }
} }
} else {
int n = ((area->width * p->var.bits_per_pixel) >> 3);
int n16 = (n >> 4) << 4;
int n_fract = n - n16;
int rows;
if (area->dy < area->sy
|| (area->dy == area->sy && area->dx < area->sx)) {
for (rows = height; rows--;) {
if (n16)
fast_memmove(dst1, src1, n16);
if (n_fract)
fb_memmove(dst1 + n16, src1 + n16,
n_fract);
dst1 += linesize;
src1 += linesize;
}
} else {
for (rows = height; rows--;) {
if (n16)
fast_memmove(dst1, src1, n16);
if (n_fract)
fb_memmove(dst1 + n16, src1 + n16,
n_fract);
dst1 -= linesize;
src1 -= linesize;
}
}
} }
} }
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#include <linux/string.h> #include <linux/string.h>
#include <linux/fb.h> #include <linux/fb.h>
#include <asm/types.h> #include <asm/types.h>
#include <video/fbcon.h>
#if BITS_PER_LONG == 32 #if BITS_PER_LONG == 32
#define FB_READ fb_readl #define FB_READ fb_readl
...@@ -36,7 +35,7 @@ void cfb_fillrect(struct fb_info *p, struct fb_fillrect *rect) ...@@ -36,7 +35,7 @@ void cfb_fillrect(struct fb_info *p, struct fb_fillrect *rect)
unsigned long height, ppw, fg, fgcolor; unsigned long height, ppw, fg, fgcolor;
int i, n, x2, y2, linesize = p->fix.line_length; int i, n, x2, y2, linesize = p->fix.line_length;
int bpl = sizeof(unsigned long); int bpl = sizeof(unsigned long);
unsigned long *dst; unsigned long *dst = NULL;
char *dst1; char *dst1;
if (!rect->width || !rect->height) if (!rect->width || !rect->height)
...@@ -56,7 +55,7 @@ void cfb_fillrect(struct fb_info *p, struct fb_fillrect *rect) ...@@ -56,7 +55,7 @@ void cfb_fillrect(struct fb_info *p, struct fb_fillrect *rect)
ppw = BITS_PER_LONG / p->var.bits_per_pixel; ppw = BITS_PER_LONG / p->var.bits_per_pixel;
dst1 = p->screen_base + (rect->dy * linesize) + dst1 = p->screen_base + (rect->dy * linesize) +
(rect->dx * (p->var.bits_per_pixel >> 3)); (rect->dx * (p->var.bits_per_pixel >> 3));
start_index = ((unsigned long) dst1 & (bpl - 1)); start_index = ((unsigned long) dst1 & (bpl - 1));
end_index = ((unsigned long) (dst1 + n) & (bpl - 1)); end_index = ((unsigned long) (dst1 + n) & (bpl - 1));
...@@ -98,11 +97,12 @@ void cfb_fillrect(struct fb_info *p, struct fb_fillrect *rect) ...@@ -98,11 +97,12 @@ void cfb_fillrect(struct fb_info *p, struct fb_fillrect *rect)
case ROP_COPY: case ROP_COPY:
do { do {
/* Word align to increases performace :-) */ /* Word align to increases performace :-) */
dst = (unsigned long *) (dst1 - start_index); dst =
(unsigned long *) (dst1 - start_index);
if (start_mask) { if (start_mask) {
FB_WRITE(FB_READ(dst) | FB_WRITE(FB_READ(dst) |
start_mask, dst); start_mask, dst);
dst++; dst++;
} }
...@@ -113,17 +113,18 @@ void cfb_fillrect(struct fb_info *p, struct fb_fillrect *rect) ...@@ -113,17 +113,18 @@ void cfb_fillrect(struct fb_info *p, struct fb_fillrect *rect)
if (end_mask) if (end_mask)
FB_WRITE(FB_READ(dst) | end_mask, FB_WRITE(FB_READ(dst) | end_mask,
dst); dst);
dst1 += linesize; dst1 += linesize;
} while (--height); } while (--height);
break; break;
case ROP_XOR: case ROP_XOR:
do { do {
dst = (unsigned long *) (dst1 - start_index); dst =
(unsigned long *) (dst1 - start_index);
if (start_mask) { if (start_mask) {
FB_WRITE(FB_READ(dst) ^ FB_WRITE(FB_READ(dst) ^
start_mask, dst); start_mask, dst);
dst++; dst++;
} }
...@@ -134,56 +135,92 @@ void cfb_fillrect(struct fb_info *p, struct fb_fillrect *rect) ...@@ -134,56 +135,92 @@ void cfb_fillrect(struct fb_info *p, struct fb_fillrect *rect)
if (end_mask) { if (end_mask) {
FB_WRITE(FB_READ(dst) ^ end_mask, FB_WRITE(FB_READ(dst) ^ end_mask,
dst); dst);
} }
dst1 += linesize; dst1 += linesize;
} while (--height); } while (--height);
break; break;
} }
} else { } else {
/* Odd modes like 24 or 80 bits per pixel */ /*
start_mask = fg >> (start_index * p->var.bits_per_pixel); * Slow Method: The aim is to find the number of pixels to
end_mask = fg << (end_index * p->var.bits_per_pixel); * pack in order to write doubleword multiple data.
/* start_mask =& PFILL24(x1,fg); * For 24 bpp, 4 pixels are packed which are written as
end_mask_or = end_mask & PFILL24(x1+width-1,fg); */ * 3 dwords.
*/
n = (rect->width - start_index - end_index) / ppw; char *dst2, *dst3;
int bytes = (p->var.bits_per_pixel + 7) >> 3;
int read, write, total, pack_size;
u32 pixarray[BITS_PER_LONG >> 3], m;
fg = fgcolor;
read = (bytes + (bpl - 1)) & ~(bpl - 1);
write = bytes;
total = (rect->width * bytes);
pack_size = bpl * write;
dst3 = (char *) pixarray;
for (n = read; n--;) {
*(u32 *) dst3 = fg;
dst3 += bytes;
}
switch (rect->rop) { switch (rect->rop) {
case ROP_COPY: case ROP_COPY:
do { do {
dst = (unsigned long *) dst1; dst2 = dst1;
if (start_mask) n = total;
*dst |= start_mask;
if ((start_index + rect->width) > ppw) while (n >= pack_size) {
dst++; for (m = 0; m < write; m++) {
fb_writel(pixarray[m],
/* XXX: slow */ (u32 *) dst2);
for (i = 0; i < n; i++) { dst2 += 4;
*dst++ = fg; }
n -= pack_size;
}
if (n) {
m = 0;
while (n--)
fb_writeb(((u8 *)
pixarray)[m++],
dst2++);
} }
if (end_mask)
*dst |= end_mask;
dst1 += linesize; dst1 += linesize;
} while (--height); } while (--height);
break; break;
case ROP_XOR: case ROP_XOR:
do { do {
dst = (unsigned long *) dst1; dst2 = dst1;
if (start_mask) n = total;
*dst ^= start_mask;
if ((start_mask + rect->width) > ppw) while (n >= pack_size) {
dst++; for (m = 0; m < write; m++) {
fb_writel(fb_readl
for (i = 0; i < n; i++) { ((u32 *) dst2) ^
*dst++ ^= fg; /* PFILL24(fg,x1+i); */ pixarray[m],
(u32 *) dst2);
dst2 += 4;
}
n -= pack_size;
}
if (n) {
m = 0;
while (n--) {
fb_writeb(fb_readb(dst2) ^
((u8 *)
pixarray)[m++],
dst2);
dst2++;
}
} }
if (end_mask)
*dst ^= end_mask;
dst1 += linesize; dst1 += linesize;
} while (--height); } while (--height);
break; break;
} }
} }
return; return;
} }
...@@ -22,6 +22,13 @@ ...@@ -22,6 +22,13 @@
* FIXME * FIXME
* The code for 24 bit is horrible. It copies byte by byte size instead of * The code for 24 bit is horrible. It copies byte by byte size instead of
* longs like the other sizes. Needs to be optimized. * longs like the other sizes. Needs to be optimized.
*
* Tony:
* Incorporate mask tables similar to fbcon-cfb*.c in 2.4 API. This speeds
* up the code significantly.
*
* Code for depths not multiples of BITS_PER_LONG is still kludgy, which is
* still processed a bit at a time.
* *
* Also need to add code to deal with cards endians that are different than * Also need to add code to deal with cards endians that are different than
* the native cpu endians. I also need to deal with MSB position in the word. * the native cpu endians. I also need to deal with MSB position in the word.
...@@ -31,8 +38,6 @@ ...@@ -31,8 +38,6 @@
#include <linux/fb.h> #include <linux/fb.h>
#include <asm/types.h> #include <asm/types.h>
#include <video/fbcon.h>
#define DEBUG #define DEBUG
#ifdef DEBUG #ifdef DEBUG
...@@ -41,16 +46,251 @@ ...@@ -41,16 +46,251 @@
#define DPRINTK(fmt, args...) #define DPRINTK(fmt, args...)
#endif #endif
void cfb_imageblit(struct fb_info *p, struct fb_image *image) static u32 cfb_tab8[] = {
#if defined(__BIG_ENDIAN)
0x00000000, 0x000000ff, 0x0000ff00, 0x0000ffff,
0x00ff0000, 0x00ff00ff, 0x00ffff00, 0x00ffffff,
0xff000000, 0xff0000ff, 0xff00ff00, 0xff00ffff,
0xffff0000, 0xffff00ff, 0xffffff00, 0xffffffff
#elif defined(__LITTLE_ENDIAN)
0x00000000, 0xff000000, 0x00ff0000, 0xffff0000,
0x0000ff00, 0xff00ff00, 0x00ffff00, 0xffffff00,
0x000000ff, 0xff0000ff, 0x00ff00ff, 0xffff00ff,
0x0000ffff, 0xff00ffff, 0x00ffffff, 0xffffffff
#else
#error FIXME: No endianness??
#endif
};
static u32 cfb_tab16[] = {
#if defined(__BIG_ENDIAN)
0x00000000, 0x0000ffff, 0xffff0000, 0xffffffff
#elif defined(__LITTLE_ENDIAN)
0x00000000, 0xffff0000, 0x0000ffff, 0xffffffff
#else
#error FIXME: No endianness??
#endif
};
static u32 cfb_tab32[] = {
0x00000000, 0xffffffff
};
static u32 cfb_pixarray[4];
static u32 cfb_tabdef[2];
static inline void fast_imageblit(struct fb_image *image,
struct fb_info *p, char *dst1,
int fgcolor, int bgcolor)
{ {
int pad, ppw; int i, j, k, l = 8, n;
int x2, y2, n, i, j, k, l = 7; int bit_mask, end_mask, eorx;
unsigned long fgx = fgcolor, bgx = bgcolor, pad;
unsigned long tmp = ~0 << (BITS_PER_LONG - p->var.bits_per_pixel); unsigned long tmp = ~0 << (BITS_PER_LONG - p->var.bits_per_pixel);
unsigned long fgx, bgx, fgcolor, bgcolor, eorx; unsigned long ppw = BITS_PER_LONG / p->var.bits_per_pixel;
unsigned long *dst;
u32 *tab = NULL;
char *src = image->data;
switch (ppw) {
case 4:
tab = cfb_tab8;
break;
case 2:
tab = cfb_tab16;
break;
case 1:
tab = cfb_tab32;
break;
}
for (i = ppw - 1; i--;) {
fgx <<= p->var.bits_per_pixel;
bgx <<= p->var.bits_per_pixel;
fgx |= fgcolor;
bgx |= bgcolor;
}
n = ((image->width + 7) >> 3);
pad = (n << 3) - image->width;
n = image->width % ppw;
bit_mask = (1 << ppw) - 1;
eorx = fgx ^ bgx;
k = image->width / ppw;
for (i = image->height; i--;) {
dst = (unsigned long *) dst1;
for (j = k; j--;) {
l -= ppw;
end_mask = tab[(*src >> l) & bit_mask];
fb_writel((end_mask & eorx) ^ bgx, dst++);
if (!l) {
l = 8;
src++;
}
}
if (n) {
end_mask = 0;
for (j = n; j > 0; j--) {
l--;
if (test_bit(l, (unsigned long *) src))
end_mask |=
(tmp >>
(p->var.bits_per_pixel *
(j - 1)));
if (!l) {
l = 8;
src++;
}
}
fb_writel((end_mask & eorx) ^ bgx, dst++);
}
l -= pad;
dst1 += p->fix.line_length;
}
}
/*
* Slow method: The idea is to find the number of pixels necessary to form
* dword-sized multiples that will be written to the framebuffer. For BPP24,
* 4 pixels has to be read which are then packed into 3 double words that
* are then written to the framebuffer.
*
* With this method, processing is done 1 pixel at a time.
*/
static inline void slow_imageblit(struct fb_image *image,
struct fb_info *p, char *dst1,
int fgcolor, int bgcolor)
{
int bytes = (p->var.bits_per_pixel + 7) >> 3;
int tmp = ~0UL >> (BITS_PER_LONG - p->var.bits_per_pixel);
int i, j, k, l = 8, m, end_mask, eorx;
int read, write, total, pack_size, bpl = sizeof(unsigned long);
unsigned long *dst;
char *dst2 = (char *) cfb_pixarray, *src = image->data;
cfb_tabdef[0] = 0;
cfb_tabdef[1] = tmp;
eorx = fgcolor ^ bgcolor;
read = (bytes + (bpl - 1)) & ~(bpl - 1);
write = bytes;
total = image->width * bytes;
pack_size = bpl * write;
for (i = image->height; i--;) {
dst = (unsigned long *) dst1;
j = total;
m = read;
while (j >= pack_size) {
l--;
m--;
end_mask = cfb_tabdef[(*src >> l) & 1];
*(unsigned long *) dst2 =
(end_mask & eorx) ^ bgcolor;
dst2 += bytes;
if (!m) {
for (k = 0; k < write; k++)
fb_writel(cfb_pixarray[k], dst++);
dst2 = (char *) cfb_pixarray;
j -= pack_size;
m = read;
}
if (!l) {
l = 8;
src++;
}
}
/* write residual pixels */
if (j) {
k = 0;
while (j--)
fb_writeb(((u8 *) cfb_pixarray)[k++],
dst++);
}
dst1 += p->fix.line_length;
}
}
static inline void bitwise_blit(struct fb_image *image, struct fb_info *p,
char *dst1, int fgcolor, int bgcolor)
{
int i, j, k, l = 8, n, pad, ppw;
unsigned long tmp = ~0 << (BITS_PER_LONG - p->var.bits_per_pixel);
unsigned long fgx = fgcolor, bgx = bgcolor, eorx;
unsigned long end_mask; unsigned long end_mask;
unsigned long *dst = NULL; unsigned long *dst = NULL;
char *src = image->data;
ppw = BITS_PER_LONG / p->var.bits_per_pixel;
for (i = 0; i < ppw - 1; i++) {
fgx <<= p->var.bits_per_pixel;
bgx <<= p->var.bits_per_pixel;
fgx |= fgcolor;
bgx |= bgcolor;
}
eorx = fgx ^ bgx;
n = ((image->width + 7) >> 3);
pad = (n << 3) - image->width;
n = image->width % ppw;
for (i = 0; i < image->height; i++) {
dst = (unsigned long *) dst1;
for (j = image->width / ppw; j > 0; j--) {
end_mask = 0;
for (k = ppw; k > 0; k--) {
l--;
if (test_bit(l, (unsigned long *) src))
end_mask |=
(tmp >>
(p->var.bits_per_pixel *
(k - 1)));
if (!l) {
l = 8;
src++;
}
}
fb_writel((end_mask & eorx) ^ bgx, dst);
dst++;
}
if (n) {
end_mask = 0;
for (j = n; j > 0; j--) {
l--;
if (test_bit(l, (unsigned long *) src))
end_mask |=
(tmp >>
(p->var.bits_per_pixel *
(j - 1)));
if (!l) {
l = 8;
src++;
}
}
fb_writel((end_mask & eorx) ^ bgx, dst);
dst++;
}
l -= pad;
dst1 += p->fix.line_length;
}
}
void cfb_imageblit(struct fb_info *p, struct fb_image *image)
{
int x2, y2, n;
unsigned long fgcolor, bgcolor;
unsigned long end_mask;
u8 *dst1; u8 *dst1;
u8 *src;
/* /*
* We could use hardware clipping but on many cards you get around hardware * We could use hardware clipping but on many cards you get around hardware
...@@ -62,68 +302,37 @@ void cfb_imageblit(struct fb_info *p, struct fb_image *image) ...@@ -62,68 +302,37 @@ void cfb_imageblit(struct fb_info *p, struct fb_image *image)
image->dy = image->dy > 0 ? image->dy : 0; image->dy = image->dy > 0 ? image->dy : 0;
x2 = x2 < p->var.xres_virtual ? x2 : p->var.xres_virtual; x2 = x2 < p->var.xres_virtual ? x2 : p->var.xres_virtual;
y2 = y2 < p->var.yres_virtual ? y2 : p->var.yres_virtual; y2 = y2 < p->var.yres_virtual ? y2 : p->var.yres_virtual;
image->width = x2 - image->dx; image->width = x2 - image->dx;
image->height = y2 - image->dy; image->height = y2 - image->dy;
dst1 = p->screen_base + image->dy * p->fix.line_length +
((image->dx * p->var.bits_per_pixel) >> 3);
ppw = BITS_PER_LONG/p->var.bits_per_pixel;
src = image->data; dst1 = p->screen_base + image->dy * p->fix.line_length +
((image->dx * p->var.bits_per_pixel) >> 3);
if (image->depth == 1) { if (image->depth == 1) {
if (p->fix.visual == FB_VISUAL_TRUECOLOR) { if (p->fix.visual == FB_VISUAL_TRUECOLOR) {
fgx = fgcolor = ((u32 *)(p->pseudo_palette))[image->fg_color]; fgcolor =
bgx = bgcolor = ((u32 *)(p->pseudo_palette))[image->bg_color]; ((u32 *) (p->pseudo_palette))[image->fg_color];
bgcolor =
((u32 *) (p->pseudo_palette))[image->bg_color];
} else { } else {
fgx = fgcolor = image->fg_color; fgcolor = image->fg_color;
bgx = bgcolor = image->bg_color; bgcolor = image->bg_color;
}
for (i = 0; i < ppw-1; i++) {
fgx <<= p->var.bits_per_pixel;
bgx <<= p->var.bits_per_pixel;
fgx |= fgcolor;
bgx |= bgcolor;
} }
eorx = fgx ^ bgx;
n = ((image->width + 7) >> 3); if (p->var.bits_per_pixel >= 8) {
pad = (n << 3) - image->width; if (BITS_PER_LONG % p->var.bits_per_pixel == 0)
n = image->width % ppw; fast_imageblit(image, p, dst1, fgcolor,
bgcolor);
for (i = 0; i < image->height; i++) { else
dst = (unsigned long *) dst1; slow_imageblit(image, p, dst1, fgcolor,
bgcolor);
for (j = image->width/ppw; j > 0; j--) { } else
end_mask = 0; /* Is there such a thing as 3 or 5 bits per pixel? */
slow_imageblit(image, p, dst1, fgcolor, bgcolor);
for (k = ppw; k > 0; k--) {
if (test_bit(l, (unsigned long *) src)) }
end_mask |= (tmp >> (p->var.bits_per_pixel*(k-1)));
l--; else {
if (l < 0) { l = 7; src++; }
}
fb_writel((end_mask & eorx)^bgx, dst);
dst++;
}
if (n) {
end_mask = 0;
for (j = n; j > 0; j--) {
if (test_bit(l, (unsigned long *) src))
end_mask |= (tmp >> (p->var.bits_per_pixel*(j-1)));
l--;
if (l < 0) { l = 7; src++; }
}
fb_writel((end_mask & eorx)^bgx, dst);
dst++;
}
l -= pad;
dst1 += p->fix.line_length;
}
} else {
/* Draw the penguin */ /* Draw the penguin */
n = ((image->width * p->var.bits_per_pixel) >> 3); n = ((image->width * p->var.bits_per_pixel) >> 3);
end_mask = 0; end_mask = 0;
......
CONFIG_VIDEO_SELECT
This enables support for text mode selection on kernel startup. If
you want to take advantage of some high-resolution text mode your
card's BIOS offers, but the traditional Linux utilities like
SVGATextMode don't, you can say Y here and set the mode using the
"vga=" option from your boot loader (lilo or loadlin) or set
"vga=ask" which brings up a video mode menu on kernel startup. (Try
"man bootparam" or see the documentation of your boot loader about
how to pass options to the kernel.)
Read the file <file:Documentation/svga.txt> for more information
about the Video mode selection support. If unsure, say N.
CONFIG_FBCON_VGA_PLANES
This low level frame buffer console driver enable the kernel to use
the 16-color planar modes of the old VGA cards where the bits of
each pixel are separated into 4 planes.
Only answer Y here if you have a (very old) VGA card that isn't VESA
2 compatible.
CONFIG_FB_VGA16
This is the frame buffer device driver for VGA 16 color graphic
cards. Say Y if you have such a card.
This code is also available as a module. If you want to compile it
as a module ( = code which can be inserted in and removed from the
running kernel whenever you want), say M here and read
<file:Documentation/modules.txt>. The module will be called
vga16fb.o.
CONFIG_FB_STI
STI refers to the HP "Standard Text Interface" which is a set of
BIOS routines contained in a ROM chip in HP PA-RISC based machines.
Enabling this option will implement the linux framebuffer device and
an fbcon color text console using calls to the STI BIOS routines.
The HP framebuffer device is usually planar, uses a strange memory
layout, and changing the plane mask to create colored pixels
requires a call to the STI routines, so do not expect /dev/fb to
actually be useful. However, it is the best we have as far as
graphics on the HP chipsets due to lack of hardware level
documentation for the various on-board HP chipsets used in these
systems. It is sufficient for basic text console functions,
including fonts.
You should probably enable this option, unless you are having
trouble getting video when booting the kernel (make sure it isn't
just that you are running the console on the serial port, though).
Really old HP boxes may not have STI, and must use the PDC BIOS
console or the IODC BIOS.
CONFIG_FBCON_FONTS
Say Y here if you would like to use fonts other than the default
your frame buffer console usually use.
Note that the answer to this question won't directly affect the
kernel: saying N will just cause the configurator to skip all
the questions about foreign fonts.
If unsure, say N (the default choices are safe).
CONFIG_FONT_8x16
This is the "high resolution" font for the VGA frame buffer (the one
provided by the VGA text console 80x25 mode.
If unsure, say Y.
CONFIG_FBCON_FONTWIDTH8_ONLY
Answer Y here will make the kernel provide only the 8x8 fonts (these
are the less readable).
If unsure, say N.
CONFIG_FONT_SUN8x16
This is the high resolution console font for Sun machines. Say Y.
CONFIG_FONT_SUN12x22
This is the high resolution console font for Sun machines with very
big letters (like the letters used in the SPARC PROM). If the
standard font is unreadable for you, say Y, otherwise say N.
CONFIG_FONT_8x8
This is the "high resolution" font for the VGA frame buffer (the one
provided by the text console 80x50 (and higher) modes).
Note that this is a poor quality font. The VGA 8x16 font is quite a
lot more readable.
Given the resolution provided by the frame buffer device, answer N
here is safe.
CONFIG_FONT_6x11
Small console font with Macintosh-style high-half glyphs. Some Mac
framebuffer drivers don't support this one at all.
CONFIG_FONT_PEARL_8x8
Small console font with PC-style control-character and high-half
glyphs.
CONFIG_FONT_ACORN_8x8
Small console font with PC-style control characters and high-half
glyphs.
CONFIG_FBCON_ADVANCED
The frame buffer console uses character drawing routines that are
tailored to the specific organization of pixels in the memory of
your graphics hardware. These are called the low level frame buffer
console drivers. Note that they are used for text console output
only; they are NOT needed for graphical applications.
If you say N here, the needed low level drivers are automatically
enabled, depending on what frame buffer devices you selected above.
This is recommended for most users.
If you say Y here, you have more fine-grained control over which low
level drivers are enabled. You can e.g. leave out low level drivers
for color depths you do not intend to use for text consoles.
Low level frame buffer console drivers can be modules ( = code which
can be inserted and removed from the running kernel whenever you
want). The modules will be called fbcon-*.o. If you want to compile
(some of) them as modules, read <file:Documentation/modules.txt>.
If unsure, say N.
CONFIG_FBCON_AFB
This is the low level frame buffer console driver for 1 to 8
bitplanes (2 to 256 colors) on Amiga.
CONFIG_FBCON_ILBM
This is the low level frame buffer console driver for 1 to 8
interleaved bitplanes (2 to 256 colors) on Amiga.
CONFIG_FBCON_IPLAN2P2
This is the low level frame buffer console driver for 2 interleaved
bitplanes (4 colors) on Atari.
CONFIG_FBCON_IPLAN2P4
This is the low level frame buffer console driver for 4 interleaved
bitplanes (16 colors) on Atari.
CONFIG_FBCON_IPLAN2P8
This is the low level frame buffer console driver for 8 interleaved
bitplanes (256 colors) on Atari.
CONFIG_FBCON_HGA
This is the low level frame buffer console driver for Hercules mono
graphics cards.
#
# Console Display configuration
#
if [ "$CONFIG_VT" != "n" ]; then
mainmenu_option next_comment
comment 'Console Display driver support'
bool 'Video mode selection support' CONFIG_VIDEO_SELECT
if [ "$CONFIG_ARCH_ACORN" != "y" -a "$CONFIG_ARCH_EBSA110" != "y" -a \
"$CONFIG_4xx" != "y" -a "$CONFIG_8xx" != "y" ]; then
bool 'VGA text console' CONFIG_VGA_CONSOLE
# if [ "$CONFIG_PCI" = "y" -a "$CONFIG_VGA_CONSOLE" = "y" ]; then
# bool ' Allow VGA on any bus?' CONFIG_VGA_HOSE
# if [ "$CONFIG_VGA_HOSE" = "y" ]; then
# define_bool CONFIG_DUMMY_CONSOLE y
# fi
# fi
fi
tristate 'MDA text console (dual-headed) ' CONFIG_MDA_CONSOLE
if [ "$CONFIG_FB" = "y" ]; then
define_bool CONFIG_PCI_CONSOLE y
fi
#if [ "$CONFIG_SGI_IP22" = "y" ]; then
# tristate 'SGI Newport Console support' CONFIG_SGI_NEWPORT_CONSOLE
# if [ "$CONFIG_SGI_NEWPORT_CONSOLE" != "y" ]; then
# define_bool CONFIG_DUMMY_CONSOLE y
# else
# define_bool CONFIG_FONT_8x16 y
#fi
if [ "$CONFIG_ARCH_PARISC" = "y" ]; then
# bool 'IODC console' CONFIG_IODC_CONSOLE
bool 'STI console' CONFIG_STI_CONSOLE
if [ "$CONFIG_IODC_CONSOLE" = "n" ]; then
if [ "$CONFIG_GSC_PS2" = "y" ]; then
define_bool CONFIG_DUMMY_CONSOLE y
fi
fi
if [ "$CONFIG_STI_CONSOLE" = "y" ]; then
define_bool CONFIG_DUMMY_CONSOLE y
fi
fi
if [ "$CONFIG_SPARC32" = "y" -o "$CONFIG_SPARC64" = "y" ]; then
bool 'PROM console' CONFIG_PROM_CONSOLE
if [ "$CONFIG_PROM_CONSOLE" != "y" ]; then
define_bool CONFIG_DUMMY_CONSOLE y
fi
fi
if [ "$CONFIG_FB" = "y" ]; then
bool 'Framebuffer Console support' CONFIG_FRAMEBUFFER_CONSOLE
if [ "$CONFIG_FRAMEBUFFER_CONSOLE" = "y" ]; then
define_bool CONFIG_DUMMY_CONSOLE y
bool ' Advanced low level driver options' CONFIG_FBCON_ADVANCED
if [ "$CONFIG_FBCON_ADVANCED" = "y" ]; then
tristate ' Hardware acceleration support' CONFIG_FBCON_ACCEL
tristate ' Amiga bitplanes support' CONFIG_FBCON_AFB
tristate ' Amiga interleaved bitplanes support' CONFIG_FBCON_ILBM
tristate ' Atari interleaved bitplanes (2 planes) support' CONFIG_FBCON_IPLAN2P2
tristate ' Atari interleaved bitplanes (4 planes) support' CONFIG_FBCON_IPLAN2P4
tristate ' Atari interleaved bitplanes (8 planes) support' CONFIG_FBCON_IPLAN2P8
tristate ' VGA 16-color planar support' CONFIG_FBCON_VGA_PLANES
tristate ' HGA monochrome support ' CONFIG_FBCON_HGA
else
if [ "$CONFIG_FB_NEOMAGIC" = "y" -o "$CONFIG_FB_VESA" = "y" -o \
"$CONFIG_FB_FM2" = "y" -o "$CONFIG_FB_HIT" = "y" -o \
"$CONFIG_FB_HP300" = "y" -o "$CONFIG_FB_Q40" = "y" -o \
"$CONFIG_FB_ANAKIN" = "y" -o "$CONFIG_FB_G364" = "y" -o \
"$CONFIG_FB_VIRTUAL" = "y" -o "$CONFIG_FB_CLPS711X" = "y" -o \
"$CONFIG_FB_PMAG_BA" = "y" -o "$CONFIG_FB_PMAGB_B" = "y" -o \
"$CONFIG_FB_3DFX" = "y" -o "$CONFIG_FB_TX3912" = "y" -o \
"$CONFIG_FB_MAXINE" = "y" -o "$CONFIG_FB_APOLLO" = "y" -o \
"$CONFIG_FB_ATY" = "y" -o "$CONFIG_FB_MAC" = "y" -o \
"$CONFIG_FB_RIVA" = "y" -o "$CONFIG_FB_OF" = "y" -o \
"$CONFIG_FB_SGIVW" = "y" -o "$CONFIG_SIS" = "y" ]; then
define_tristate CONFIG_FBCON_ACCEL y
else
if [ "$CONFIG_FB_NEOMAGIC" = "m" -o "$CONFIG_FB_HIT" = "m" -o \
"$CONFIG_FB_G364" = "m" -o "$CONFIG_FB_VIRTUAL" = "m" -o \
"$CONFIG_FB_CLPS711X" = "m" -o "$CONFIG_FB_3DFX" = "m" -o \
"$CONFIG_FB_RIVA" = "m" -o "$CONFIG_FB_SGIVW" = "m" -o \
"$CONFIG_FB_ATY" = "m" -o "$CONFIG_FB_SIS" = "y" ]; then
define_tristate CONFIG_FBCON_ACCEL m
fi
fi
if [ "$CONFIG_FB_AMIGA" = "y" ]; then
define_tristate CONFIG_FBCON_AFB y
define_tristate CONFIG_FBCON_ILBM y
else
if [ "$CONFIG_FB_AMIGA" = "m" ]; then
define_tristate CONFIG_FBCON_AFB m
define_tristate CONFIG_FBCON_ILBM m
fi
fi
if [ "$CONFIG_FB_ATARI" = "y" ]; then
define_tristate CONFIG_FBCON_IPLAN2P2 y
define_tristate CONFIG_FBCON_IPLAN2P4 y
define_tristate CONFIG_FBCON_IPLAN2P8 y
else
if [ "$CONFIG_FB_ATARI" = "m" ]; then
define_tristate CONFIG_FBCON_IPLAN2P2 m
define_tristate CONFIG_FBCON_IPLAN2P4 m
define_tristate CONFIG_FBCON_IPLAN2P8 m
fi
fi
if [ "$CONFIG_FB_VGA16" = "y" ]; then
define_tristate CONFIG_FBCON_VGA_PLANES y
else
if [ "$CONFIG_FB_VGA16" = "m" ]; then
define_tristate CONFIG_FBCON_VGA_PLANES m
fi
fi
fi
bool ' Support only 8 pixels wide fonts' CONFIG_FBCON_FONTWIDTH8_ONLY
if [ "$CONFIG_SPARC32" = "y" -o "$CONFIG_SPARC64" = "y" ]; then
bool ' Sparc console 8x16 font' CONFIG_FONT_SUN8x16
if [ "$CONFIG_FBCON_FONTWIDTH8_ONLY" = "n" ]; then
bool ' Sparc console 12x22 font (not supported by all drivers)' CONFIG_FONT_SUN12x22
fi
bool ' Select other fonts' CONFIG_FBCON_FONTS
if [ "$CONFIG_FBCON_FONTS" = "y" ]; then
bool ' VGA 8x8 font' CONFIG_FONT_8x8
bool ' VGA 8x16 font' CONFIG_FONT_8x16
if [ "$CONFIG_FBCON_FONTWIDTH8_ONLY" = "n" ]; then
bool ' Mac console 6x11 font (not supported by all drivers)' CONFIG_FONT_6x11
fi
bool ' Pearl (old m68k) console 8x8 font' CONFIG_FONT_PEARL_8x8
bool ' Acorn console 8x8 font' CONFIG_FONT_ACORN_8x8
fi
else
bool ' Select compiled-in fonts' CONFIG_FBCON_FONTS
if [ "$CONFIG_FBCON_FONTS" = "y" ]; then
bool ' VGA 8x8 font' CONFIG_FONT_8x8
bool ' VGA 8x16 font' CONFIG_FONT_8x16
bool ' Sparc console 8x16 font' CONFIG_FONT_SUN8x16
if [ "$CONFIG_FBCON_FONTWIDTH8_ONLY" = "n" ]; then
bool ' Sparc console 12x22 font (not supported by all drivers)' CONFIG_FONT_SUN12x22
bool ' Mac console 6x11 font (not supported by all drivers)' CONFIG_FONT_6x11
fi
bool ' Pearl (old m68k) console 8x8 font' CONFIG_FONT_PEARL_8x8
bool ' Acorn console 8x8 font' CONFIG_FONT_ACORN_8x8
bool ' Mini 4x6 font' CONFIG_FONT_MINI_4x6
else
define_bool CONFIG_FONT_8x8 y
define_bool CONFIG_FONT_8x16 y
if [ "$CONFIG_MAC" = "y" ]; then
if [ "$CONFIG_FBCON_FONTWIDTH8_ONLY" = "n" ]; then
define_bool CONFIG_FONT_6x11 y
fi
fi
if [ "$CONFIG_AMIGA" = "y" ]; then
define_bool CONFIG_FONT_PEARL_8x8 y
fi
if [ "$CONFIG_ARM" = "y" -a "$CONFIG_ARCH_ACORN" = "y" ]; then
define_bool CONFIG_FONT_ACORN_8x8 y
fi
fi
fi
fi
fi
endmenu
fi
# Makefile for the Linux graphics to console drivers.
# 5 Aug 1999, James Simmons, <mailto:jsimmons@users.sf.net>
# Rewritten to use lists instead of if-statements.
# All of the (potential) objects that export symbols.
# This list comes from 'grep -l EXPORT_SYMBOL *.[hc]'.
export-objs := fbcon.o fbcon-accel.o fbcon-afb.o fbcon-ilbm.o \
fbcon-iplan2p2.o fbcon-iplan2p4.o fbcon-iplan2p8.o \
fbcon-vga-planes.o fbcon-vga8-planes.o fbcon-hga.o
# Each configuration option enables a list of files.
obj-$(CONFIG_DUMMY_CONSOLE) += dummycon.o
obj-$(CONFIG_SGI_NEWPORT_CONSOLE) += newport_con.o
obj-$(CONFIG_PROM_CONSOLE) += promcon.o promcon_tbl.o
obj-$(CONFIG_STI_CONSOLE) += sticon.o sticon-bmode.o ../sticore.o
obj-$(CONFIG_VGA_CONSOLE) += vgacon.o
obj-$(CONFIG_MDA_CONSOLE) += mdacon.o
obj-$(CONFIG_FONT_SUN8x16) += font_sun8x16.o
obj-$(CONFIG_FONT_SUN12x22) += font_sun12x22.o
obj-$(CONFIG_FONT_8x8) += font_8x8.o
obj-$(CONFIG_FONT_8x16) += font_8x16.o
obj-$(CONFIG_FONT_6x11) += font_6x11.o
obj-$(CONFIG_FONT_PEARL_8x8) += font_pearl_8x8.o
obj-$(CONFIG_FONT_ACORN_8x8) += font_acorn_8x8.o
obj-$(CONFIG_FONT_MINI_4x6) += font_mini_4x6.o
obj-$(CONFIG_FRAMEBUFFER_CONSOLE) += fbcon.o fonts.o
# Generic Low Level Drivers
obj-$(CONFIG_FBCON_AFB) += fbcon-afb.o
obj-$(CONFIG_FBCON_ILBM) += fbcon-ilbm.o
obj-$(CONFIG_FBCON_IPLAN2P2) += fbcon-iplan2p2.o
obj-$(CONFIG_FBCON_IPLAN2P4) += fbcon-iplan2p4.o
obj-$(CONFIG_FBCON_IPLAN2P8) += fbcon-iplan2p8.o
obj-$(CONFIG_FBCON_HGA) += fbcon-hga.o
obj-$(CONFIG_FBCON_STI) += fbcon-sti.o
obj-$(CONFIG_FBCON_ACCEL) += fbcon-accel.o
include $(TOPDIR)/Rules.make
$(obj)/promcon_tbl.c: $(src)/prom.uni
$(objtree)/scripts/conmakehash $< | \
sed -e '/#include <[^>]*>/p' -e 's/types/init/' \
-e 's/dfont\(_uni.*\]\)/promfont\1 __initdata/' > $@
...@@ -82,9 +82,10 @@ void fbcon_accel_putcs(struct vc_data *vc, struct display *p, ...@@ -82,9 +82,10 @@ void fbcon_accel_putcs(struct vc_data *vc, struct display *p,
unsigned short charmask = p->charmask; unsigned short charmask = p->charmask;
unsigned int width = ((fontwidth(p)+7)>>3); unsigned int width = ((fontwidth(p)+7)>>3);
struct fb_image image; struct fb_image image;
u16 c = scr_readw(s);
image.fg_color = attr_fgcol(p, *s); image.fg_color = attr_fgcol(p, c);
image.bg_color = attr_bgcol(p, *s); image.bg_color = attr_bgcol(p, c);
image.dx = xx * fontwidth(p); image.dx = xx * fontwidth(p);
image.dy = yy * fontheight(p); image.dy = yy * fontheight(p);
image.width = fontwidth(p); image.width = fontwidth(p);
......
...@@ -105,10 +105,9 @@ void fbcon_vga_planes_setup(struct display *p) ...@@ -105,10 +105,9 @@ void fbcon_vga_planes_setup(struct display *p)
void fbcon_vga_planes_bmove(struct display *p, int sy, int sx, int dy, int dx, void fbcon_vga_planes_bmove(struct display *p, int sy, int sx, int dy, int dx,
int height, int width) int height, int width)
{ {
char *src; struct fb_info *info = p->fb_info;
char *dest; char *dest, *src;
int line_ofs; int line_ofs, x;
int x;
setmode(1); setmode(1);
setop(0); setop(0);
...@@ -119,9 +118,9 @@ void fbcon_vga_planes_bmove(struct display *p, int sy, int sx, int dy, int dx, ...@@ -119,9 +118,9 @@ void fbcon_vga_planes_bmove(struct display *p, int sy, int sx, int dy, int dx,
height *= fontheight(p); height *= fontheight(p);
if (dy < sy || (dy == sy && dx < sx)) { if (dy < sy || (dy == sy && dx < sx)) {
line_ofs = p->fb_info->fix.line_length - width; line_ofs = info->fix.line_length - width;
dest = p->fb_info->screen_base + dx + dy * p->fb_info->fix.line_length; dest = info->screen_base + dx + dy * info->fix.line_length;
src = p->fb_info->screen_base + sx + sy * p->fb_info->fix.line_length; src = info->screen_base + sx + sy * info->fix.line_length;
while (height--) { while (height--) {
for (x = 0; x < width; x++) { for (x = 0; x < width; x++) {
readb(src); readb(src);
...@@ -133,9 +132,9 @@ void fbcon_vga_planes_bmove(struct display *p, int sy, int sx, int dy, int dx, ...@@ -133,9 +132,9 @@ void fbcon_vga_planes_bmove(struct display *p, int sy, int sx, int dy, int dx,
dest += line_ofs; dest += line_ofs;
} }
} else { } else {
line_ofs = p->fb_info->fix.line_length - width; line_ofs = info->fix.line_length - width;
dest = p->fb_info->screen_base + dx + width + (dy + height - 1) * p->fb_info->fix.line_length; dest = info->screen_base + dx + width + (dy + height - 1) * info->fix.line_length;
src = p->fb_info->screen_base + sx + width + (sy + height - 1) * p->fb_info->fix.line_length; src = info->screen_base + sx + width + (sy + height - 1) * info->fix.line_length;
while (height--) { while (height--) {
for (x = 0; x < width; x++) { for (x = 0; x < width; x++) {
dest--; dest--;
...@@ -177,137 +176,48 @@ void fbcon_vga_planes_clear(struct vc_data *conp, struct display *p, int sy, int ...@@ -177,137 +176,48 @@ void fbcon_vga_planes_clear(struct vc_data *conp, struct display *p, int sy, int
} }
} }
void fbcon_ega_planes_putc(struct vc_data *conp, struct display *p, int c, int yy, int xx) void fbcon_accel_putc(struct vc_data *vc, struct display *p, int c, int yy,
{ int xx)
int fg = attr_fgcol(p,c);
int bg = attr_bgcol(p,c);
int y;
u8 *cdat = p->fontdata + (c & p->charmask) * fontheight(p);
char *where = p->fb_info->screen_base + xx + yy * p->fb_info->fix.line_length * fontheight(p);
setmode(0);
setop(0);
setsr(0xf);
setcolor(bg);
selectmask();
setmask(0xff);
for (y = 0; y < fontheight(p); y++, where += p->fb_info->fix.line_length)
rmw(where);
where -= p->fb_info->fix.line_length * y;
setcolor(fg);
selectmask();
for (y = 0; y < fontheight(p); y++, where += p->fb_info->fix.line_length)
if (cdat[y]) {
setmask(cdat[y]);
rmw(where);
}
}
void fbcon_vga_planes_putc(struct vc_data *conp, struct display *p, int c, int yy, int xx)
{
int fg = attr_fgcol(p,c);
int bg = attr_bgcol(p,c);
int y;
u8 *cdat = p->fontdata + (c & p->charmask) * fontheight(p);
char *where = p->fb_info->screen_base + xx + yy * p->fb_info->fix.line_length * fontheight(p);
setmode(2);
setop(0);
setsr(0xf);
setcolor(fg);
selectmask();
setmask(0xff);
writeb(bg, where);
rmb();
readb(where); /* fill latches */
setmode(3);
wmb();
for (y = 0; y < fontheight(p); y++, where += p->fb_info->fix.line_length)
writeb(cdat[y], where);
wmb();
}
/* 28.50 in my test */
void fbcon_ega_planes_putcs(struct vc_data *conp, struct display *p, const unsigned short *s,
int count, int yy, int xx)
{ {
u16 c = scr_readw(s); struct fb_info *info = p->fb_info;
int fg = attr_fgcol(p, c); unsigned short charmask = p->charmask;
int bg = attr_bgcol(p, c); unsigned int width = ((fontwidth(p)+7)>>3);
struct fb_image image;
char *where;
int n; image.fg_color = attr_fgcol(p, c);
image.bg_color = attr_bgcol(p, c);
setmode(2); image.dx = xx * fontwidth(p);
setop(0); image.dy = yy * fontheight(p);
selectmask(); image.width = fontwidth(p);
image.height = fontheight(p);
setmask(0xff); image.depth = 1;
where = p->fb_info->screen_base + xx + yy * p->fb_info->fix.line_length * fontheight(p); image.data = p->fontdata + (c & charmask)*fontheight(p)*width;
writeb(bg, where);
rmb(); info->fbops->fb_imageblit(info, &image);
readb(where); /* fill latches */
wmb();
selectmask();
for (n = 0; n < count; n++) {
int c = scr_readw(s++) & p->charmask;
u8 *cdat = p->fontdata + c * fontheight(p);
u8 *end = cdat + fontheight(p);
while (cdat < end) {
outb(*cdat++, GRAPHICS_DATA_REG);
wmb();
writeb(fg, where);
where += p->fb_info->fix.line_length;
}
where += 1 - p->fb_info->fix.line_length * fontheight(p);
}
wmb();
} }
/* 6.96 in my test */ void fbcon_accel_putcs(struct vc_data *vc, struct display *p,
void fbcon_vga_planes_putcs(struct vc_data *conp, struct display *p, const unsigned short *s, const unsigned short *s, int count, int yy, int xx)
int count, int yy, int xx)
{ {
u16 c = scr_readw(s); struct fb_info *info = p->fb_info;
int fg = attr_fgcol(p, c); unsigned short charmask = p->charmask;
int bg = attr_bgcol(p, c); unsigned int width = ((fontwidth(p)+7)>>3);
struct fb_image image;
char *where;
int n; image.fg_color = attr_fgcol(p, *s);
image.bg_color = attr_bgcol(p, *s);
setmode(2); image.dx = xx * fontwidth(p);
setop(0); image.dy = yy * fontheight(p);
setsr(0xf); image.width = fontwidth(p);
setcolor(fg); image.height = fontheight(p);
selectmask(); image.depth = 1;
setmask(0xff); while (count--) {
where = p->fb_info->screen_base + xx + yy * p->fb_info->fix.line_length * fontheight(p); image.data = p->fontdata +
writeb(bg, where); (scr_readw(s++) & charmask) * fontheight(p) * width;
rmb(); info->fbops->fb_imageblit(info, &image);
readb(where); /* fill latches */ image.dx += fontwidth(p);
setmode(3); }
wmb();
for (n = 0; n < count; n++) {
int y;
int c = scr_readw(s++) & p->charmask;
u8 *cdat = p->fontdata + (c & p->charmask) * fontheight(p);
for (y = 0; y < fontheight(p); y++, cdat++) {
writeb (*cdat, where);
where += p->fb_info->fix.line_length;
}
where += 1 - p->fb_info->fix.line_length * fontheight(p);
}
wmb();
} }
void fbcon_vga_planes_revc(struct display *p, int xx, int yy) void fbcon_vga_planes_revc(struct display *p, int xx, int yy)
...@@ -332,18 +242,8 @@ struct display_switch fbcon_vga_planes = { ...@@ -332,18 +242,8 @@ struct display_switch fbcon_vga_planes = {
setup: fbcon_vga_planes_setup, setup: fbcon_vga_planes_setup,
bmove: fbcon_vga_planes_bmove, bmove: fbcon_vga_planes_bmove,
clear: fbcon_vga_planes_clear, clear: fbcon_vga_planes_clear,
putc: fbcon_vga_planes_putc, putc: fbcon_accel_putc,
putcs: fbcon_vga_planes_putcs, putcs: fbcon_accel_putcs,
revc: fbcon_vga_planes_revc,
fontwidthmask: FONTWIDTH(8)
};
struct display_switch fbcon_ega_planes = {
setup: fbcon_vga_planes_setup,
bmove: fbcon_vga_planes_bmove,
clear: fbcon_vga_planes_clear,
putc: fbcon_ega_planes_putc,
putcs: fbcon_ega_planes_putcs,
revc: fbcon_vga_planes_revc, revc: fbcon_vga_planes_revc,
fontwidthmask: FONTWIDTH(8) fontwidthmask: FONTWIDTH(8)
}; };
...@@ -369,14 +269,8 @@ EXPORT_SYMBOL(fbcon_vga_planes); ...@@ -369,14 +269,8 @@ EXPORT_SYMBOL(fbcon_vga_planes);
EXPORT_SYMBOL(fbcon_vga_planes_setup); EXPORT_SYMBOL(fbcon_vga_planes_setup);
EXPORT_SYMBOL(fbcon_vga_planes_bmove); EXPORT_SYMBOL(fbcon_vga_planes_bmove);
EXPORT_SYMBOL(fbcon_vga_planes_clear); EXPORT_SYMBOL(fbcon_vga_planes_clear);
EXPORT_SYMBOL(fbcon_vga_planes_putc);
EXPORT_SYMBOL(fbcon_vga_planes_putcs);
EXPORT_SYMBOL(fbcon_vga_planes_revc); EXPORT_SYMBOL(fbcon_vga_planes_revc);
EXPORT_SYMBOL(fbcon_ega_planes);
EXPORT_SYMBOL(fbcon_ega_planes_putc);
EXPORT_SYMBOL(fbcon_ega_planes_putcs);
/* /*
* Overrides for Emacs so that we follow Linus's tabbing style. * Overrides for Emacs so that we follow Linus's tabbing style.
* --------------------------------------------------------------------------- * ---------------------------------------------------------------------------
......
...@@ -180,6 +180,13 @@ static const char __init *vgacon_startup(void) ...@@ -180,6 +180,13 @@ static const char __init *vgacon_startup(void)
#endif #endif
} }
/* VGA16 modes are not handled by VGACON */
if ((ORIG_VIDEO_MODE == 0x0D) || /* 320x200/4 */
(ORIG_VIDEO_MODE == 0x0E) || /* 640x200/4 */
(ORIG_VIDEO_MODE == 0x10) || /* 640x350/4 */
(ORIG_VIDEO_MODE == 0x12) || /* 640x480/4 */
(ORIG_VIDEO_MODE == 0x6A)) /* 800x600/4, 0x6A is very common */
goto no_vga;
vga_video_num_lines = ORIG_VIDEO_LINES; vga_video_num_lines = ORIG_VIDEO_LINES;
vga_video_num_columns = ORIG_VIDEO_COLS; vga_video_num_columns = ORIG_VIDEO_COLS;
......
...@@ -15,8 +15,6 @@ ...@@ -15,8 +15,6 @@
#include <linux/fb.h> #include <linux/fb.h>
#include <linux/module.h> #include <linux/module.h>
#include <video/fbcon.h>
/* apollo video HW definitions */ /* apollo video HW definitions */
/* /*
...@@ -111,7 +109,6 @@ ...@@ -111,7 +109,6 @@
#endif #endif
static struct fb_info fb_info; static struct fb_info fb_info;
static struct display disp;
/* frame buffer operations */ /* frame buffer operations */
...@@ -120,9 +117,6 @@ static void dnfb_copyarea(struct fb_info *info, struct fb_copyarea *area); ...@@ -120,9 +117,6 @@ static void dnfb_copyarea(struct fb_info *info, struct fb_copyarea *area);
static struct fb_ops dn_fb_ops = { static struct fb_ops dn_fb_ops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.fb_set_var = gen_set_var,
.fb_get_cmap = gen_get_cmap,
.fb_set_cmap = gen_set_cmap,
.fb_blank = dnfb_blank, .fb_blank = dnfb_blank,
.fb_fillrect = cfb_fillrect, .fb_fillrect = cfb_fillrect,
.fb_copyarea = dnfb_copyarea, .fb_copyarea = dnfb_copyarea,
...@@ -239,22 +233,14 @@ unsigned long __init dnfb_init(unsigned long mem_start) ...@@ -239,22 +233,14 @@ unsigned long __init dnfb_init(unsigned long mem_start)
{ {
int err; int err;
strcpy(fb_info.modename, dnfb_fix.id);
fb_info.changevar = NULL;
fb_info.fontname[0] = 0; fb_info.fontname[0] = 0;
fb_info.disp = &disp;
fb_info.switch_con = gen_switch;
fb_info.updatevar = gen_update_var;
fb_info.node = NODEV; fb_info.node = NODEV;
fb_info.fbops = &dn_fb_ops; fb_info.fbops = &dn_fb_ops;
fb_info.currcon = -1;
fb_info.fix = dnfb_fix; fb_info.fix = dnfb_fix;
fb_info.var = dnfb_var; fb_info.var = dnfb_var;
fb_info.screen_base = (u_char *) fb_info.fix.smem_start;
fb_alloc_cmap(&fb_info.cmap, 2, 0); fb_alloc_cmap(&fb_info.cmap, 2, 0);
gen_set_disp(-1, &fb_info);
fb_info.screen_base = (u_char *) fb_info.fix.smem_start;
err = register_framebuffer(&fb_info); err = register_framebuffer(&fb_info);
if (err < 0) if (err < 0)
......
...@@ -181,62 +181,6 @@ void fb_copy_cmap(struct fb_cmap *from, struct fb_cmap *to, int fsfromto) ...@@ -181,62 +181,6 @@ void fb_copy_cmap(struct fb_cmap *from, struct fb_cmap *to, int fsfromto)
} }
} }
/**
* fb_get_cmap - get a colormap
* @cmap: frame buffer colormap
* @kspc: boolean, 0 copy local, 1 put_user() function
* @getcolreg: pointer to a function to get a color register
* @info: frame buffer info structure
*
* Get a colormap @cmap for a screen of device @info.
*
* Returns negative errno on error, or zero on success.
*
*/
int fb_get_cmap(struct fb_cmap *cmap, int kspc,
int (*getcolreg)(u_int, u_int *, u_int *, u_int *, u_int *,
struct fb_info *),
struct fb_info *info)
{
int i, start;
u16 *red, *green, *blue, *transp;
u_int hred, hgreen, hblue, htransp;
red = cmap->red;
green = cmap->green;
blue = cmap->blue;
transp = cmap->transp;
start = cmap->start;
if (start < 0)
return -EINVAL;
for (i = 0; i < cmap->len; i++) {
if (getcolreg(start++, &hred, &hgreen, &hblue, &htransp, info))
return 0;
if (kspc) {
*red = hred;
*green = hgreen;
*blue = hblue;
if (transp)
*transp = htransp;
} else {
put_user(hred, red);
put_user(hgreen, green);
put_user(hblue, blue);
if (transp)
put_user(htransp, transp);
}
red++;
green++;
blue++;
if (transp)
transp++;
}
return 0;
}
/** /**
* fb_set_cmap - set the colormap * fb_set_cmap - set the colormap
* @cmap: frame buffer colormap structure * @cmap: frame buffer colormap structure
...@@ -353,7 +297,6 @@ void fb_invert_cmaps(void) ...@@ -353,7 +297,6 @@ void fb_invert_cmaps(void)
EXPORT_SYMBOL(fb_alloc_cmap); EXPORT_SYMBOL(fb_alloc_cmap);
EXPORT_SYMBOL(fb_copy_cmap); EXPORT_SYMBOL(fb_copy_cmap);
EXPORT_SYMBOL(fb_get_cmap);
EXPORT_SYMBOL(fb_set_cmap); EXPORT_SYMBOL(fb_set_cmap);
EXPORT_SYMBOL(fb_default_cmap); EXPORT_SYMBOL(fb_default_cmap);
EXPORT_SYMBOL(fb_invert_cmaps); EXPORT_SYMBOL(fb_invert_cmaps);
/*
* linux/drivers/video/cfb16.c -- Low level frame buffer operations for 16 bpp
* truecolor packed pixels
*
* Created 5 Apr 1997 by Geert Uytterhoeven
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file COPYING in the main directory of this archive for
* more details.
*/
#include <linux/module.h>
#include <linux/tty.h>
#include <linux/console.h>
#include <linux/string.h>
#include <linux/fb.h>
#include <asm/io.h>
#include <video/fbcon.h>
#include <video/fbcon-cfb16.h>
/*
* 16 bpp packed pixels
*/
static u32 tab_cfb16[] = {
#if defined(__BIG_ENDIAN)
0x00000000, 0x0000ffff, 0xffff0000, 0xffffffff
#elif defined(__LITTLE_ENDIAN)
0x00000000, 0xffff0000, 0x0000ffff, 0xffffffff
#else
#error FIXME: No endianness??
#endif
};
void fbcon_cfb16_setup(struct display *p)
{
p->next_line = p->fb_info->fix.line_length ? p->fb_info->fix.line_length : p->var.xres_virtual<<1;
p->next_plane = 0;
}
void fbcon_cfb16_bmove(struct display *p, int sy, int sx, int dy, int dx,
int height, int width)
{
int bytes = p->next_line, linesize = bytes * fontheight(p), rows;
u8 *src, *dst;
if (sx == 0 && dx == 0 && width * fontwidth(p) * 2 == bytes) {
fb_memmove(p->fb_info->screen_base + dy * linesize,
p->fb_info->screen_base + sy * linesize,
height * linesize);
return;
}
if (fontwidthlog(p)) {
sx <<= fontwidthlog(p)+1;
dx <<= fontwidthlog(p)+1;
width <<= fontwidthlog(p)+1;
} else {
sx *= fontwidth(p)*2;
dx *= fontwidth(p)*2;
width *= fontwidth(p)*2;
}
if (dy < sy || (dy == sy && dx < sx)) {
src = p->fb_info->screen_base + sy * linesize + sx;
dst = p->fb_info->screen_base + dy * linesize + dx;
for (rows = height * fontheight(p); rows--;) {
fb_memmove(dst, src, width);
src += bytes;
dst += bytes;
}
} else {
src = p->fb_info->screen_base + (sy+height) * linesize + sx - bytes;
dst = p->fb_info->screen_base + (dy+height) * linesize + dx - bytes;
for (rows = height * fontheight(p); rows--;) {
fb_memmove(dst, src, width);
src -= bytes;
dst -= bytes;
}
}
}
static inline void rectfill(u8 *dest, int width, int height, u32 data,
int linesize)
{
int i;
data |= data<<16;
while (height-- > 0) {
u32 *p = (u32 *)dest;
for (i = 0; i < width/4; i++) {
fb_writel(data, p++);
fb_writel(data, p++);
}
if (width & 2)
fb_writel(data, p++);
if (width & 1)
fb_writew(data, (u16*)p);
dest += linesize;
}
}
void fbcon_cfb16_clear(struct vc_data *conp, struct display *p, int sy, int sx,
int height, int width)
{
u8 *dest;
int bytes = p->next_line, lines = height * fontheight(p);
u32 bgx;
dest = p->fb_info->screen_base + sy * fontheight(p) * bytes + sx * fontwidth(p) * 2;
bgx = ((u16 *)p->dispsw_data)[attr_bgcol_ec(p, conp)];
width *= fontwidth(p)/4;
if (width * 8 == bytes)
rectfill(dest, lines * width * 4, 1, bgx, bytes);
else
rectfill(dest, width * 4, lines, bgx, bytes);
}
void fbcon_cfb16_putc(struct vc_data *conp, struct display *p, int c, int yy,
int xx)
{
u8 *dest, *cdat, bits;
int bytes = p->next_line, rows;
u32 eorx, fgx, bgx;
dest = p->fb_info->screen_base + yy * fontheight(p) * bytes + xx * fontwidth(p) * 2;
fgx = ((u16 *)p->dispsw_data)[attr_fgcol(p, c)];
bgx = ((u16 *)p->dispsw_data)[attr_bgcol(p, c)];
fgx |= (fgx << 16);
bgx |= (bgx << 16);
eorx = fgx ^ bgx;
switch (fontwidth(p)) {
case 4:
case 8:
cdat = p->fontdata + (c & p->charmask) * fontheight(p);
for (rows = fontheight(p); rows--; dest += bytes) {
bits = *cdat++;
fb_writel((tab_cfb16[bits >> 6] & eorx) ^ bgx, dest);
fb_writel((tab_cfb16[bits >> 4 & 3] & eorx) ^ bgx, dest+4);
if (fontwidth(p) == 8) {
fb_writel((tab_cfb16[bits >> 2 & 3] & eorx) ^ bgx, dest+8);
fb_writel((tab_cfb16[bits & 3] & eorx) ^ bgx, dest+12);
}
}
break;
case 12:
case 16:
cdat = p->fontdata + ((c & p->charmask) * fontheight(p) << 1);
for (rows = fontheight(p); rows--; dest += bytes) {
bits = *cdat++;
fb_writel((tab_cfb16[bits >> 6] & eorx) ^ bgx, dest);
fb_writel((tab_cfb16[bits >> 4 & 3] & eorx) ^ bgx, dest+4);
fb_writel((tab_cfb16[bits >> 2 & 3] & eorx) ^ bgx, dest+8);
fb_writel((tab_cfb16[bits & 3] & eorx) ^ bgx, dest+12);
bits = *cdat++;
fb_writel((tab_cfb16[bits >> 6] & eorx) ^ bgx, dest+16);
fb_writel((tab_cfb16[bits >> 4 & 3] & eorx) ^ bgx, dest+20);
if (fontwidth(p) == 16) {
fb_writel((tab_cfb16[bits >> 2 & 3] & eorx) ^ bgx, dest+24);
fb_writel((tab_cfb16[bits & 3] & eorx) ^ bgx, dest+28);
}
}
break;
}
}
void fbcon_cfb16_putcs(struct vc_data *conp, struct display *p,
const unsigned short *s, int count, int yy, int xx)
{
u8 *cdat, *dest, *dest0;
u16 c;
int rows, bytes = p->next_line;
u32 eorx, fgx, bgx;
dest0 = p->fb_info->screen_base + yy * fontheight(p) * bytes + xx * fontwidth(p) * 2;
c = scr_readw(s);
fgx = ((u16 *)p->dispsw_data)[attr_fgcol(p, c)];
bgx = ((u16 *)p->dispsw_data)[attr_bgcol(p, c)];
fgx |= (fgx << 16);
bgx |= (bgx << 16);
eorx = fgx ^ bgx;
switch (fontwidth(p)) {
case 4:
case 8:
while (count--) {
c = scr_readw(s++) & p->charmask;
cdat = p->fontdata + c * fontheight(p);
for (rows = fontheight(p), dest = dest0; rows--; dest += bytes) {
u8 bits = *cdat++;
fb_writel((tab_cfb16[bits >> 6] & eorx) ^ bgx, dest);
fb_writel((tab_cfb16[bits >> 4 & 3] & eorx) ^ bgx, dest+4);
if (fontwidth(p) == 8) {
fb_writel((tab_cfb16[bits >> 2 & 3] & eorx) ^ bgx, dest+8);
fb_writel((tab_cfb16[bits & 3] & eorx) ^ bgx, dest+12);
}
}
dest0 += fontwidth(p)*2;;
}
break;
case 12:
case 16:
while (count--) {
c = scr_readw(s++) & p->charmask;
cdat = p->fontdata + (c * fontheight(p) << 1);
for (rows = fontheight(p), dest = dest0; rows--; dest += bytes) {
u8 bits = *cdat++;
fb_writel((tab_cfb16[bits >> 6] & eorx) ^ bgx, dest);
fb_writel((tab_cfb16[bits >> 4 & 3] & eorx) ^ bgx, dest+4);
fb_writel((tab_cfb16[bits >> 2 & 3] & eorx) ^ bgx, dest+8);
fb_writel((tab_cfb16[bits & 3] & eorx) ^ bgx, dest+12);
bits = *cdat++;
fb_writel((tab_cfb16[bits >> 6] & eorx) ^ bgx, dest+16);
fb_writel((tab_cfb16[bits >> 4 & 3] & eorx) ^ bgx, dest+20);
if (fontwidth(p) == 16) {
fb_writel((tab_cfb16[bits >> 2 & 3] & eorx) ^ bgx, dest+24);
fb_writel((tab_cfb16[bits & 3] & eorx) ^ bgx, dest+28);
}
}
dest0 += fontwidth(p)*2;
}
break;
}
}
void fbcon_cfb16_revc(struct display *p, int xx, int yy)
{
u8 *dest;
int bytes = p->next_line, rows;
dest = p->fb_info->screen_base + yy * fontheight(p) * bytes + xx * fontwidth(p)*2;
for (rows = fontheight(p); rows--; dest += bytes) {
switch (fontwidth(p)) {
case 16:
fb_writel(fb_readl(dest+24) ^ 0xffffffff, dest+24);
fb_writel(fb_readl(dest+28) ^ 0xffffffff, dest+28);
/* FALL THROUGH */
case 12:
fb_writel(fb_readl(dest+16) ^ 0xffffffff, dest+16);
fb_writel(fb_readl(dest+20) ^ 0xffffffff, dest+20);
/* FALL THROUGH */
case 8:
fb_writel(fb_readl(dest+8) ^ 0xffffffff, dest+8);
fb_writel(fb_readl(dest+12) ^ 0xffffffff, dest+12);
/* FALL THROUGH */
case 4:
fb_writel(fb_readl(dest+0) ^ 0xffffffff, dest+0);
fb_writel(fb_readl(dest+4) ^ 0xffffffff, dest+4);
}
}
}
void fbcon_cfb16_clear_margins(struct vc_data *conp, struct display *p,
int bottom_only)
{
int bytes = p->next_line;
u32 bgx;
unsigned int right_start = conp->vc_cols*fontwidth(p);
unsigned int bottom_start = conp->vc_rows*fontheight(p);
unsigned int right_width, bottom_width;
bgx = ((u16 *)p->dispsw_data)[attr_bgcol_ec(p, conp)];
if (!bottom_only && (right_width = p->var.xres-right_start))
rectfill(p->fb_info->screen_base+right_start*2, right_width,
p->var.yres_virtual, bgx, bytes);
if ((bottom_width = p->var.yres-bottom_start))
rectfill(p->fb_info->screen_base+(p->var.yoffset+bottom_start)*bytes,
right_start, bottom_width, bgx, bytes);
}
/*
* `switch' for the low level operations
*/
struct display_switch fbcon_cfb16 = {
setup: fbcon_cfb16_setup,
bmove: fbcon_cfb16_bmove,
clear: fbcon_cfb16_clear,
putc: fbcon_cfb16_putc,
putcs: fbcon_cfb16_putcs,
revc: fbcon_cfb16_revc,
clear_margins: fbcon_cfb16_clear_margins,
fontwidthmask: FONTWIDTH(4)|FONTWIDTH(8)|FONTWIDTH(12)|FONTWIDTH(16)
};
#ifdef MODULE
MODULE_LICENSE("GPL");
int init_module(void)
{
return 0;
}
void cleanup_module(void)
{}
#endif /* MODULE */
/*
* Visible symbols for modules
*/
EXPORT_SYMBOL(fbcon_cfb16);
EXPORT_SYMBOL(fbcon_cfb16_setup);
EXPORT_SYMBOL(fbcon_cfb16_bmove);
EXPORT_SYMBOL(fbcon_cfb16_clear);
EXPORT_SYMBOL(fbcon_cfb16_putc);
EXPORT_SYMBOL(fbcon_cfb16_putcs);
EXPORT_SYMBOL(fbcon_cfb16_revc);
EXPORT_SYMBOL(fbcon_cfb16_clear_margins);
/*
* linux/drivers/video/cfb2.c -- Low level frame buffer operations for 2 bpp
* packed pixels
*
* Created 26 Dec 1997 by Michael Schmitz
* Based on cfb4.c
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file COPYING in the main directory of this archive for
* more details.
*/
#include <linux/module.h>
#include <linux/tty.h>
#include <linux/console.h>
#include <linux/string.h>
#include <linux/fb.h>
#include <video/fbcon.h>
#include <video/fbcon-cfb2.h>
/*
* 2 bpp packed pixels
*/
/*
* IFF the font is even pixel aligned (that is to say each
* character start is a byte start in the pixel pairs). That
* avoids us having to mask bytes and means we won't be here
* all week. On a MacII that matters _lots_
*/
static u_char nibbletab_cfb2[]={
#if defined(__BIG_ENDIAN)
0x00,0x03,0x0c,0x0f,
0x30,0x33,0x3c,0x3f,
0xc0,0xc3,0xcc,0xcf,
0xf0,0xf3,0xfc,0xff
#elif defined(__LITTLE_ENDIAN)
0x00,0xc0,0x30,0xf0,
0x0c,0xcc,0x3c,0xfc,
0x03,0xc3,0x33,0xf3,
0x0f,0xcf,0x3f,0xff
#else
#error FIXME: No endianness??
#endif
};
void fbcon_cfb2_setup(struct display *p)
{
p->next_line = p->fb_info->fix.line_length ? p->fb_info->fix.line_length : p->var.xres_virtual>>2;
p->next_plane = 0;
}
void fbcon_cfb2_bmove(struct display *p, int sy, int sx, int dy, int dx,
int height, int width)
{
int bytes = p->next_line, linesize = bytes * fontheight(p), rows;
u8 *src,*dst;
if (sx == 0 && dx == 0 && width * 2 == bytes) {
fb_memmove(p->fb_info->screen_base + dy * linesize,
p->fb_info->screen_base + sy * linesize,
height * linesize);
}
else {
if (dy < sy || (dy == sy && dx < sx)) {
src = p->fb_info->screen_base + sy * linesize + sx * 2;
dst = p->fb_info->screen_base + dy * linesize + dx * 2;
for (rows = height * fontheight(p) ; rows-- ;) {
fb_memmove(dst, src, width * 2);
src += bytes;
dst += bytes;
}
}
else {
src = p->fb_info->screen_base + (sy+height) * linesize + sx * 2 - bytes;
dst = p->fb_info->screen_base + (dy+height) * linesize + dx * 2 - bytes;
for (rows = height * fontheight(p) ; rows-- ;) {
fb_memmove(dst, src, width * 2);
src -= bytes;
dst -= bytes;
}
}
}
}
void fbcon_cfb2_clear(struct vc_data *conp, struct display *p, int sy, int sx,
int height, int width)
{
u8 *dest0,*dest;
int bytes=p->next_line,lines=height * fontheight(p), rows, i;
u32 bgx;
dest = p->fb_info->screen_base + sy * fontheight(p) * bytes + sx * 2;
bgx=attr_bgcol_ec(p,conp);
bgx |= (bgx << 2); /* expand the colour to 16 bits */
bgx |= (bgx << 4);
bgx |= (bgx << 8);
if (sx == 0 && width * 2 == bytes) {
for (i = 0 ; i < lines * width ; i++) {
fb_writew (bgx, dest);
dest+=2;
}
} else {
dest0=dest;
for (rows = lines; rows-- ; dest0 += bytes) {
dest=dest0;
for (i = 0 ; i < width ; i++) {
/* memset ?? */
fb_writew (bgx, dest);
dest+=2;
}
}
}
}
void fbcon_cfb2_putc(struct vc_data *conp, struct display *p, int c, int yy,
int xx)
{
u8 *dest,*cdat;
int bytes=p->next_line,rows;
u32 eorx,fgx,bgx;
dest = p->fb_info->screen_base + yy * fontheight(p) * bytes + xx * 2;
cdat = p->fontdata + (c & p->charmask) * fontheight(p);
fgx=3;/*attr_fgcol(p,c);*/
bgx=attr_bgcol(p,c);
fgx |= (fgx << 2); /* expand color to 8 bits */
fgx |= (fgx << 4);
bgx |= (bgx << 2);
bgx |= (bgx << 4);
eorx = fgx ^ bgx;
for (rows = fontheight(p) ; rows-- ; dest += bytes) {
fb_writeb((nibbletab_cfb2[*cdat >> 4] & eorx) ^ bgx, dest+0);
fb_writeb((nibbletab_cfb2[*cdat++ & 0xf] & eorx) ^ bgx, dest+1);
}
}
void fbcon_cfb2_putcs(struct vc_data *conp, struct display *p, const unsigned short *s,
int count, int yy, int xx)
{
u8 *cdat, *dest, *dest0;
u16 c;
int rows,bytes=p->next_line;
u32 eorx, fgx, bgx;
dest0 = p->fb_info->screen_base + yy * fontheight(p) * bytes + xx * 2;
c = scr_readw(s);
fgx = 3/*attr_fgcol(p, c)*/;
bgx = attr_bgcol(p, c);
fgx |= (fgx << 2);
fgx |= (fgx << 4);
bgx |= (bgx << 2);
bgx |= (bgx << 4);
eorx = fgx ^ bgx;
while (count--) {
c = scr_readw(s++) & p->charmask;
cdat = p->fontdata + c * fontheight(p);
for (rows = fontheight(p), dest = dest0; rows-- ; dest += bytes) {
fb_writeb((nibbletab_cfb2[*cdat >> 4] & eorx) ^ bgx, dest+0);
fb_writeb((nibbletab_cfb2[*cdat++ & 0xf] & eorx) ^ bgx, dest+1);
}
dest0+=2;
}
}
void fbcon_cfb2_revc(struct display *p, int xx, int yy)
{
u8 *dest;
int bytes=p->next_line, rows;
dest = p->fb_info->screen_base + yy * fontheight(p) * bytes + xx * 2;
for (rows = fontheight(p) ; rows-- ; dest += bytes) {
fb_writew(fb_readw(dest) ^ 0xffff, dest);
}
}
/*
* `switch' for the low level operations
*/
struct display_switch fbcon_cfb2 = {
setup: fbcon_cfb2_setup,
bmove: fbcon_cfb2_bmove,
clear: fbcon_cfb2_clear,
putc: fbcon_cfb2_putc,
putcs: fbcon_cfb2_putcs,
revc: fbcon_cfb2_revc,
fontwidthmask: FONTWIDTH(8)
};
#ifdef MODULE
MODULE_LICENSE("GPL");
int init_module(void)
{
return 0;
}
void cleanup_module(void)
{}
#endif /* MODULE */
/*
* Visible symbols for modules
*/
EXPORT_SYMBOL(fbcon_cfb2);
EXPORT_SYMBOL(fbcon_cfb2_setup);
EXPORT_SYMBOL(fbcon_cfb2_bmove);
EXPORT_SYMBOL(fbcon_cfb2_clear);
EXPORT_SYMBOL(fbcon_cfb2_putc);
EXPORT_SYMBOL(fbcon_cfb2_putcs);
EXPORT_SYMBOL(fbcon_cfb2_revc);
/*
* linux/drivers/video/cfb24.c -- Low level frame buffer operations for 24 bpp
* truecolor packed pixels
*
* Created 7 Mar 1998 by Geert Uytterhoeven
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file COPYING in the main directory of this archive for
* more details.
*/
#include <linux/module.h>
#include <linux/tty.h>
#include <linux/console.h>
#include <linux/string.h>
#include <linux/fb.h>
#include <video/fbcon.h>
#include <video/fbcon-cfb24.h>
/*
* 24 bpp packed pixels
*/
void fbcon_cfb24_setup(struct display *p)
{
struct fb_info *info = p->fb_info;
p->next_line = info->fix.line_length ? info->fix.line_length : p->var.xres_virtual*3;
p->next_plane = 0;
}
void fbcon_cfb24_bmove(struct display *p, int sy, int sx, int dy, int dx,
int height, int width)
{
int bytes = p->next_line, linesize = bytes * fontheight(p), rows;
u8 *src, *dst;
if (sx == 0 && dx == 0 && width * fontwidth(p) * 3 == bytes) {
fb_memmove(p->fb_info->screen_base + dy * linesize,
p->fb_info->screen_base + sy * linesize,
height * linesize);
return;
}
if (fontwidthlog(p)) {
sx <<= fontwidthlog(p);
dx <<= fontwidthlog(p);
width <<= fontwidthlog(p);
} else {
sx *= fontwidth(p);
dx *= fontwidth(p);
width *= fontwidth(p);
}
sx *= 3; dx *= 3; width *= 3;
if (dy < sy || (dy == sy && dx < sx)) {
src = p->fb_info->screen_base + sy * linesize + sx;
dst = p->fb_info->screen_base + dy * linesize + dx;
for (rows = height * fontheight(p); rows--;) {
fb_memmove(dst, src, width);
src += bytes;
dst += bytes;
}
} else {
src = p->fb_info->screen_base + (sy+height) * linesize + sx - bytes;
dst = p->fb_info->screen_base + (dy+height) * linesize + dx - bytes;
for (rows = height * fontheight(p); rows--;) {
fb_memmove(dst, src, width);
src -= bytes;
dst -= bytes;
}
}
}
#if defined(__BIG_ENDIAN)
#define convert4to3(in1, in2, in3, in4, out1, out2, out3) \
do { \
out1 = (in1<<8) | (in2>>16); \
out2 = (in2<<16) | (in3>>8); \
out3 = (in3<<24) | in4; \
} while (0);
#elif defined(__LITTLE_ENDIAN)
#define convert4to3(in1, in2, in3, in4, out1, out2, out3) \
do { \
out1 = in1 | (in2<<24); \
out2 = (in2>> 8) | (in3<<16); \
out3 = (in3>>16) | (in4<< 8); \
} while (0);
#else
#error FIXME: No endianness??
#endif
static inline void store4pixels(u32 d1, u32 d2, u32 d3, u32 d4, u32 *dest)
{
u32 o1, o2, o3;
convert4to3(d1, d2, d3, d4, o1, o2, o3);
fb_writel (o1, dest++);
fb_writel (o2, dest++);
fb_writel (o3, dest);
}
static inline void rectfill(u8 *dest, int width, int height, u32 data,
int linesize)
{
u32 d1, d2, d3;
int i;
convert4to3(data, data, data, data, d1, d2, d3);
while (height-- > 0) {
u32 *p = (u32 *)dest;
for (i = 0; i < width/4; i++) {
fb_writel(d1, p++);
fb_writel(d2, p++);
fb_writel(d3, p++);
}
dest += linesize;
}
}
void fbcon_cfb24_clear(struct vc_data *conp, struct display *p, int sy, int sx,
int height, int width)
{
u8 *dest;
int bytes = p->next_line, lines = height * fontheight(p);
u32 bgx;
dest = p->fb_info->screen_base + sy * fontheight(p) * bytes + sx * fontwidth(p) * 3;
bgx = ((u32 *)p->dispsw_data)[attr_bgcol_ec(p, conp)];
width *= fontwidth(p)/4;
if (width * 12 == bytes)
rectfill(dest, lines * width * 4, 1, bgx, bytes);
else
rectfill(dest, width * 4, lines, bgx, bytes);
}
void fbcon_cfb24_putc(struct vc_data *conp, struct display *p, int c, int yy,
int xx)
{
u8 *dest, *cdat, bits;
int bytes = p->next_line, rows;
u32 eorx, fgx, bgx, d1, d2, d3, d4;
dest = p->fb_info->screen_base + yy * fontheight(p) * bytes + xx * fontwidth(p) * 3;
if (fontwidth(p) <= 8)
cdat = p->fontdata + (c & p->charmask) * fontheight(p);
else
cdat = p->fontdata + ((c & p->charmask) * fontheight(p) << 1);
fgx = ((u32 *)p->dispsw_data)[attr_fgcol(p, c)];
bgx = ((u32 *)p->dispsw_data)[attr_bgcol(p, c)];
eorx = fgx ^ bgx;
for (rows = fontheight(p); rows--; dest += bytes) {
bits = *cdat++;
d1 = (-(bits >> 7) & eorx) ^ bgx;
d2 = (-(bits >> 6 & 1) & eorx) ^ bgx;
d3 = (-(bits >> 5 & 1) & eorx) ^ bgx;
d4 = (-(bits >> 4 & 1) & eorx) ^ bgx;
store4pixels(d1, d2, d3, d4, (u32 *)dest);
if (fontwidth(p) < 8)
continue;
d1 = (-(bits >> 3 & 1) & eorx) ^ bgx;
d2 = (-(bits >> 2 & 1) & eorx) ^ bgx;
d3 = (-(bits >> 1 & 1) & eorx) ^ bgx;
d4 = (-(bits & 1) & eorx) ^ bgx;
store4pixels(d1, d2, d3, d4, (u32 *)(dest+12));
if (fontwidth(p) < 12)
continue;
bits = *cdat++;
d1 = (-(bits >> 7) & eorx) ^ bgx;
d2 = (-(bits >> 6 & 1) & eorx) ^ bgx;
d3 = (-(bits >> 5 & 1) & eorx) ^ bgx;
d4 = (-(bits >> 4 & 1) & eorx) ^ bgx;
store4pixels(d1, d2, d3, d4, (u32 *)(dest+24));
if (fontwidth(p) < 16)
continue;
d1 = (-(bits >> 3 & 1) & eorx) ^ bgx;
d2 = (-(bits >> 2 & 1) & eorx) ^ bgx;
d3 = (-(bits >> 1 & 1) & eorx) ^ bgx;
d4 = (-(bits & 1) & eorx) ^ bgx;
store4pixels(d1, d2, d3, d4, (u32 *)(dest+36));
}
}
void fbcon_cfb24_putcs(struct vc_data *conp, struct display *p,
const unsigned short *s, int count, int yy, int xx)
{
u8 *cdat, *dest, *dest0, bits;
u16 c;
int rows, bytes = p->next_line;
u32 eorx, fgx, bgx, d1, d2, d3, d4;
dest0 = p->fb_info->screen_base + yy * fontheight(p) * bytes + xx * fontwidth(p) * 3;
c = scr_readw(s);
fgx = ((u32 *)p->dispsw_data)[attr_fgcol(p, c)];
bgx = ((u32 *)p->dispsw_data)[attr_bgcol(p, c)];
eorx = fgx ^ bgx;
while (count--) {
c = scr_readw(s++) & p->charmask;
if (fontwidth(p) <= 8)
cdat = p->fontdata + c * fontheight(p);
else
cdat = p->fontdata + (c * fontheight(p) << 1);
for (rows = fontheight(p), dest = dest0; rows--; dest += bytes) {
bits = *cdat++;
d1 = (-(bits >> 7) & eorx) ^ bgx;
d2 = (-(bits >> 6 & 1) & eorx) ^ bgx;
d3 = (-(bits >> 5 & 1) & eorx) ^ bgx;
d4 = (-(bits >> 4 & 1) & eorx) ^ bgx;
store4pixels(d1, d2, d3, d4, (u32 *)dest);
if (fontwidth(p) < 8)
continue;
d1 = (-(bits >> 3 & 1) & eorx) ^ bgx;
d2 = (-(bits >> 2 & 1) & eorx) ^ bgx;
d3 = (-(bits >> 1 & 1) & eorx) ^ bgx;
d4 = (-(bits & 1) & eorx) ^ bgx;
store4pixels(d1, d2, d3, d4, (u32 *)(dest+12));
if (fontwidth(p) < 12)
continue;
bits = *cdat++;
d1 = (-(bits >> 7) & eorx) ^ bgx;
d2 = (-(bits >> 6 & 1) & eorx) ^ bgx;
d3 = (-(bits >> 5 & 1) & eorx) ^ bgx;
d4 = (-(bits >> 4 & 1) & eorx) ^ bgx;
store4pixels(d1, d2, d3, d4, (u32 *)(dest+24));
if (fontwidth(p) < 16)
continue;
d1 = (-(bits >> 3 & 1) & eorx) ^ bgx;
d2 = (-(bits >> 2 & 1) & eorx) ^ bgx;
d3 = (-(bits >> 1 & 1) & eorx) ^ bgx;
d4 = (-(bits & 1) & eorx) ^ bgx;
store4pixels(d1, d2, d3, d4, (u32 *)(dest+36));
}
dest0 += fontwidth(p)*3;
}
}
void fbcon_cfb24_revc(struct display *p, int xx, int yy)
{
u8 *dest;
int bytes = p->next_line, rows;
dest = p->fb_info->screen_base + yy * fontheight(p) * bytes + xx * fontwidth(p) * 3;
for (rows = fontheight(p); rows--; dest += bytes) {
switch (fontwidth(p)) {
case 16:
fb_writel(fb_readl(dest+36) ^ 0xffffffff, dest+36);
fb_writel(fb_readl(dest+40) ^ 0xffffffff, dest+40);
fb_writel(fb_readl(dest+44) ^ 0xffffffff, dest+44);
/* FALL THROUGH */
case 12:
fb_writel(fb_readl(dest+24) ^ 0xffffffff, dest+24);
fb_writel(fb_readl(dest+28) ^ 0xffffffff, dest+28);
fb_writel(fb_readl(dest+32) ^ 0xffffffff, dest+32);
/* FALL THROUGH */
case 8:
fb_writel(fb_readl(dest+12) ^ 0xffffffff, dest+12);
fb_writel(fb_readl(dest+16) ^ 0xffffffff, dest+16);
fb_writel(fb_readl(dest+20) ^ 0xffffffff, dest+20);
/* FALL THROUGH */
case 4:
fb_writel(fb_readl(dest+0) ^ 0xffffffff, dest+0);
fb_writel(fb_readl(dest+4) ^ 0xffffffff, dest+4);
fb_writel(fb_readl(dest+8) ^ 0xffffffff, dest+8);
}
}
}
void fbcon_cfb24_clear_margins(struct vc_data *conp, struct display *p,
int bottom_only)
{
int bytes = p->next_line;
u32 bgx;
unsigned int right_start = conp->vc_cols*fontwidth(p);
unsigned int bottom_start = conp->vc_rows*fontheight(p);
unsigned int right_width, bottom_width;
bgx = ((u32 *)p->dispsw_data)[attr_bgcol_ec(p, conp)];
if (!bottom_only && (right_width = p->var.xres-right_start))
rectfill(p->fb_info->screen_base+right_start*3, right_width,
p->var.yres_virtual, bgx, bytes);
if ((bottom_width = p->var.yres-bottom_start))
rectfill(p->fb_info->screen_base+(p->var.yoffset+bottom_start)*bytes,
right_start, bottom_width, bgx, bytes);
}
/*
* `switch' for the low level operations
*/
struct display_switch fbcon_cfb24 = {
setup: fbcon_cfb24_setup,
bmove: fbcon_cfb24_bmove,
clear: fbcon_cfb24_clear,
putc: fbcon_cfb24_putc,
putcs: fbcon_cfb24_putcs,
revc: fbcon_cfb24_revc,
clear_margins: fbcon_cfb24_clear_margins,
fontwidthmask: FONTWIDTH(4)|FONTWIDTH(8)|FONTWIDTH(12)|FONTWIDTH(16)
};
#ifdef MODULE
MODULE_LICENSE("GPL");
int init_module(void)
{
return 0;
}
void cleanup_module(void)
{}
#endif /* MODULE */
/*
* Visible symbols for modules
*/
EXPORT_SYMBOL(fbcon_cfb24);
EXPORT_SYMBOL(fbcon_cfb24_setup);
EXPORT_SYMBOL(fbcon_cfb24_bmove);
EXPORT_SYMBOL(fbcon_cfb24_clear);
EXPORT_SYMBOL(fbcon_cfb24_putc);
EXPORT_SYMBOL(fbcon_cfb24_putcs);
EXPORT_SYMBOL(fbcon_cfb24_revc);
EXPORT_SYMBOL(fbcon_cfb24_clear_margins);
/*
* linux/drivers/video/cfb32.c -- Low level frame buffer operations for 32 bpp
* truecolor packed pixels
*
* Created 28 Dec 1997 by Geert Uytterhoeven
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file COPYING in the main directory of this archive for
* more details.
*/
#include <linux/module.h>
#include <linux/tty.h>
#include <linux/console.h>
#include <linux/string.h>
#include <linux/fb.h>
#include <video/fbcon.h>
#include <video/fbcon-cfb32.h>
/*
* 32 bpp packed pixels
*/
void fbcon_cfb32_setup(struct display *p)
{
p->next_line = p->fb_info->fix.line_length ? p->fb_info->fix.line_length : p->var.xres_virtual<<2;
p->next_plane = 0;
}
void fbcon_cfb32_bmove(struct display *p, int sy, int sx, int dy, int dx,
int height, int width)
{
int bytes = p->next_line, linesize = bytes * fontheight(p), rows;
u8 *src, *dst;
if (sx == 0 && dx == 0 && width * fontwidth(p) * 4 == bytes) {
fb_memmove(p->fb_info->screen_base + dy * linesize,
p->fb_info->screen_base + sy * linesize,
height * linesize);
return;
}
if (fontwidthlog(p)) {
sx <<= fontwidthlog(p)+2;
dx <<= fontwidthlog(p)+2;
width <<= fontwidthlog(p)+2;
} else {
sx *= fontwidth(p)*4;
dx *= fontwidth(p)*4;
width *= fontwidth(p)*4;
}
if (dy < sy || (dy == sy && dx < sx)) {
src = p->fb_info->screen_base + sy * linesize + sx;
dst = p->fb_info->screen_base + dy * linesize + dx;
for (rows = height * fontheight(p); rows--;) {
fb_memmove(dst, src, width);
src += bytes;
dst += bytes;
}
} else {
src = p->fb_info->screen_base + (sy+height) * linesize + sx - bytes;
dst = p->fb_info->screen_base + (dy+height) * linesize + dx - bytes;
for (rows = height * fontheight(p); rows--;) {
fb_memmove(dst, src, width);
src -= bytes;
dst -= bytes;
}
}
}
static inline void rectfill(u8 *dest, int width, int height, u32 data,
int linesize)
{
int i;
while (height-- > 0) {
u32 *p = (u32 *)dest;
for (i = 0; i < width/4; i++) {
fb_writel(data, p++);
fb_writel(data, p++);
fb_writel(data, p++);
fb_writel(data, p++);
}
if (width & 2) {
fb_writel(data, p++);
fb_writel(data, p++);
}
if (width & 1)
fb_writel(data, p++);
dest += linesize;
}
}
void fbcon_cfb32_clear(struct vc_data *conp, struct display *p, int sy, int sx,
int height, int width)
{
u8 *dest;
int bytes = p->next_line, lines = height * fontheight(p);
u32 bgx;
dest = p->fb_info->screen_base + sy * fontheight(p) * bytes + sx * fontwidth(p) * 4;
bgx = ((u32 *)p->dispsw_data)[attr_bgcol_ec(p, conp)];
width *= fontwidth(p)/4;
if (width * 16 == bytes)
rectfill(dest, lines * width * 4, 1, bgx, bytes);
else
rectfill(dest, width * 4, lines, bgx, bytes);
}
void fbcon_cfb32_putc(struct vc_data *conp, struct display *p, int c, int yy,
int xx)
{
u8 *dest, *cdat, bits;
int bytes = p->next_line, rows;
u32 eorx, fgx, bgx, *pt;
dest = p->fb_info->screen_base + yy * fontheight(p) * bytes + xx * fontwidth(p) * 4;
if (fontwidth(p) <= 8)
cdat = p->fontdata + (c & p->charmask) * fontheight(p);
else
cdat = p->fontdata + ((c & p->charmask) * fontheight(p) << 1);
fgx = ((u32 *)p->dispsw_data)[attr_fgcol(p, c)];
bgx = ((u32 *)p->dispsw_data)[attr_bgcol(p, c)];
eorx = fgx ^ bgx;
for (rows = fontheight(p); rows--; dest += bytes) {
bits = *cdat++;
pt = (u32 *) dest;
fb_writel((-(bits >> 7) & eorx) ^ bgx, pt++);
fb_writel((-(bits >> 6 & 1) & eorx) ^ bgx, pt++);
fb_writel((-(bits >> 5 & 1) & eorx) ^ bgx, pt++);
fb_writel((-(bits >> 4 & 1) & eorx) ^ bgx, pt++);
if (fontwidth(p) < 8)
continue;
fb_writel((-(bits >> 3 & 1) & eorx) ^ bgx, pt++);
fb_writel((-(bits >> 2 & 1) & eorx) ^ bgx, pt++);
fb_writel((-(bits >> 1 & 1) & eorx) ^ bgx, pt++);
fb_writel((-(bits & 1) & eorx) ^ bgx, pt++);
if (fontwidth(p) < 12)
continue;
bits = *cdat++;
fb_writel((-(bits >> 7) & eorx) ^ bgx, pt++);
fb_writel((-(bits >> 6 & 1) & eorx) ^ bgx, pt++);
fb_writel((-(bits >> 5 & 1) & eorx) ^ bgx, pt++);
fb_writel((-(bits >> 4 & 1) & eorx) ^ bgx, pt++);
if (fontwidth(p) < 16)
continue;
fb_writel((-(bits >> 3 & 1) & eorx) ^ bgx, pt++);
fb_writel((-(bits >> 2 & 1) & eorx) ^ bgx, pt++);
fb_writel((-(bits >> 1 & 1) & eorx) ^ bgx, pt++);
fb_writel((-(bits & 1) & eorx) ^ bgx, pt++);
}
}
void fbcon_cfb32_putcs(struct vc_data *conp, struct display *p,
const unsigned short *s, int count, int yy, int xx)
{
u8 *cdat, *dest, *dest0, bits;
u16 c;
int rows, bytes = p->next_line;
u32 eorx, fgx, bgx, *pt;
dest0 = p->fb_info->screen_base + yy * fontheight(p) * bytes + xx * fontwidth(p) * 4;
c = scr_readw(s);
fgx = ((u32 *)p->dispsw_data)[attr_fgcol(p, c)];
bgx = ((u32 *)p->dispsw_data)[attr_bgcol(p, c)];
eorx = fgx ^ bgx;
while (count--) {
c = scr_readw(s++) & p->charmask;
if (fontwidth(p) <= 8)
cdat = p->fontdata + c * fontheight(p);
else
cdat = p->fontdata + (c * fontheight(p) << 1);
for (rows = fontheight(p), dest = dest0; rows--; dest += bytes) {
bits = *cdat++;
pt = (u32 *) dest;
fb_writel((-(bits >> 7) & eorx) ^ bgx, pt++);
fb_writel((-(bits >> 6 & 1) & eorx) ^ bgx, pt++);
fb_writel((-(bits >> 5 & 1) & eorx) ^ bgx, pt++);
fb_writel((-(bits >> 4 & 1) & eorx) ^ bgx, pt++);
if (fontwidth(p) < 8)
continue;
fb_writel((-(bits >> 3 & 1) & eorx) ^ bgx, pt++);
fb_writel((-(bits >> 2 & 1) & eorx) ^ bgx, pt++);
fb_writel((-(bits >> 1 & 1) & eorx) ^ bgx, pt++);
fb_writel((-(bits & 1) & eorx) ^ bgx, pt++);
if (fontwidth(p) < 12)
continue;
bits = *cdat++;
fb_writel((-(bits >> 7) & eorx) ^ bgx, pt++);
fb_writel((-(bits >> 6 & 1) & eorx) ^ bgx, pt++);
fb_writel((-(bits >> 5 & 1) & eorx) ^ bgx, pt++);
fb_writel((-(bits >> 4 & 1) & eorx) ^ bgx, pt++);
if (fontwidth(p) < 16)
continue;
fb_writel((-(bits >> 3 & 1) & eorx) ^ bgx, pt++);
fb_writel((-(bits >> 2 & 1) & eorx) ^ bgx, pt++);
fb_writel((-(bits >> 1 & 1) & eorx) ^ bgx, pt++);
fb_writel((-(bits & 1) & eorx) ^ bgx, pt++);
}
dest0 += fontwidth(p)*4;
}
}
void fbcon_cfb32_revc(struct display *p, int xx, int yy)
{
u8 *dest;
int bytes = p->next_line, rows;
dest = p->fb_info->screen_base + yy * fontheight(p) * bytes + xx * fontwidth(p) * 4;
for (rows = fontheight(p); rows--; dest += bytes) {
switch (fontwidth(p)) {
case 16:
fb_writel(fb_readl(dest+(4*12)) ^ 0xffffffff, dest+(4*12));
fb_writel(fb_readl(dest+(4*13)) ^ 0xffffffff, dest+(4*13));
fb_writel(fb_readl(dest+(4*14)) ^ 0xffffffff, dest+(4*14));
fb_writel(fb_readl(dest+(4*15)) ^ 0xffffffff, dest+(4*15));
/* FALL THROUGH */
case 12:
fb_writel(fb_readl(dest+(4*8)) ^ 0xffffffff, dest+(4*8));
fb_writel(fb_readl(dest+(4*9)) ^ 0xffffffff, dest+(4*9));
fb_writel(fb_readl(dest+(4*10)) ^ 0xffffffff, dest+(4*10));
fb_writel(fb_readl(dest+(4*11)) ^ 0xffffffff, dest+(4*11));
/* FALL THROUGH */
case 8:
fb_writel(fb_readl(dest+(4*4)) ^ 0xffffffff, dest+(4*4));
fb_writel(fb_readl(dest+(4*5)) ^ 0xffffffff, dest+(4*5));
fb_writel(fb_readl(dest+(4*6)) ^ 0xffffffff, dest+(4*6));
fb_writel(fb_readl(dest+(4*7)) ^ 0xffffffff, dest+(4*7));
/* FALL THROUGH */
case 4:
fb_writel(fb_readl(dest+(4*0)) ^ 0xffffffff, dest+(4*0));
fb_writel(fb_readl(dest+(4*1)) ^ 0xffffffff, dest+(4*1));
fb_writel(fb_readl(dest+(4*2)) ^ 0xffffffff, dest+(4*2));
fb_writel(fb_readl(dest+(4*3)) ^ 0xffffffff, dest+(4*3));
/* FALL THROUGH */
}
}
}
void fbcon_cfb32_clear_margins(struct vc_data *conp, struct display *p,
int bottom_only)
{
int bytes = p->next_line;
u32 bgx;
unsigned int right_start = conp->vc_cols*fontwidth(p);
unsigned int bottom_start = conp->vc_rows*fontheight(p);
unsigned int right_width, bottom_width;
bgx = ((u32 *)p->dispsw_data)[attr_bgcol_ec(p, conp)];
if (!bottom_only && (right_width = p->var.xres-right_start))
rectfill(p->fb_info->screen_base+right_start*4, right_width,
p->var.yres_virtual, bgx, bytes);
if ((bottom_width = p->var.yres-bottom_start))
rectfill(p->fb_info->screen_base+(p->var.yoffset+bottom_start)*bytes,
right_start, bottom_width, bgx, bytes);
}
/*
* `switch' for the low level operations
*/
struct display_switch fbcon_cfb32 = {
setup: fbcon_cfb32_setup,
bmove: fbcon_cfb32_bmove,
clear: fbcon_cfb32_clear,
putc: fbcon_cfb32_putc,
putcs: fbcon_cfb32_putcs,
revc: fbcon_cfb32_revc,
clear_margins: fbcon_cfb32_clear_margins,
fontwidthmask: FONTWIDTH(4)|FONTWIDTH(8)|FONTWIDTH(12)|FONTWIDTH(16)
};
#ifdef MODULE
MODULE_LICENSE("GPL");
int init_module(void)
{
return 0;
}
void cleanup_module(void)
{}
#endif /* MODULE */
/*
* Visible symbols for modules
*/
EXPORT_SYMBOL(fbcon_cfb32);
EXPORT_SYMBOL(fbcon_cfb32_setup);
EXPORT_SYMBOL(fbcon_cfb32_bmove);
EXPORT_SYMBOL(fbcon_cfb32_clear);
EXPORT_SYMBOL(fbcon_cfb32_putc);
EXPORT_SYMBOL(fbcon_cfb32_putcs);
EXPORT_SYMBOL(fbcon_cfb32_revc);
EXPORT_SYMBOL(fbcon_cfb32_clear_margins);
/*
* linux/drivers/video/cfb4.c -- Low level frame buffer operations for 4 bpp
* packed pixels
*
* Created 26 Dec 1997 by Michael Schmitz
* Based on the old macfb.c 4bpp code by Alan Cox
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file COPYING in the main directory of this archive for
* more details.
*/
#include <linux/module.h>
#include <linux/tty.h>
#include <linux/console.h>
#include <linux/string.h>
#include <linux/fb.h>
#include <video/fbcon.h>
#include <video/fbcon-cfb4.h>
/*
* 4 bpp packed pixels
*/
/*
* IFF the font is even pixel aligned (that is to say each
* character start is a byte start in the pixel pairs). That
* avoids us having to mask bytes and means we won't be here
* all week. On a MacII that matters _lots_
*/
static u16 nibbletab_cfb4[] = {
#if defined(__BIG_ENDIAN)
0x0000,0x000f,0x00f0,0x00ff,
0x0f00,0x0f0f,0x0ff0,0x0fff,
0xf000,0xf00f,0xf0f0,0xf0ff,
0xff00,0xff0f,0xfff0,0xffff
#elif defined(__LITTLE_ENDIAN)
0x0000,0xf000,0x0f00,0xff00,
0x00f0,0xf0f0,0x0ff0,0xfff0,
0x000f,0xf00f,0x0f0f,0xff0f,
0x00ff,0xf0ff,0x0fff,0xffff
#else
#error FIXME: No endianness??
#endif
};
void fbcon_cfb4_setup(struct display *p)
{
p->next_line = p->fb_info->fix.line_length ? p->fb_info->fix.line_length : p->var.xres_virtual>>1;
p->next_plane = 0;
}
void fbcon_cfb4_bmove(struct display *p, int sy, int sx, int dy, int dx,
int height, int width)
{
int bytes = p->next_line, linesize = bytes * fontheight(p), rows;
u8 *src,*dst;
if (sx == 0 && dx == 0 && width * 4 == bytes) {
fb_memmove(p->fb_info->screen_base + dy * linesize,
p->fb_info->screen_base + sy * linesize,
height * linesize);
}
else {
if (dy < sy || (dy == sy && dx < sx)) {
src = p->fb_info->screen_base + sy * linesize + sx * 4;
dst = p->fb_info->screen_base + dy * linesize + dx * 4;
for (rows = height * fontheight(p) ; rows-- ;) {
fb_memmove(dst, src, width * 4);
src += bytes;
dst += bytes;
}
}
else {
src = p->fb_info->screen_base + (sy+height) * linesize + sx * 4 - bytes;
dst = p->fb_info->screen_base + (dy+height) * linesize + dx * 4 - bytes;
for (rows = height * fontheight(p) ; rows-- ;) {
fb_memmove(dst, src, width * 4);
src -= bytes;
dst -= bytes;
}
}
}
}
void fbcon_cfb4_clear(struct vc_data *conp, struct display *p, int sy, int sx,
int height, int width)
{
u8 *dest0,*dest;
int bytes=p->next_line,lines=height * fontheight(p), rows, i;
u32 bgx;
/* if(p->fb_info->screen_base!=0xFDD00020)
mac_boom(1);*/
dest = p->fb_info->screen_base + sy * fontheight(p) * bytes + sx * 4;
bgx=attr_bgcol_ec(p,conp);
bgx |= (bgx << 4); /* expand the colour to 32bits */
bgx |= (bgx << 8);
bgx |= (bgx << 16);
if (sx == 0 && width * 4 == bytes) {
for (i = 0 ; i < lines * width ; i++) {
fb_writel (bgx, dest);
dest+=4;
}
} else {
dest0=dest;
for (rows = lines; rows-- ; dest0 += bytes) {
dest=dest0;
for (i = 0 ; i < width ; i++) {
/* memset ?? */
fb_writel (bgx, dest);
dest+=4;
}
}
}
}
void fbcon_cfb4_putc(struct vc_data *conp, struct display *p, int c, int yy,
int xx)
{
u8 *dest,*cdat;
int bytes=p->next_line,rows;
u32 eorx,fgx,bgx;
dest = p->fb_info->screen_base + yy * fontheight(p) * bytes + xx * 4;
cdat = p->fontdata + (c & p->charmask) * fontheight(p);
fgx=attr_fgcol(p,c);
bgx=attr_bgcol(p,c);
fgx |= (fgx << 4);
fgx |= (fgx << 8);
bgx |= (bgx << 4);
bgx |= (bgx << 8);
eorx = fgx ^ bgx;
for (rows = fontheight(p) ; rows-- ; dest += bytes) {
fb_writew((nibbletab_cfb4[*cdat >> 4] & eorx) ^ bgx, dest+0);
fb_writew((nibbletab_cfb4[*cdat++ & 0xf] & eorx) ^ bgx, dest+2);
}
}
void fbcon_cfb4_putcs(struct vc_data *conp, struct display *p,
const unsigned short *s, int count, int yy, int xx)
{
u8 *cdat, *dest, *dest0;
u16 c;
int rows,bytes=p->next_line;
u32 eorx, fgx, bgx;
dest0 = p->fb_info->screen_base + yy * fontheight(p) * bytes + xx * 4;
c = scr_readw(s);
fgx = attr_fgcol(p, c);
bgx = attr_bgcol(p, c);
fgx |= (fgx << 4);
fgx |= (fgx << 8);
fgx |= (fgx << 16);
bgx |= (bgx << 4);
bgx |= (bgx << 8);
bgx |= (bgx << 16);
eorx = fgx ^ bgx;
while (count--) {
c = scr_readw(s++) & p->charmask;
cdat = p->fontdata + c * fontheight(p);
for (rows = fontheight(p), dest = dest0; rows-- ; dest += bytes) {
fb_writew((nibbletab_cfb4[*cdat >> 4] & eorx) ^ bgx, dest+0);
fb_writew((nibbletab_cfb4[*cdat++ & 0xf] & eorx) ^ bgx, dest+2);
}
dest0+=4;
}
}
void fbcon_cfb4_revc(struct display *p, int xx, int yy)
{
u8 *dest;
int bytes=p->next_line, rows;
dest = p->fb_info->screen_base + yy * fontheight(p) * bytes + xx * 4;
for (rows = fontheight(p) ; rows-- ; dest += bytes) {
fb_writel(fb_readl(dest+0) ^ 0xffffffff, dest+0);
}
}
/*
* `switch' for the low level operations
*/
struct display_switch fbcon_cfb4 = {
setup: fbcon_cfb4_setup,
bmove: fbcon_cfb4_bmove,
clear: fbcon_cfb4_clear,
putc: fbcon_cfb4_putc,
putcs: fbcon_cfb4_putcs,
revc: fbcon_cfb4_revc,
fontwidthmask: FONTWIDTH(8)
};
#ifdef MODULE
MODULE_LICENSE("GPL");
int init_module(void)
{
return 0;
}
void cleanup_module(void)
{}
#endif /* MODULE */
/*
* Visible symbols for modules
*/
EXPORT_SYMBOL(fbcon_cfb4);
EXPORT_SYMBOL(fbcon_cfb4_setup);
EXPORT_SYMBOL(fbcon_cfb4_bmove);
EXPORT_SYMBOL(fbcon_cfb4_clear);
EXPORT_SYMBOL(fbcon_cfb4_putc);
EXPORT_SYMBOL(fbcon_cfb4_putcs);
EXPORT_SYMBOL(fbcon_cfb4_revc);
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -377,7 +377,7 @@ static int fbmem_read_proc(char *buf, char **start, off_t offset, ...@@ -377,7 +377,7 @@ static int fbmem_read_proc(char *buf, char **start, off_t offset,
if (*fi) if (*fi)
clen += sprintf(buf + clen, "%d %s\n", clen += sprintf(buf + clen, "%d %s\n",
GET_FB_IDX((*fi)->node), GET_FB_IDX((*fi)->node),
(*fi)->modename); (*fi)->fix.id);
*start = buf + offset; *start = buf + offset;
if (clen > offset) if (clen > offset)
clen -= offset; clen -= offset;
...@@ -466,10 +466,10 @@ fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd, ...@@ -466,10 +466,10 @@ fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
int fbidx = GET_FB_IDX(inode->i_rdev); int fbidx = GET_FB_IDX(inode->i_rdev);
struct fb_info *info = registered_fb[fbidx]; struct fb_info *info = registered_fb[fbidx];
struct fb_ops *fb = info->fbops; struct fb_ops *fb = info->fbops;
struct fb_cmap cmap;
struct fb_var_screeninfo var; struct fb_var_screeninfo var;
struct fb_fix_screeninfo fix; struct fb_fix_screeninfo fix;
struct fb_con2fbmap con2fb; struct fb_con2fbmap con2fb;
struct fb_cmap cmap;
int i; int i;
if (! fb) if (! fb)
...@@ -481,11 +481,13 @@ fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd, ...@@ -481,11 +481,13 @@ fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
case FBIOPUT_VSCREENINFO: case FBIOPUT_VSCREENINFO:
if (copy_from_user(&var, (void *) arg, sizeof(var))) if (copy_from_user(&var, (void *) arg, sizeof(var)))
return -EFAULT; return -EFAULT;
i = var.activate & FB_ACTIVATE_ALL if (var.activate & FB_ACTIVATE_ALL) {
? set_all_vcs(fbidx, fb, &var, info) i = set_all_vcs(fbidx, fb, &var, info);
: fb->fb_set_var(&var, PROC_CONSOLE(info), info); if (i) return i;
if (i) } else {
return i; i = fb_set_var(&var, info);
if (i) return i;
}
if (copy_to_user((void *) arg, &var, sizeof(var))) if (copy_to_user((void *) arg, &var, sizeof(var)))
return -EFAULT; return -EFAULT;
return 0; return 0;
...@@ -494,21 +496,22 @@ fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd, ...@@ -494,21 +496,22 @@ fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
case FBIOPUTCMAP: case FBIOPUTCMAP:
if (copy_from_user(&cmap, (void *) arg, sizeof(cmap))) if (copy_from_user(&cmap, (void *) arg, sizeof(cmap)))
return -EFAULT; return -EFAULT;
return (fb->fb_set_cmap(&cmap, 0, PROC_CONSOLE(info), info)); return (fb_set_cmap(&cmap, 0, info));
case FBIOGETCMAP: case FBIOGETCMAP:
if (copy_from_user(&cmap, (void *) arg, sizeof(cmap))) if (copy_from_user(&cmap, (void *) arg, sizeof(cmap)))
return -EFAULT; return -EFAULT;
return (fb->fb_get_cmap(&cmap, 0, PROC_CONSOLE(info), info)); fb_copy_cmap(&info->cmap, &cmap, 0);
case FBIOPAN_DISPLAY: case FBIOPAN_DISPLAY:
if (copy_from_user(&var, (void *) arg, sizeof(var))) if (copy_from_user(&var, (void *) arg, sizeof(var)))
return -EFAULT; return -EFAULT;
if (fb->fb_pan_display == NULL) if (fb->fb_pan_display == NULL)
return (var.xoffset || var.yoffset) ? -EINVAL : 0; return (var.xoffset || var.yoffset) ? -EINVAL : 0;
if ((i=fb->fb_pan_display(&var, PROC_CONSOLE(info), info))) if ((i=fb->fb_pan_display(&var, info)))
return i; return i;
if (copy_to_user((void *) arg, &var, sizeof(var))) if (copy_to_user((void *) arg, &var, sizeof(var)))
return -EFAULT; return -EFAULT;
return i; return i;
#ifdef CONFIG_VT
case FBIOGET_CON2FBMAP: case FBIOGET_CON2FBMAP:
if (copy_from_user(&con2fb, (void *)arg, sizeof(con2fb))) if (copy_from_user(&con2fb, (void *)arg, sizeof(con2fb)))
return -EFAULT; return -EFAULT;
...@@ -537,6 +540,7 @@ fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd, ...@@ -537,6 +540,7 @@ fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
for (i = 0; i < MAX_NR_CONSOLES; i++) for (i = 0; i < MAX_NR_CONSOLES; i++)
set_con2fb_map(i, con2fb.framebuffer); set_con2fb_map(i, con2fb.framebuffer);
return 0; return 0;
#endif
case FBIOBLANK: case FBIOBLANK:
if (fb->fb_blank == NULL) if (fb->fb_blank == NULL)
return -EINVAL; return -EINVAL;
...@@ -544,8 +548,7 @@ fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd, ...@@ -544,8 +548,7 @@ fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
default: default:
if (fb->fb_ioctl == NULL) if (fb->fb_ioctl == NULL)
return -EINVAL; return -EINVAL;
return fb->fb_ioctl(inode, file, cmd, arg, PROC_CONSOLE(info), return fb->fb_ioctl(inode, file, cmd, arg, info);
info);
} }
} }
...@@ -746,6 +749,7 @@ register_framebuffer(struct fb_info *fb_info) ...@@ -746,6 +749,7 @@ register_framebuffer(struct fb_info *fb_info)
if (!registered_fb[i]) if (!registered_fb[i])
break; break;
fb_info->node = mk_kdev(FB_MAJOR, i); fb_info->node = mk_kdev(FB_MAJOR, i);
fb_info->currcon = -1;
registered_fb[i] = fb_info; registered_fb[i] = fb_info;
if (!fb_ever_opened[i]) { if (!fb_ever_opened[i]) {
struct module *owner = fb_info->fbops->owner; struct module *owner = fb_info->fbops->owner;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -16,8 +16,6 @@ ...@@ -16,8 +16,6 @@
#include <linux/fb.h> #include <linux/fb.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <video/fbcon.h>
#undef DEBUG #undef DEBUG
#define name_matches(v, s, l) \ #define name_matches(v, s, l) \
...@@ -277,7 +275,7 @@ static int __init my_atoi(const char *name) ...@@ -277,7 +275,7 @@ static int __init my_atoi(const char *name)
int __fb_try_mode(struct fb_var_screeninfo *var, struct fb_info *info, int __fb_try_mode(struct fb_var_screeninfo *var, struct fb_info *info,
const struct fb_videomode *mode, unsigned int bpp) const struct fb_videomode *mode, unsigned int bpp)
{ {
int err; int err = 1;
DPRINTK("Trying mode %s %dx%d-%d@%d\n", mode->name ? mode->name : "noname", DPRINTK("Trying mode %s %dx%d-%d@%d\n", mode->name ? mode->name : "noname",
mode->xres, mode->yres, bpp, mode->refresh); mode->xres, mode->yres, bpp, mode->refresh);
...@@ -298,7 +296,8 @@ int __fb_try_mode(struct fb_var_screeninfo *var, struct fb_info *info, ...@@ -298,7 +296,8 @@ int __fb_try_mode(struct fb_var_screeninfo *var, struct fb_info *info,
var->vsync_len = mode->vsync_len; var->vsync_len = mode->vsync_len;
var->sync = mode->sync; var->sync = mode->sync;
var->vmode = mode->vmode; var->vmode = mode->vmode;
err = info->fbops->fb_set_var(var, PROC_CONSOLE(info), info); if (info->fbops->fb_check_var)
err = info->fbops->fb_check_var(var, info);
var->activate &= ~FB_ACTIVATE_TEST; var->activate &= ~FB_ACTIVATE_TEST;
return !err; return !err;
} }
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment