Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Fix colors for Mach64

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>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Mikulas Patocka and committed by
Linus Torvalds
a57ee627 aef4b9aa

+6 -3
+6 -3
drivers/video/aty/mach64_accel.c
··· 242 242 void atyfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect) 243 243 { 244 244 struct atyfb_par *par = (struct atyfb_par *) info->par; 245 - u32 color = rect->color, dx = rect->dx, width = rect->width, rotation = 0; 245 + u32 color, dx = rect->dx, width = rect->width, rotation = 0; 246 246 247 247 if (par->asleep) 248 248 return; ··· 253 253 return; 254 254 } 255 255 256 - color |= (rect->color << 8); 257 - color |= (rect->color << 16); 256 + if (info->fix.visual == FB_VISUAL_TRUECOLOR || 257 + info->fix.visual == FB_VISUAL_DIRECTCOLOR) 258 + color = ((u32 *)(info->pseudo_palette))[rect->color]; 259 + else 260 + color = rect->color; 258 261 259 262 if (info->var.bits_per_pixel == 24) { 260 263 /* In 24 bpp, the engine is in 8 bpp - this requires that all */