void i810fb_imageblit(struct fb_info *info, const struct fb_image *image) { struct i810fb_par *par = (struct i810fb_par *) info->par; u32 fg = 0, bg = 0, size, dst; if (!info->var.accel_flags || par->dev_flags & LOCKUP || par->depth == 4 || image->depth != 1) return cfb_imageblit(info, image); switch (info->var.bits_per_pixel) { case 8: fg = image->fg_color; bg = image->bg_color; break; case 16: case 24: fg = ((u32 *)(info->pseudo_palette))[image->fg_color]; bg = ((u32 *)(info->pseudo_palette))[image->bg_color]; break; } dst = info->fix.smem_start + (image->dy * info->fix.line_length) + (image->dx * par->depth); size = (image->width+7)/8 + 1; size &= ~1; size *= image->height; size += 7; size &= ~7; mono_src_copy_imm_blit(image->width * par->depth, image->height, info->fix.line_length, size/4, par->blit_bpp, PAT_COPY_ROP, dst, (u32 *) image->data, bg, fg, info); }
static void i810_accel_putcs(struct vc_data *conp, struct display *p, const unsigned short *s, int count, int yy, int xx) { struct blit_data text; int depth, c, d_addr, s_pitch, d_pitch, f_width, cell; char *s_addr; void (*move_data)(void *dst, void *src, int dpitch, int spitch, int size); if (i810_accel->lockup || not_safe()) return; c = scr_readw(s); depth = (p->var.bits_per_pixel + 7) >> 3; switch (depth) { case 1: text.fg = (int) attr_fgcol(p,c); text.bg = (int) attr_bgcol(p,c); text.blit_bpp = BPP8; break; case 2: text.bg = (int) ((u16 *)p->dispsw_data)[attr_bgcol(p, c)]; text.fg = (int) ((u16 *)p->dispsw_data)[attr_fgcol(p, c)]; text.blit_bpp = BPP16; break; case 3: text.fg = ((int *) p->dispsw_data)[attr_fgcol(p, c)]; text.bg = ((int *) p->dispsw_data)[attr_bgcol(p, c)]; text.blit_bpp = BPP24; } f_width = (fontwidth(p) + 7) & ~7; switch (f_width) { case 8: move_data = i810fb_moveb; break; case 16: move_data = i810fb_movew; break; case 32: move_data = i810fb_movel; break; default: move_data = i810fb_move; break; } s_pitch = f_width >> 3; d_pitch = ((s_pitch * count) + 1) & ~1; text.dwidth = f_width * depth * count; text.dheight = fontheight(p); text.dpitch = p->next_line; text.dsize = ((d_pitch * text.dheight) + 7) & ~7; text.dsize >>= 2; text.rop = PAT_COPY_ROP; text.d_addr = (i810_accel->fb_offset << 12) + (yy * text.dheight * p->next_line) + (xx * f_width * depth); text.s_addr[0] = d_addr = i810_accel->text_buffer; cell = s_pitch * text.dheight; if (s_pitch == 1 && count > 3) { int i, d_addr0; char *s1, *s2, *s3, *s4; while (count > 3) { s1 = p->fontdata + (scr_readw(s++) & p->charmask) * cell; s2 = p->fontdata + (scr_readw(s++) & p->charmask) * cell; s3 = p->fontdata + (scr_readw(s++) & p->charmask) * cell; s4 = p->fontdata + (scr_readw(s++) & p->charmask) * cell; d_addr0 = d_addr; for (i = text.dheight; i--; ) { *(unsigned long *) d_addr0 = (unsigned long) ((*s1++ & 0xff) | (*s2++ & 0xff) << 8 | (*s3++ & 0xff) << 16 | (*s4++ & 0xff) << 24 ); d_addr0 += d_pitch; } d_addr += 4; count -= 4; } } while (count--) { c = scr_readw(s++) & p->charmask; s_addr = p->fontdata + (c * cell); move_data((void *) d_addr, s_addr, d_pitch, s_pitch, text.dheight); d_addr += s_pitch; } mono_src_copy_imm_blit(&text); }
static void i810_accel_putc(struct vc_data *conp, struct display *p, int c, int yy, int xx) { struct blit_data data; int width, height, depth, d_addr, d_pitch, s_pitch; void (*move_data)(void *dst, void *src, int dpitch, int spitch, int size); char *s_addr; if (i810_accel->lockup || not_safe()) return; depth = (p->var.bits_per_pixel + 7) >> 3; switch (depth) { case 1: data.fg = (int) attr_fgcol(p,c); data.bg = (int) attr_bgcol(p,c); data.blit_bpp = BPP8; break; case 2: data.bg = (int) ((u16 *)p->dispsw_data)[attr_bgcol(p, c)]; data.fg = (int) ((u16 *)p->dispsw_data)[attr_fgcol(p, c)]; data.blit_bpp = BPP16; break; case 3: data.fg = ((int *) p->dispsw_data)[attr_fgcol(p, c)]; data.bg = ((int *) p->dispsw_data)[attr_bgcol(p, c)]; data.blit_bpp = BPP24; } height = fontheight(p); width = (fontwidth(p) + 7) & ~7; switch (width) { case 8: move_data = i810fb_moveb; break; case 16: move_data = i810fb_movew; break; case 32: move_data = i810fb_movel; break; default: move_data = i810fb_move; break; } s_pitch = width >> 3; d_pitch = ((s_pitch) + 1) & ~1; data.dwidth = width * depth; data.dheight = height; data.dpitch = p->next_line; data.rop = PAT_COPY_ROP; data.dsize = (d_pitch * height) >> 2; data.d_addr = (i810_accel->fb_offset << 12) + (yy * height * p->next_line) + (xx * width * depth); data.s_addr[0] = d_addr = i810_accel->text_buffer; s_addr = p->fontdata + ((c & p->charmask) * s_pitch * height); move_data((void *) d_addr, s_addr, d_pitch, s_pitch, height); mono_src_copy_imm_blit(&data); }