linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] radeonfb(): memmove() fix -- this one works ;-)
@ 2004-04-19  1:46 David Eger
  2004-04-19  1:50 ` Benjamin Herrenschmidt
  2004-04-19  1:52 ` Benjamin Herrenschmidt
  0 siblings, 2 replies; 76+ messages in thread
From: David Eger @ 2004-04-19  1:46 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: Linux Frame Buffer Device Development


Dear Ben,

Please apply this patch to the radeonfb driver (I think of you as the
maintainer for this driver) and then forward to James and Linus :-)

This fixes the same problem as mentioned before -- overlapping
regions sent to copyarea() get fux0r3d.  This patch corrects my earlier
braindamage of setting up w, h, dx, etc. and then forgetting to use them
later on.  Ah, having two versions of the same code (userspace and kernel
space) -- little details like that just float past the eye...  no problem
with fbcon at all, as i previously speculated.  apologies to james.

-David


--- 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);
 }
 
 



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click

^ permalink raw reply	[flat|nested] 76+ messages in thread

end of thread, other threads:[~2004-04-30 23:58 UTC | newest]

Thread overview: 76+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-19  1:46 [PATCH] radeonfb(): memmove() fix -- this one works ;-) David Eger
2004-04-19  1:50 ` Benjamin Herrenschmidt
2004-04-19  1:52 ` Benjamin Herrenschmidt
2004-04-20 22:52   ` James Simmons
2004-04-21  0:30     ` Benjamin Herrenschmidt
2004-04-21 18:03       ` James Simmons
2004-04-21 23:08         ` Benjamin Herrenschmidt
     [not found]     ` <12573.10.250.10.1.1082504618.squirrel@sq01.pol.net>
2004-04-21  0:30       ` Benjamin Herrenschmidt
2004-04-21  8:28         ` Geert Uytterhoeven
2004-04-21 10:36           ` Benjamin Herrenschmidt
2004-04-21 10:50             ` Geert Uytterhoeven
2004-04-21 18:13               ` James Simmons
2004-04-21 19:35                 ` Antonino A. Daplas
2004-04-22  8:22                   ` Geert Uytterhoeven
2004-04-27  0:19                     ` James Simmons
2004-04-27  0:22                       ` Benjamin Herrenschmidt
2004-04-27  8:51                         ` Geert Uytterhoeven
2004-04-27  9:43                           ` David Eger
2004-04-27  9:57                             ` Geert Uytterhoeven
2004-04-27 10:09                               ` Benjamin Herrenschmidt
2004-04-27 11:19                                 ` Geert Uytterhoeven
2004-04-27 22:41                                   ` John Zielinski
2004-04-27 10:10                             ` Benjamin Herrenschmidt
2004-04-27 11:21                               ` Geert Uytterhoeven
2004-04-27 20:28                                 ` James Simmons
2004-04-27 20:27                               ` James Simmons
2004-04-27 22:28                               ` John Zielinski
2004-04-27 22:33                                 ` James Simmons
2004-04-27 22:59                                   ` John Zielinski
2004-04-27 23:14                                     ` Benjamin Herrenschmidt
2004-04-27 23:24                                     ` James Simmons
2004-04-27 23:28                                       ` Benjamin Herrenschmidt
2004-04-27 23:57                                         ` James Simmons
2004-04-28  0:12                                           ` Benjamin Herrenschmidt
2004-04-28  1:12                                           ` John Zielinski
2004-04-28  1:50                                             ` Benjamin Herrenschmidt
2004-04-28 16:51                                             ` James Simmons
2004-04-28  0:18                                       ` John Zielinski
2004-04-27 23:02                                   ` Benjamin Herrenschmidt
2004-04-27 23:18                                     ` James Simmons
2004-04-27 23:25                                       ` Benjamin Herrenschmidt
2004-04-27 23:51                                         ` James Simmons
2004-04-27 23:53                                           ` Benjamin Herrenschmidt
2004-04-28  8:41                                             ` Geert Uytterhoeven
2004-04-28 10:00                                               ` Benjamin Herrenschmidt
2004-04-28 16:48                                                 ` James Simmons
2004-04-28 23:31                                                   ` Benjamin Herrenschmidt
2004-04-29  0:02                                                     ` James Simmons
2004-04-29  0:50                                                       ` Benjamin Herrenschmidt
2004-04-29 18:01                                                         ` James Simmons
2004-04-29 18:11                                                           ` Otto Solares
     [not found]                                                             ` <20040429194813.GA8799@dreamland.darkstar.lan>
2004-04-29 20:13                                                               ` Otto Solares
2004-04-30 16:03                                                                 ` James Simmons
2004-04-29 21:58                                                           ` Benjamin Herrenschmidt
2004-04-30 16:05                                                             ` James Simmons
2004-04-30 23:57                                                               ` Benjamin Herrenschmidt
2004-04-28 16:29                                             ` James Simmons
2004-04-28 17:56                                               ` Geert Uytterhoeven
2004-04-28 19:05                                                 ` James Simmons
2004-04-28 23:00                                                 ` John Zielinski
2004-04-28 23:29                                               ` Benjamin Herrenschmidt
2004-04-29  0:26                                                 ` James Simmons
2004-04-29  0:38                                                   ` Otto Solares
2004-04-29  8:28                                                     ` [PATCH] radeonfb(): memmove() fix -- this one works ; -) Geert Uytterhoeven
2004-04-28  1:00                                           ` [PATCH] radeonfb(): memmove() fix -- this one works ;-) John Zielinski
2004-04-28 16:38                                             ` James Simmons
2004-04-28 22:11                                               ` John Zielinski
2004-04-28  4:43                                           ` Alex Stewart
2004-04-28 17:54                                             ` James Simmons
2004-04-28 21:51                                               ` Alex Stewart
2004-04-28 21:52                                                 ` James Simmons
2004-04-28 23:35                                                   ` Alex Stewart
2004-04-27 23:54                                         ` John Zielinski
2004-04-28  0:47                           ` Antonino A. Daplas
2004-04-28  8:35                             ` [PATCH] radeonfb(): memmove() fix -- this one works ; -) Geert Uytterhoeven
2004-04-28 17:14                               ` James Simmons

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).