linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Eger <eger@havoc.gtf.org>
To: Andrew Morton <akpm@osdl.org>
Cc: adaplas@pol.net, linux-fbdev-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Subject: [PATCH] fbcon: prefer pan when available
Date: Thu, 3 Jun 2004 22:24:50 -0400	[thread overview]
Message-ID: <20040604022450.GA4175@havoc.gtf.org> (raw)
In-Reply-To: <200406032307.13121.adaplas@hotpop.com>


Dear Andrew,

Thomas and Antonino are right; the following are better heuristics
than I had for interpreting the accel flags.  please apply on top of
2.6.7-rc2-mm2

-dte

fbcon: improve heuristics to favor panning over copyarea()
  thanks to pseudocode from Antonino Daplas <adaplas@hotpop.com>

Signed-off-by: David Eger <eger@havoc.gtf.org>

diff -Nru a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
--- a/drivers/video/console/fbcon.c	Fri Jun  4 02:58:58 2004
+++ b/drivers/video/console/fbcon.c	Fri Jun  4 02:58:58 2004
@@ -1469,22 +1469,26 @@
 static __inline__ void updatescrollmode(struct display *p, struct fb_info *info, struct vc_data *vc)
 {
 	int cap = info->flags;
+	int good_pan = (cap & FBINFO_HWACCEL_YPAN)
+		 && divides(info->fix.ypanstep, vc->vc_font.height)
+		 && info->var.yres_virtual >= 2*info->var.yres;
+	int good_wrap = (cap & FBINFO_HWACCEL_YWRAP)
+		 && divides(info->fix.ywrapstep, vc->vc_font.height)
+		 && divides(vc->vc_font.height, info->var.yres_virtual);
+	int reading_fast = cap & FBINFO_READS_FAST;
+	int fast_copyarea = (cap & FBINFO_HWACCEL_COPYAREA) && !(cap & FBINFO_HWACCEL_DISABLED);
 
-	if ((cap & FBINFO_HWACCEL_COPYAREA) && !(cap & FBINFO_HWACCEL_DISABLED))
-		p->scrollmode = SCROLL_ACCEL;
-	else if ((cap & FBINFO_HWACCEL_YWRAP) &&
-		 divides(info->fix.ywrapstep, vc->vc_font.height) &&
-		 divides(vc->vc_font.height, info->var.yres_virtual))
-		p->scrollmode = SCROLL_WRAP;
-	else if ((cap & FBINFO_HWACCEL_YPAN) &&
-		 divides(info->fix.ypanstep, vc->vc_font.height) &&
-		 info->var.yres_virtual >= info->var.yres + vc->vc_font.height)
-		p->scrollmode = SCROLL_PAN;
-	else if (cap & FBINFO_READS_FAST)
-		/* okay, we'll use software version of accel funcs... */
-		p->scrollmode = SCROLL_ACCEL; 
-	else
-		p->scrollmode = SCROLL_REDRAW;
+	if (good_wrap || good_pan) {
+		if (reading_fast || fast_copyarea)	
+			p->scrollmode = good_wrap ? SCROLL_WRAP : SCROLL_PAN;
+		else
+			p->scrollmode = SCROLL_REDRAW;
+	} else {
+		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, 


-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
From Windows to Linux, servers to mobile, InstallShield X is the one
installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504

      parent reply	other threads:[~2004-06-04  2:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-03  2:36 [PATCH] fb accel capabilities (resend against 2.6.7-rc2) David Eger
2004-06-03 15:07 ` Antonino A. Daplas
2004-06-03 18:01   ` [Linux-fbdev-devel] " David Eger
2004-06-03 20:46     ` Thomas Winischhofer
2004-06-04  1:26       ` David Eger
2004-06-04  0:06     ` Antonino A. Daplas
2004-06-04  2:24   ` David Eger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040604022450.GA4175@havoc.gtf.org \
    --to=eger@havoc.gtf.org \
    --cc=adaplas@pol.net \
    --cc=akpm@osdl.org \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).