linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix colors in mach64 accelerator
@ 2009-06-17 10:00 Mikulas Patocka
  2009-06-17 10:02 ` [PATCH] Disable mach64 accelerator if stride is not multiple of 64 Mikulas Patocka
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Mikulas Patocka @ 2009-06-17 10:00 UTC (permalink / raw)
  To: paulus; +Cc: linux-fbdev-devel

Use the same color-calculating algorithm as in atyfb_imageblit in this driver
or in generic cfb_fillrect.

This patch fixes bad colors when using an accelerator in 15-bit and 16-bit
modes.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com

---
 drivers/video/aty/mach64_accel.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Index: linux-2.6.30-fast/drivers/video/aty/mach64_accel.c
===================================================================
--- linux-2.6.30-fast.orig/drivers/video/aty/mach64_accel.c	2009-06-15 21:42:10.000000000 +0200
+++ linux-2.6.30-fast/drivers/video/aty/mach64_accel.c	2009-06-17 08:49:01.000000000 +0200
@@ -239,7 +239,7 @@ void atyfb_copyarea(struct fb_info *info
 void atyfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
 {
 	struct atyfb_par *par = (struct atyfb_par *) info->par;
-	u32 color = rect->color, dx = rect->dx, width = rect->width, rotation = 0;
+	u32 color, dx = rect->dx, width = rect->width, rotation = 0;
 
 	if (par->asleep)
 		return;
@@ -250,8 +250,11 @@ void atyfb_fillrect(struct fb_info *info
 		return;
 	}
 
-	color |= (rect->color << 8);
-	color |= (rect->color << 16);
+	if (info->fix.visual == FB_VISUAL_TRUECOLOR ||
+	    info->fix.visual == FB_VISUAL_DIRECTCOLOR)
+		color = ((u32 *)(info->pseudo_palette))[rect->color];
+	else
+		color = rect->color;
 
 	if (info->var.bits_per_pixel == 24) {
 		/* In 24 bpp, the engine is in 8 bpp - this requires that all */

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects

^ permalink raw reply	[flat|nested] 9+ messages in thread
* Re:  [PATCH] Disable mach64 accelerator if stride is not multiple of 64
@ 2009-06-18 10:17 krzysztof.h1
  2009-06-18 12:38 ` Mikulas Patocka
  0 siblings, 1 reply; 9+ messages in thread
From: krzysztof.h1 @ 2009-06-18 10:17 UTC (permalink / raw)
  To: Mikulas Patocka, Ville Syrj�l�, linux-fbdev-devel,
	paulus

Mikulas Patocka napisa³(a):
> 
> 
> BTW. why doesn't it use accelerator for screen scrolling? It seems to 
> redraw all non-empty characters, which is fast if most of the screen is 
> empty but gets slower if the screen is full of text.
> 

It uses the accelerater.. The screen redraw uses accelerated imageblit() function 
if it exists.
In order to use the blitter one must define FBINFO_READS_FAST flag. However,
it may not end up faster. It is faster if the memory is fast while chip is not
so fast relatively (e.g. all new GeForce and Radeon chips, 3DFxx Voodoo3+ have 
very fast memory attached).
It  may vary for other chips, i.e. even if your ati card equiped with sgram it is 
faster it may be slower for the same chip with sdram.

Also, if blitter is used for scrolling the crolling speed goes down with increasing 
pixel depth which is not a case for the redraw method.

Regards,
Krzysztof

----------------------------------------------------------------------
Nowa akcja Pepsi - nagrody za kody spod nakretek. Zarejestruj sie!
http://link.interia.pl/f21cc 



------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects

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

end of thread, other threads:[~2009-06-20 21:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-17 10:00 [PATCH] Fix colors in mach64 accelerator Mikulas Patocka
2009-06-17 10:02 ` [PATCH] Disable mach64 accelerator if stride is not multiple of 64 Mikulas Patocka
2009-06-17 17:21   ` Ville Syrjälä
2009-06-17 21:05     ` Mikulas Patocka
2009-06-20 21:25       ` Ville Syrjälä
2009-06-17 17:24 ` [PATCH] Fix colors in mach64 accelerator Ville Syrjälä
2009-06-17 21:40 ` Krzysztof Helt
  -- strict thread matches above, loose matches on Subject: below --
2009-06-18 10:17 [PATCH] Disable mach64 accelerator if stride is not multiple of 64 krzysztof.h1
2009-06-18 12:38 ` Mikulas Patocka

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