mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Eger <eger@havoc.gtf.org>
To: Timothy Miller <miller@techsource.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: radeonfb broken
Date: Sun, 18 Apr 2004 22:18:31 -0400	[thread overview]
Message-ID: <20040419021831.GA27877@havoc.gtf.org> (raw)
In-Reply-To: <407EFB08.6050307@techsource.com>


My apologies; the bug is mine.  It's a simple issue of taking care
of overlapping regions in calls to copyarea().  I sent the fix to the
linux-fbdev mailing list earlier today.   The patch is reprinted below;
Hopefully Linus will take it for 2.6.6.

-dte

--- drivers/video/aty/radeon_accel.c.orig	2004-04-19 01:26:52.000000000 +0200
+++ drivers/video/aty/radeon_accel.c	2004-04-19 01:49:14.000000000 +0200
@@ -53,6 +53,18 @@
 static void radeonfb_prim_copyarea(struct radeonfb_info *rinfo, 
 				   const struct fb_copyarea *area)
 {
+	int xdir, ydir;
+	u32 sx, sy, dx, dy, w, h;
+
+	w = area->width; h = area->height;
+	dx = area->dx; dy = area->dy;
+	sx = area->sx; sy = area->sy;
+	xdir = sx - dx;
+	ydir = sy - dy;
+
+	if ( xdir < 0 ) { sx += w-1; dx += w-1; }
+	if ( ydir < 0 ) { sy += h-1; dy += h-1; }
+
 	radeon_fifo_wait(3);
 	OUTREG(DP_GUI_MASTER_CNTL,
 		rinfo->dp_gui_master_cntl /* i.e. GMC_DST_32BPP */
@@ -60,12 +72,13 @@
 		| ROP3_S 
 		| DP_SRC_RECT );
 	OUTREG(DP_WRITE_MSK, 0xffffffff);
-	OUTREG(DP_CNTL, (DST_X_LEFT_TO_RIGHT | DST_Y_TOP_TO_BOTTOM));
+	OUTREG(DP_CNTL, (xdir>=0 ? DST_X_LEFT_TO_RIGHT : 0)
+			| (ydir>=0 ? DST_Y_TOP_TO_BOTTOM : 0));
 
 	radeon_fifo_wait(3);
-	OUTREG(SRC_Y_X, (area->sy << 16) | area->sx);
-	OUTREG(DST_Y_X, (area->dy << 16) | area->dx);
-	OUTREG(DST_HEIGHT_WIDTH, (area->height << 16) | area->width);
+	OUTREG(SRC_Y_X, (sy << 16) | sx);
+	OUTREG(DST_Y_X, (dy << 16) | dx);
+	OUTREG(DST_HEIGHT_WIDTH, (h << 16) | w);
 }
 
 

  parent reply	other threads:[~2004-04-19  2:18 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-15 20:25 Felix von Leitner
2004-04-15 21:13 ` Timothy Miller
2004-04-16  1:43   ` Benjamin Herrenschmidt
2004-04-16 15:58     ` Timothy Miller
2004-04-17  0:22       ` Benjamin Herrenschmidt
2004-04-19 14:18         ` Timothy Miller
2004-04-19 22:36           ` Benjamin Herrenschmidt
2004-04-16 16:06     ` Timothy Miller
2004-04-16 16:40       ` Randy.Dunlap
     [not found]   ` <20040415152507.3a0b014d.akpm@osdl.org>
2004-04-16 15:56     ` Timothy Miller
2004-04-16 20:34       ` James Simmons
2004-04-16 21:05         ` Timothy Miller
2004-04-19  2:18   ` David Eger [this message]
2004-04-16  1:46 ` Benjamin Herrenschmidt
2004-04-20 21:09 David Eger

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=20040419021831.GA27877@havoc.gtf.org \
    --to=eger@havoc.gtf.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miller@techsource.com \
    /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

all inboxes | Powered by JetHome®