Beispiel #1
0
static void i810_accel_clear_margins(struct vc_data *conp, struct display *p,
                                     int bottom_only)
{
    struct blit_data rect;
    int depth;
    unsigned int right_start;
    unsigned int bottom_start;
    unsigned int right_width, bottom_height;

    if (i810_accel->lockup || not_safe())
        return;

    depth = (p->var.bits_per_pixel + 7) >> 3;

    switch(depth) {
    case 1:
        rect.fg = (u32) attr_bgcol_ec(p, conp);
        rect.blit_bpp = BPP8;
        break;
    case 2:
        rect.fg = (int) ((u16 *)p->dispsw_data)[attr_bgcol_ec(p, conp)];
        rect.blit_bpp = BPP16;
        break;
    case 3:
        rect.fg = ((int *)p->dispsw_data)[attr_bgcol_ec(p, conp)];
        rect.blit_bpp = BPP24;
    }
    rect.rop = COLOR_COPY_ROP;
    rect.dpitch = p->next_line;

    right_width = p->var.xres % fontwidth(p);
    right_start = p->var.xres - right_width;

    if (!bottom_only && right_width) {
        rect.dwidth = right_width * depth;
        rect.dheight = p->var.yres_virtual;
        rect.d_addr = (i810_accel->fb_offset << 12) + ((right_start + p->var.xoffset) * depth);
        color_blit(&rect);
    }
    bottom_height = p->var.yres % fontheight(p);
    if (bottom_height) {
        bottom_start = p->var.yres - bottom_height;
        rect.dwidth = right_start*depth;
        rect.dheight = bottom_height;
        rect.d_addr = (i810_accel->fb_offset << 12) + (p->var.yoffset + bottom_start) * rect.dpitch;
        color_blit(&rect);
    }
}
void i810fb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
{
	struct i810fb_par *par = (struct i810fb_par *) info->par;
	u32 dx, dy, width, height, dest, rop = 0, color = 0;

	if (!info->var.accel_flags || par->dev_flags & LOCKUP ||
	    par->depth == 4) 
		return cfb_fillrect(info, rect);

	if (par->depth == 1) 
		color = rect->color;
	else 
		color = ((u32 *) (info->pseudo_palette))[rect->color];

	rop = i810fb_rop[rect->rop];

	dx = rect->dx * par->depth;
	width = rect->width * par->depth;
	dy = rect->dy;
	height = rect->height;

	dest = info->fix.smem_start + (dy * info->fix.line_length) + dx;
	color_blit(width, height, info->fix.line_length, dest, rop, color, 
		   par->blit_bpp, info);
}
Beispiel #3
0
static void i810_accel_clear(struct vc_data *conp, struct display *p,
                             int sy, int sx, int height, int width)
{
    struct blit_data rect;
    int depth;

    if (i810_accel->lockup || not_safe())
        return;

    rect.dheight = height * fontheight(p);
    sy *= fontheight(p);

    depth = (p->var.bits_per_pixel + 7) >> 3;

    switch(depth) {
    case 1:
        rect.fg = (u32) attr_bgcol_ec(p, conp);
        rect.blit_bpp = BPP8;
        break;
    case 2:
        rect.fg = (int) ((u16 *)p->dispsw_data)[attr_bgcol_ec(p, conp)];
        rect.blit_bpp = BPP16;
        break;
    case 3:
        rect.fg = ((int *)p->dispsw_data)[attr_bgcol_ec(p, conp)];
        rect.blit_bpp = BPP24;
        break;
    }

    sx *= fontwidth(p) * depth;

    rect.dwidth = width * fontwidth(p) * depth;
    rect.d_addr = (i810_accel->fb_offset << 12) +
                  (sy * p->next_line) + sx;
    rect.rop = COLOR_COPY_ROP;
    rect.dpitch = p->next_line;

    color_blit(&rect);
}
Beispiel #4
0
static void i810_accel_revc(struct display *p, int xx, int yy)
{
    struct blit_data rect;
    int depth, c, fg;

    if (i810_accel->lockup || not_safe())
        return;

    c = scr_readw((u16 *) p->conp->vc_pos);
    fg = (int) attr_fgcol(p,c);

    depth = (p->var.bits_per_pixel + 7) >> 3;

    switch (depth) {
    case 1:
        rect.fg = fg;
        rect.blit_bpp = BPP8;
        break;
    case 2:
        rect.fg = (int) ((u16 *)p->dispsw_data)[fg];
        rect.blit_bpp = BPP16;
        break;
    case 3:
        rect.fg = ((int *)p->dispsw_data)[fg];
        rect.blit_bpp = BPP24;
        break;
    }


    rect.dpitch = p->next_line;
    rect.dwidth = fontwidth(p)*depth;
    rect.dheight = fontheight(p);
    rect.d_addr = (i810_accel->fb_offset << 12) +
                  (yy * rect.dheight * p->next_line) +
                  (xx * rect.dwidth);
    rect.rop = XOR_ROP;
    color_blit(&rect);
}