All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] tridentfb: Fix scrolling artifacts if acceleration is enabled
@ 2005-08-01 15:46 Antonino A. Daplas
  0 siblings, 0 replies; only message in thread
From: Antonino A. Daplas @ 2005-08-01 15:46 UTC (permalink / raw)
  To: Andrew Morton, Linus Torvalds
  Cc: Knut Petersen, Jochen Hein, Linux Fbdev development list

    Reported by: Jochen Hein (Bugzilla Bug 4386)

    booting leaves the end of long lines in the last line on screen when
    scrolling. When X is running, scrolling puts garbage on the screen (looks
    like X data) Console switch fixes the screen.  Behaviour seems to be
    identical with noaccel and without on the video=tridentfb parameter in
    lilo.conf.

    This bug was explained by: Knut_Petersen

    Acceleration is broken for all BLADE 3D chips for all versions of kernel 2.6
    except for 32bit modes. Most important reason is that the u32 col parameter of
    the graphics engine needs the color value replicated to all u8 of the u32 (8bit
    modes) and to both u16 of the u32.

    Fix color value passed to graphics engine, verified by the reporter:

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

 tridentfb.c |   26 ++++++++++++++++----------
 1 files changed, 16 insertions(+), 10 deletions(-)

--- a/drivers/video/tridentfb.c
+++ b/drivers/video/tridentfb.c
@@ -454,13 +454,16 @@ static struct accel_switch accel_image =
 static void tridentfb_fillrect(struct fb_info * info, const struct fb_fillrect *fr)
 {
 	int bpp = info->var.bits_per_pixel;
-	int col;
+	int col = 0;
 	
 	switch (bpp) {
 		default:
-		case 8: col = fr->color;
+		case 8: col |= fr->color;
+			col |= col << 8;
+			col |= col << 16;
 			break;
 		case 16: col = ((u32 *)(info->pseudo_palette))[fr->color];
+			
 			 break;
 		case 32: col = ((u32 *)(info->pseudo_palette))[fr->color];
 			 break;
@@ -882,8 +885,9 @@ static int tridentfb_set_par(struct fb_i
 
 	write3X4(GraphEngReg, 0x80);	//enable GE for text acceleration
 
-//	if (info->var.accel_flags & FB_ACCELF_TEXT)
-//FIXME		acc->init_accel(info->var.xres,bpp);
+#ifdef CONFIG_FB_TRIDENT_ACCEL	
+	acc->init_accel(info->var.xres,bpp);
+#endif
 	
 	switch (bpp) {
 		case 8:  tmp = 0x00; break;
@@ -981,12 +985,14 @@ static int tridentfb_setcolreg(unsigned 
 		t_outb(green>>10,0x3C9);
 		t_outb(blue>>10,0x3C9);
 
-	} else
-	if (bpp == 16) 			/* RGB 565 */
-			((u32*)info->pseudo_palette)[regno] = (red & 0xF800) |
-			((green & 0xFC00) >> 5) | ((blue & 0xF800) >> 11);
-	else
-	if (bpp == 32)		/* ARGB 8888 */
+	} else if (bpp == 16) {	/* RGB 565 */
+		u32 col;
+
+		col = (red & 0xF800) | ((green & 0xFC00) >> 5) |
+			((blue & 0xF800) >> 11);
+		col |= col << 16;	
+		((u32 *)(info->pseudo_palette))[regno] = col;
+	} else if (bpp == 32)		/* ARGB 8888 */
 		((u32*)info->pseudo_palette)[regno] =
 			((transp & 0xFF00) <<16) 	|
 			((red & 0xFF00) << 8) 		|



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-08-01 15:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-01 15:46 [PATCH 1/2] tridentfb: Fix scrolling artifacts if acceleration is enabled Antonino A. Daplas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.