summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorKnut Petersen <Knut_Petersen@t-online.de>2005-12-20 08:18:09 +0100
committerLinus Torvalds <torvalds@g5.osdl.org>2005-12-20 09:44:20 -0800
commit7ca0b3bf695632003a2a0f98b9fc1451b0483346 (patch)
tree149233620d7d18a45c31bfb357321886b19eed52 /drivers
parentd5d74efbeac61c73431e8ef032e97d2d1004ce88 (diff)
downloadkernel-common-7ca0b3bf695632003a2a0f98b9fc1451b0483346.tar.gz
kernel-common-7ca0b3bf695632003a2a0f98b9fc1451b0483346.tar.bz2
kernel-common-7ca0b3bf695632003a2a0f98b9fc1451b0483346.zip
[PATCH] Fix framebuffer console upside-down ywrap scrolling
Whenever ywrap scrolling is selected together with 180 degree screen rotation, 2.6.15-rc6 and earlier versions are broken. fb_pan_display() expects non-negative yoffsets, but ud_update_start() calls it with yoffsets down to -(yres - font height). This patch transforms yoffset to the correct range 0 ... vyres-1. Some obviously unneeded parentheses are removed, too. Verified with cyblafb, should be applied before 2.6.15-final because it does fix the framebuffer rotation code introduced early in the 2.6.15 release cycle. Signed-off-by: Knut Petersen <Knut_Petersen@t-online.de> Acked-by: Antonino Daplas <adaplas@pol.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/console/fbcon_ud.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/video/console/fbcon_ud.c b/drivers/video/console/fbcon_ud.c
index c4d7c89212b4..9dd059e8b645 100644
--- a/drivers/video/console/fbcon_ud.c
+++ b/drivers/video/console/fbcon_ud.c
@@ -420,13 +420,15 @@ static void ud_cursor(struct vc_data *vc, struct fb_info *info,
int ud_update_start(struct fb_info *info)
{
struct fbcon_ops *ops = info->fbcon_par;
- u32 xoffset, yoffset;
+ int xoffset, yoffset;
u32 vyres = GETVYRES(ops->p->scrollmode, info);
u32 vxres = GETVXRES(ops->p->scrollmode, info);
int err;
- xoffset = (vxres - info->var.xres) - ops->var.xoffset;
- yoffset = (vyres - info->var.yres) - ops->var.yoffset;
+ xoffset = vxres - info->var.xres - ops->var.xoffset;
+ yoffset = vyres - info->var.yres - ops->var.yoffset;
+ if (yoffset < 0)
+ yoffset += vyres;
ops->var.xoffset = xoffset;
ops->var.yoffset = yoffset;
err = fb_pan_display(info, &ops->var);