linux/drivers/video
Antonino A. Daplas e4fc27618b [PATCH] fbcon: Console Rotation - Prepare fbcon for console rotation
This patch series implements generic code to rotate the console at 90, 180,
and 270 degrees. The implementation is completely done in the framebuffer
console level, thus no changes to the framebuffer layer or to the drivers
are needed.

Console rotation is required by some Sharp-based devices where the natural
orientation of the display is not at 0 degrees. Also, users that have
displays that can pivot will benefit by having a console in portrait mode
if they so desire.

The choice to implement the code in the console layer rather than in the
framebuffer layer is due to the following reasons:

- it's fast
- it does not require driver changes
- it can coexist with devices that can rotate the display at the hardware level
- it complements graphics applications that can do display rotation

The changes to core fbcon are minimal-- recognition of the console
rotation angle so it can swap directions, origins and axes (xres vs yres,
xpanstep vs ypanstep, xoffset vs yoffset, etc) and storage of the rotation
angle per display. The bulk of the code that does the actual drawing to the
screen are placed in separate files. Each angle of rotation has separate
methods (bmove, clear, putcs, cursor, update_start which is derived from
update_var, and clear_margins).  To mimimize processing time, the fontdata
are pre-rotated at each console switch (only if the font or the angle has
changed).

The option can be compiled out (CONFIG_FRAMEBUFFER_CONSOLE_ROTATION = n) if
rotation is not needed.

Choosing the rotation angle can be done in several ways:

1. boot option fbcon=rotate:n, where
     n = 0 - normal
     n = 1 - 90 degrees (clockwise)
     n = 2 - 180 degrees (upside down)
     n = 3 - 270 degrees (counterclockwise)

2. echo n > /sys/class/graphics/fb[num]/con_rotate

     where n is the same as described above. It sets the angle of rotation
of the current console

3 echo n > /sys/class/graphics/fb[num]/con_rotate_all

     where n is the same as described above. Globally sets the angle of
rotation.

GOTCHAS:

	The option, especially at angles of 90 and 270 degrees, will exercise
the least used code of drivers.  Namely, at these angles, panning is done
in the x-axis, so it can reveal bugs in the driver if xpanstep is set
incorrectly. A workaround is to set xpanstep = 0.

	Secondly, at these angles, the framebuffer memory access can be
unaligned if (fontheight * bpp) % 32 ~= 0 which can reveal bugs in the drivers
imageblit, fillrect and copyarea functions.  (I think cfbfillrect may have
this buglet). A workaround is to use a standard 8x16 font.

Speed:

	The scrolling speed difference between 0 and 180 degrees is minimal,
somewhere areound 1-2%.  At 90 or 270 degress, speed drops down to a vicinity
of 30-40%. This is understandable because the blit direction is across the
framebuffer "direction." Scrolling will be helped at these angles if xpanstep
is not equal to zero, use of 8x16 fonts, and setting xres_virtual >= xres * 2.

Note: The code is tested on little-endian only, so I don't know if it will
work in big-endian. Please let me know, it will take only less than a minute
of your time.

This patch prepares fbcon for console rotation and contains the following
changes:

- add rotate field in struct fbcon_ops to keep fbcon's current rotation
  angle

- add con_rotate field in struct display to store per-display rotation angle

- create a private copy of the current var to fbcon.  This will prevent
  fbcon from directly manipulating info->var, especially the fields xoffset,
  yoffset and vmode.

- add ability to swap pertinent axes (xres, yres; xpanstep, ypanstep; etc)
  depending on the rotation angle

- change global update_var() (function that sets the screen start address)
  as an fbcon method update_start.  This is required because the axes, start
  offset, and/or direction can be reversed depending on the rotation angle.

- add fbcon method rotate_font() which will rotate each character bitmap to
  the correct angle of rotation.

- add fbcon boot option 'rotate' to select the angle of rotation at bootime.
   Currently does nothing until all patches are applied.

Signed-off-by: Antonino Daplas <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-09 07:56:34 -08:00
..
aty [PATCH] fbdev: ATI RN50 pci id 2005-11-07 07:53:53 -08:00
backlight [PATCH] changing CONFIG_LOCALVERSION rebuilds too much, for no good reason 2005-11-09 07:55:57 -08:00
console [PATCH] fbcon: Console Rotation - Prepare fbcon for console rotation 2005-11-09 07:56:34 -08:00
geode [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
i810 [PATCH] kfree cleanup: misc remaining drivers 2005-11-07 07:54:05 -08:00
intelfb [PATCH] changing CONFIG_LOCALVERSION rebuilds too much, for no good reason 2005-11-09 07:55:57 -08:00
kyro [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
logo [PATCH] framebuffer: add some help text in Kconfig 2005-11-07 07:53:49 -08:00
matrox [PATCH] matroxfb: Set maxhipri to 0 2005-11-07 07:53:54 -08:00
nvidia [PATCH] fbdev: Convert a few drivers to use the fb_find_best_display helper 2005-11-07 07:53:53 -08:00
riva [PATCH] PCI: remove CONFIG_PCI_NAMES 2005-09-08 14:57:23 -07:00
savage [PATCH] savagefb: X-panning fixes 2005-11-09 07:56:34 -08:00
sis [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
68328fb.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
acornfb.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
acornfb.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
amba-clcd.c [ARM] More sparse fixes 2005-11-08 14:44:15 +00:00
amifb.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
arcfb.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
asiliantfb.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
atafb.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
au1100fb.c Au1100 FB driver uplift for 2.6. 2005-10-29 19:31:01 +01:00
au1100fb.h Au1100 FB driver uplift for 2.6. 2005-10-29 19:31:01 +01:00
bt431.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
bt455.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
bw2.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
c2p.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
c2p.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
cfbcopyarea.c [PATCH] fbdev: Remove software clipping from drawing functions 2005-11-07 07:53:51 -08:00
cfbfillrect.c [PATCH] fbdev: Remove software clipping from drawing functions 2005-11-07 07:53:51 -08:00
cfbimgblt.c [PATCH] fbdev: Remove software clipping from drawing functions 2005-11-07 07:53:51 -08:00
cg3.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
cg6.c [SPARC]: Remove bogus register programming in cg6 driver. 2005-11-07 14:09:44 -08:00
cg14.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
chipsfb.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
cirrusfb.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
clps711xfb.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
controlfb.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
controlfb.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
cyber2000fb.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
cyber2000fb.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
cyberfb.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
cyberfb.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
cyblafb.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
dnfb.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
edid.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
epson1355fb.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
fbcmap.c [PATCH] fbdev: update info->cmap when setting cmap from user-/kernelspace. 2005-07-27 16:26:19 -07:00
fbcvt.c [PATCH] fbdev: Fix reversed back and front porches 2005-09-20 17:36:38 -07:00
fbmem.c Merge ../linux-2.6 by hand 2005-10-31 13:37:12 +11:00
fbmon.c [PATCH] fbdev: Rearrange mode database entries 2005-11-07 07:53:52 -08:00
fbsysfs.c [PATCH] Return the line length via sysfs for fbdev 2005-10-24 14:08:29 -07:00
ffb.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
fm2fb.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
g364fb.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
gbefb.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
hgafb.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
hitfb.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
hpfb.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
igafb.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
imsttfb.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
imxfb.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
imxfb.h [PATCH] ARM: 2687/1: i.MX framebuffer: make dmacr register platform configurable 2005-07-17 20:15:36 +01:00
Kconfig [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
leo.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
macfb.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
macmodes.c [PATCH] macmodes: needs a license 2005-06-14 07:19:35 -07:00
macmodes.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
Makefile [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
maxinefb.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
modedb.c [PATCH] fbdev: Framebuffer mode required for PowerBook Titanium 2005-11-09 07:56:34 -08:00
neofb.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
offb.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
p9100.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
platinumfb.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
platinumfb.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
pm2fb.c [PATCH] pm2fb: Manual configuration of timings for Elsa Winner 2000 Office 2005-11-07 07:53:51 -08:00
pm3fb.c [PATCH] drivers/video: Replace custom macro with isdigit() 2005-09-13 08:22:33 -07:00
pmag-aa-fb.c [PATCH] DEC PMAG AA framebuffer update 2005-09-05 00:06:03 -07:00
pmag-ba-fb.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
pmagb-b-fb.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
pvr2fb.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
pxafb.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
pxafb.h [ARM] pxafb: Remove #if DEBUG, convert DPRINTK to pr_debug 2005-09-29 09:44:54 +01:00
q40fb.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
radeonfb.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
retz3fb.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
retz3fb.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
s1d13xxxfb.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
s3c2410fb.c [PATCH] s3c2410fb: initialise device_driver .owner 2005-11-07 07:53:52 -08:00
s3c2410fb.h [PATCH] s3c2410fb: ARM S3C2410 framebuffer driver 2005-09-09 14:03:42 -07:00
S3triofb.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
sa1100fb.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
sa1100fb.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
sbuslib.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
sbuslib.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
sgivwfb.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
skeletonfb.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
sstfb.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
sticore.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
stifb.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
sun3fb.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
tcx.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
tdfxfb.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
tgafb.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
tridentfb.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
tx3912fb.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
valkyriefb.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
valkyriefb.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
vesafb.c [PATCH] vesafb: Disable mtrr as the default 2005-11-07 07:53:52 -08:00
vfb.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
vga16fb.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
vgastate.c [PATCH] vfree and kfree cleanup in drivers/ 2005-09-10 10:06:30 -07:00
virgefb.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
virgefb.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
w100fb.c [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon 2005-11-07 07:53:50 -08:00
w100fb.h [PATCH] w100fb: Rewrite for platform independence 2005-09-07 16:57:53 -07:00