Commit a57ee627 authored by Mikulas Patocka's avatar Mikulas Patocka Committed by Linus Torvalds

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: default avatarMikulas Patocka <mpatocka@redhat.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent aef4b9aa
...@@ -242,7 +242,7 @@ void atyfb_copyarea(struct fb_info *info, const struct fb_copyarea *area) ...@@ -242,7 +242,7 @@ void atyfb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
void atyfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect) void atyfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
{ {
struct atyfb_par *par = (struct atyfb_par *) info->par; 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) if (par->asleep)
return; return;
...@@ -253,8 +253,11 @@ void atyfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect) ...@@ -253,8 +253,11 @@ void atyfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
return; return;
} }
color |= (rect->color << 8); if (info->fix.visual == FB_VISUAL_TRUECOLOR ||
color |= (rect->color << 16); info->fix.visual == FB_VISUAL_DIRECTCOLOR)
color = ((u32 *)(info->pseudo_palette))[rect->color];
else
color = rect->color;
if (info->var.bits_per_pixel == 24) { if (info->var.bits_per_pixel == 24) {
/* In 24 bpp, the engine is in 8 bpp - this requires that all */ /* In 24 bpp, the engine is in 8 bpp - this requires that all */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment