提交 bc9c6a17 编写于 作者: K Krzysztof Helt 提交者: Linus Torvalds

pm2fb: big endian fix

Fix garbled letters on big endian machines with acceleration enabled.

This makes pm2fb works fine with full acceleration on sparc machine (card
known as Sun PGX-32 or TechSource Raptor GFX-8P).
Signed-off-by: NKrzysztof Helt <krzysztof.h1@wp.pl>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 a782eed6
...@@ -1159,6 +1159,11 @@ static void pm2fb_imageblit(struct fb_info *info, const struct fb_image *image) ...@@ -1159,6 +1159,11 @@ static void pm2fb_imageblit(struct fb_info *info, const struct fb_image *image)
u32 fgx, bgx; u32 fgx, bgx;
const u32 *src = (const u32 *)image->data; const u32 *src = (const u32 *)image->data;
u32 xres = (info->var.xres + 31) & ~31; u32 xres = (info->var.xres + 31) & ~31;
int raster_mode = 1; /* invert bits */
#ifdef __LITTLE_ENDIAN
raster_mode |= 3 << 7; /* reverse byte order */
#endif
if (info->state != FBINFO_STATE_RUNNING) if (info->state != FBINFO_STATE_RUNNING)
return; return;
...@@ -1208,9 +1213,8 @@ static void pm2fb_imageblit(struct fb_info *info, const struct fb_image *image) ...@@ -1208,9 +1213,8 @@ static void pm2fb_imageblit(struct fb_info *info, const struct fb_image *image)
pm2_WR(par, PM2R_RENDER, pm2_WR(par, PM2R_RENDER,
PM2F_RENDER_RECTANGLE | PM2F_RENDER_RECTANGLE |
PM2F_INCREASE_X | PM2F_INCREASE_Y); PM2F_INCREASE_X | PM2F_INCREASE_Y);
/* BitMapPackEachScanline & invert bits and byte order*/ /* BitMapPackEachScanline */
/* force background */ pm2_WR(par, PM2R_RASTERIZER_MODE, raster_mode | (1 << 9));
pm2_WR(par, PM2R_RASTERIZER_MODE, (1 << 9) | 1 | (3 << 7));
pm2_WR(par, PM2R_CONSTANT_COLOR, fgx); pm2_WR(par, PM2R_CONSTANT_COLOR, fgx);
pm2_WR(par, PM2R_RENDER, pm2_WR(par, PM2R_RENDER,
PM2F_RENDER_RECTANGLE | PM2F_RENDER_RECTANGLE |
...@@ -1224,8 +1228,7 @@ static void pm2fb_imageblit(struct fb_info *info, const struct fb_image *image) ...@@ -1224,8 +1228,7 @@ static void pm2fb_imageblit(struct fb_info *info, const struct fb_image *image)
PM2F_RENDER_RECTANGLE | PM2F_RENDER_RECTANGLE |
PM2F_RENDER_FASTFILL | PM2F_RENDER_FASTFILL |
PM2F_INCREASE_X | PM2F_INCREASE_Y); PM2F_INCREASE_X | PM2F_INCREASE_Y);
/* invert bits and byte order*/ pm2_WR(par, PM2R_RASTERIZER_MODE, raster_mode);
pm2_WR(par, PM2R_RASTERIZER_MODE, 1 | (3 << 7));
pm2_WR(par, PM2R_FB_BLOCK_COLOR, fgx); pm2_WR(par, PM2R_FB_BLOCK_COLOR, fgx);
pm2_WR(par, PM2R_RENDER, pm2_WR(par, PM2R_RENDER,
PM2F_RENDER_RECTANGLE | PM2F_RENDER_RECTANGLE |
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册