linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Antonino A. Daplas" <adaplas@hotpop.com>
To: Andrew Morton <akpm@osdl.org>
Cc: Linux Fbdev development list <linux-fbdev-devel@lists.sourceforge.net>
Subject: [PATCH 3/6] nvidiafb: Maximize blit buffer capacity
Date: Sun, 13 Mar 2005 08:34:15 +0800	[thread overview]
Message-ID: <200503130834.15823.adaplas@hotpop.com> (raw)

  Currently, nvidiafb blit expands a rectangle a scanline at a time.
  This is very inefficient because the graphics pipeline is not
  maximized. It may also crash if the scanline is > 4096 (should
  not happen with fbcon though).

  Instead of blitting a scanline at a time, attempt to fill up buffer
  to maximum capacity.

Signed-off-by: Antonino Daplas <adaplas@pol.net>
---

 nv_accel.c |   20 +++++++++++++++++---
 nv_local.h |    3 +--
 2 files changed, 18 insertions(+), 5 deletions(-)

diff -Nru a/drivers/video/nvidia/nv_accel.c b/drivers/video/nvidia/nv_accel.c
--- a/drivers/video/nvidia/nv_accel.c	2005-03-12 23:25:08 +08:00
+++ b/drivers/video/nvidia/nv_accel.c	2005-03-11 13:32:06 +08:00
@@ -359,10 +359,10 @@
 	struct nvidia_par *par = info->par;
 	u32 fg, bg, mask = ~(~0 >> (32 - info->var.bits_per_pixel));
 	u32 dsize, width, *data = (u32 *) image->data, tmp;
-	int i, j, k = 0;
+	int j, k = 0;
 
 	width = (image->width + 31) & ~31;
-	dsize = width >> 5;
+	dsize = (width * image->height) >> 5;
 
 	if (info->var.bits_per_pixel == 8) {
 		fg = image->fg_color | mask;
@@ -382,8 +382,22 @@
 	NVDmaNext(par, (image->height << 16) | width);
 	NVDmaNext(par, (image->dy << 16) | (image->dx & 0xffff));
 
-	for (i = image->height; i--;) {
+	while (dsize >= RECT_EXPAND_TWO_COLOR_DATA_MAX_DWORDS) {
+		NVDmaStart(par, RECT_EXPAND_TWO_COLOR_DATA(0),
+			   RECT_EXPAND_TWO_COLOR_DATA_MAX_DWORDS);
+
+		for (j = RECT_EXPAND_TWO_COLOR_DATA_MAX_DWORDS; j--;) {
+			tmp = data[k++];
+			reverse_order(&tmp);
+			NVDmaNext(par, tmp);
+		}
+
+		dsize -= RECT_EXPAND_TWO_COLOR_DATA_MAX_DWORDS;
+	}
+
+	if (dsize) {
 		NVDmaStart(par, RECT_EXPAND_TWO_COLOR_DATA(0), dsize);
+
 		for (j = dsize; j--;) {
 			tmp = data[k++];
 			reverse_order(&tmp);
diff -Nru a/drivers/video/nvidia/nv_local.h b/drivers/video/nvidia/nv_local.h
--- a/drivers/video/nvidia/nv_local.h	2005-03-12 23:25:10 +08:00
+++ b/drivers/video/nvidia/nv_local.h	2005-03-11 13:32:06 +08:00
@@ -87,9 +87,8 @@
 #endif
 
 #define WRITE_PUT(par, data) {                   \
-  volatile u8 scratch;                           \
   _NV_FENCE()                                    \
-  scratch = NV_RD08((par)->FbStart, 0);          \
+  NV_RD08((par)->FbStart, 0);                    \
   NV_WR32(&(par)->FIFO[0x0010], 0, (data) << 2); \
   mb();                                          \
 }




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

                 reply	other threads:[~2005-03-13  0:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=200503130834.15823.adaplas@hotpop.com \
    --to=adaplas@hotpop.com \
    --cc=akpm@osdl.org \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    /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).