Example #1
0
static void i810_accel_bmove(struct display *p, int sy, int sx,
                             int dy, int dx, int height, int width)
{
    struct blit_data rect;
    int  depth;

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

    rect.rop = PAT_COPY_ROP;

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

    depth = (p->var.bits_per_pixel + 7) >> 3;
    switch (depth) {
    case 1:
        rect.blit_bpp = BPP8;
        break;
    case 2:
        rect.blit_bpp = BPP16;
        break;
    case 3:
        rect.blit_bpp = BPP24;
        break;
    }

    sx *= fontwidth(p) * depth;
    dx *= fontwidth(p) * depth;
    rect.dwidth = width * fontwidth(p) * depth;

    if (dx <= sx)
        rect.xdir = INCREMENT;
    else {
        rect.xdir = DECREMENT;
        sx += rect.dwidth - 1;
        dx += rect.dwidth - 1;
    }
    if (dy <= sy)
        rect.dpitch = p->next_line;
    else {
        rect.dpitch = (-(p->next_line)) & 0xFFFF;
        sy += rect.dheight - 1;
        dy += rect.dheight - 1;
    }
    rect.spitch = rect.dpitch;
    rect.s_addr[0] = (i810_accel->fb_offset << 12) + (sy * p->next_line) + sx;
    rect.d_addr = (i810_accel->fb_offset << 12) + (dy * p->next_line) + dx;

    source_copy_blit(&rect);
}
Example #2
0
void i810fb_copyarea(struct fb_info *info, const struct fb_copyarea *region)
{
	struct i810fb_par *par = info->par;
	u32 sx, sy, dx, dy, pitch, width, height, src, dest, xdir;

	if (!info->var.accel_flags || par->dev_flags & LOCKUP ||
	    par->depth == 4) {
		cfb_copyarea(info, region);
		return;
	}

	dx = region->dx * par->depth;
	sx = region->sx * par->depth;
	width = region->width * par->depth;
	sy = region->sy;
	dy = region->dy;
	height = region->height;

	if (dx <= sx) {
		xdir = INCREMENT;
	}
	else {
		xdir = DECREMENT;
		sx += width - 1;
		dx += width - 1;
	}
	if (dy <= sy) {
		pitch = info->fix.line_length;
	}
	else {
		pitch = (-(info->fix.line_length)) & 0xFFFF;
		sy += height - 1;
		dy += height - 1;
	}
	src = info->fix.smem_start + (sy * info->fix.line_length) + sx;
	dest = info->fix.smem_start + (dy * info->fix.line_length) + dx;

	source_copy_blit(width, height, pitch, xdir, src, dest,
			 PAT_COPY_ROP, par->blit_bpp, info);
}