Commit 0b0fe5ae authored by David Eger's avatar David Eger Committed by Linus Torvalds

[PATCH] fbcon: prefer pan when available

Improve heuristics to favor panning over copyarea() thanks to pseudocode
from Antonino Daplas <adaplas@hotpop.com>
Signed-off-by: default avatarDavid Eger <eger@havoc.gtf.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 0db7bc7e
...@@ -1469,22 +1469,26 @@ static void fbcon_bmove_rec(struct vc_data *vc, struct display *p, int sy, int s ...@@ -1469,22 +1469,26 @@ static void fbcon_bmove_rec(struct vc_data *vc, struct display *p, int sy, int s
static __inline__ void updatescrollmode(struct display *p, struct fb_info *info, struct vc_data *vc) static __inline__ void updatescrollmode(struct display *p, struct fb_info *info, struct vc_data *vc)
{ {
int cap = info->flags; int cap = info->flags;
int good_pan = (cap & FBINFO_HWACCEL_YPAN)
if ((cap & FBINFO_HWACCEL_COPYAREA) && !(cap & FBINFO_HWACCEL_DISABLED)) && divides(info->fix.ypanstep, vc->vc_font.height)
p->scrollmode = SCROLL_ACCEL; && info->var.yres_virtual >= 2*info->var.yres;
else if ((cap & FBINFO_HWACCEL_YWRAP) && int good_wrap = (cap & FBINFO_HWACCEL_YWRAP)
divides(info->fix.ywrapstep, vc->vc_font.height) && && divides(info->fix.ywrapstep, vc->vc_font.height)
divides(vc->vc_font.height, info->var.yres_virtual)) && divides(vc->vc_font.height, info->var.yres_virtual);
p->scrollmode = SCROLL_WRAP; int reading_fast = cap & FBINFO_READS_FAST;
else if ((cap & FBINFO_HWACCEL_YPAN) && int fast_copyarea = (cap & FBINFO_HWACCEL_COPYAREA) && !(cap & FBINFO_HWACCEL_DISABLED);
divides(info->fix.ypanstep, vc->vc_font.height) &&
info->var.yres_virtual >= info->var.yres + vc->vc_font.height) if (good_wrap || good_pan) {
p->scrollmode = SCROLL_PAN; if (reading_fast || fast_copyarea)
else if (cap & FBINFO_READS_FAST) p->scrollmode = good_wrap ? SCROLL_WRAP : SCROLL_PAN;
/* okay, we'll use software version of accel funcs... */ else
p->scrollmode = SCROLL_ACCEL; p->scrollmode = SCROLL_REDRAW;
else } else {
p->scrollmode = SCROLL_REDRAW; if (reading_fast || fast_copyarea)
p->scrollmode = SCROLL_ACCEL;
else
p->scrollmode = SCROLL_REDRAW;
}
} }
static int fbcon_resize(struct vc_data *vc, unsigned int width, static int fbcon_resize(struct vc_data *vc, unsigned int width,
......
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