Skip to content

Commit

Permalink
[PATCH] Fix framebuffer console upside-down ywrap scrolling
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Knut Petersen authored and Linus Torvalds committed Dec 20, 2005
1 parent d5d74ef commit 7ca0b3b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/video/console/fbcon_ud.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7ca0b3b

Please sign in to comment.