Example #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);
    }
}
Example #2
0
static void bit_clear_margins(struct vc_data *vc, struct fb_info *info,
			      int bottom_only)
{
	int bgshift = (vc->vc_hi_font_mask) ? 13 : 12;
	unsigned int cw = vc->vc_font.width;
	unsigned int ch = vc->vc_font.height;
	unsigned int rw = info->var.xres - (vc->vc_cols*cw);
	unsigned int bh = info->var.yres - (vc->vc_rows*ch);
	unsigned int rs = info->var.xres - rw;
	unsigned int bs = info->var.yres - bh;
	struct fb_fillrect region;

	region.color = attr_bgcol_ec(bgshift, vc, info);
	region.rop = ROP_COPY;

	if (rw && !bottom_only) {
		region.dx = info->var.xoffset + rs;
		region.dy = 0;
		region.width = rw;
		region.height = info->var.yres_virtual;
		info->fbops->fb_fillrect(info, &region);
	}

	if (bh) {
		region.dx = info->var.xoffset;
		region.dy = info->var.yoffset + bs;
		region.width = rs;
		region.height = bh;
		info->fbops->fb_fillrect(info, &region);
	}
}
Example #3
0
void fbcon_vga_planes_clear(struct vc_data *conp, struct display *p, int sy, int sx,
		   int height, int width)
{
	int line_ofs = p->line_length - width;
	char *where;
	int x;
	
	setmode(0);
	setop(0);
	setsr(0xf);
	setcolor(attr_bgcol_ec(p, conp));
	selectmask();

	setmask(0xff);

	sy *= fontheight(p);
	height *= fontheight(p);

	where = p->screen_base + sx + sy * p->line_length;
	while (height--) {
		for (x = 0; x < width; x++) {
			writeb(0, where);
			where++;
		}
		where += line_ofs;
	}
}
static void leo_clear(struct vc_data *conp, struct display *p, int sy, int sx,
		      int height, int width)
{
	struct fb_info_sbusfb *fb = (struct fb_info_sbusfb *)p->fb_info;
	register struct leo_lc_ss0_usr *us = fb->s.leo.lc_ss0_usr;
	register struct leo_ld *ss = (struct leo_ld *) fb->s.leo.ld_ss0;
	unsigned long flags;
	int x, y, w, h;
	int i;

	spin_lock_irqsave(&fb->lock, flags);
	do {
		i = sbus_readl(&us->csr);
	} while (i & 0x20000000);
	sbus_writel((attr_bgcol_ec(p,conp)<<24), &ss->fg);
	if (fontheightlog(p)) {
		y = sy << fontheightlog(p); h = height << fontheightlog(p);
	} else {
		y = sy * fontheight(p); h = height * fontheight(p);
	}
	if (fontwidthlog(p)) {
		x = sx << fontwidthlog(p); w = width << fontwidthlog(p);
	} else {
		x = sx * fontwidth(p); w = width * fontwidth(p);
	}
	sbus_writel((w - 1) | ((h - 1) << 11), &us->extent);
	sbus_writel((x + fb->x_margin) | ((y + fb->y_margin) << 11) | 0x80000000,
		    &us->fill);
	spin_unlock_irqrestore(&fb->lock, flags);
}
Example #5
0
static void ffb_clear(struct vc_data *conp, struct display *p, int sy, int sx,
		      int height, int width)
{
	struct fb_info_sbusfb *fb = (struct fb_info_sbusfb *)p->fb_info;
	register struct ffb_fbc *fbc = fb->s.ffb.fbc;
	unsigned long flags;
	u64 yx, hw;
	int fg;
	
	spin_lock_irqsave(&fb->lock, flags);
	fg = ((u32 *)p->dispsw_data)[attr_bgcol_ec(p,conp)];
	if (fg != fb->s.ffb.fg_cache) {
		FFBFifo(fb, 5);
		upa_writel(fg, &fbc->fg);
		fb->s.ffb.fg_cache = fg;
	} else
		FFBFifo(fb, 4);

	if (fontheightlog(p)) {
		yx = (u64)sy << (fontheightlog(p) + 32); hw = (u64)height << (fontheightlog(p) + 32);
	} else {
		yx = (u64)(sy * fontheight(p)) << 32; hw = (u64)(height * fontheight(p)) << 32;
	}
	if (fontwidthlog(p)) {
		yx += sx << fontwidthlog(p); hw += width << fontwidthlog(p);
	} else {
		yx += sx * fontwidth(p); hw += width * fontwidth(p);
	}
	upa_writeq(yx + fb->s.ffb.yx_margin, &fbc->by);
	upa_writeq(hw, &fbc->bh);
	spin_unlock_irqrestore(&fb->lock, flags);
}
Example #6
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);
}
Example #7
0
static void bit_clear(struct vc_data *vc, struct fb_info *info, int sy,
		      int sx, int height, int width)
{
	int bgshift = (vc->vc_hi_font_mask) ? 13 : 12;
	struct fb_fillrect region;

	region.color = attr_bgcol_ec(bgshift, vc, info);
	region.dx = sx * vc->vc_font.width;
	region.dy = sy * vc->vc_font.height;
	region.width = width * vc->vc_font.width;
	region.height = height * vc->vc_font.height;
	region.rop = ROP_COPY;

	info->fbops->fb_fillrect(info, &region);
}
Example #8
0
static void fbcon_riva32_clear(struct vc_data *conp, struct display *p, int sy,
			     int sx, int height, int width)
{
	u32 bgx;

	struct rivafb_info *rinfo = (struct rivafb_info *)(p->fb_info);

	bgx = ((u_int32_t*)p->dispsw_data)[attr_bgcol_ec(p, conp)];

	sx *= fontwidth(p);
	sy *= fontheight(p);
	width *= fontwidth(p);
	height *= fontheight(p);

	riva_rectfill(rinfo, sy, sx, height, width, bgx);
}
Example #9
0
static void tile_clear(struct vc_data *vc, struct fb_info *info, int sy,
		       int sx, int height, int width)
{
	struct fb_tilerect rect;
	int bgshift = (vc->vc_hi_font_mask) ? 13 : 12;
	int fgshift = (vc->vc_hi_font_mask) ? 9 : 8;

	rect.index = vc->vc_video_erase_char &
		((vc->vc_hi_font_mask) ? 0x1ff : 0xff);
	rect.fg = attr_fgcol_ec(fgshift, vc, info);
	rect.bg = attr_bgcol_ec(bgshift, vc, info);
	rect.sx = sx;
	rect.sy = sy;
	rect.width = width;
	rect.height = height;
	rect.rop = ROP_COPY;

	info->tileops->fb_tilefill(info, &rect);
}
Example #10
0
static void
cyber2000_accel_clear(struct vc_data *conp, struct display *p, int sy, int sx,
		      int height, int width)
{
	struct cfb_info *cfb = (struct cfb_info *)p->fb_info;
	struct fb_var_screeninfo *var = &p->fb_info->var;
	u_long dst;
	u_int fw, fh;
	u32 bgx = attr_bgcol_ec(p, conp);

	fw = fontwidth(p);
	fh = fontheight(p);

	dst    = sx * fw + sy * var->xres_virtual * fh;
	width  = width * fw - 1;
	height = height * fh - 1;

	cyber2000_accel_wait(cfb);
	cyber2000fb_writeb(0x00,   CO_REG_CONTROL,  cfb);
	cyber2000fb_writeb(0x03,   CO_REG_FORE_MIX, cfb);
	cyber2000fb_writew(width,  CO_REG_WIDTH,    cfb);
	cyber2000fb_writew(height, CO_REG_HEIGHT,   cfb);

	switch (var->bits_per_pixel) {
	case 15:
	case 16:
		bgx = ((u16 *)p->dispsw_data)[bgx];
	case 8:
		cyber2000fb_writel(dst, CO_REG_DEST_PTR, cfb);
		break;

	case 24:
		cyber2000fb_writel(dst * 3, CO_REG_DEST_PTR, cfb);
		cyber2000fb_writeb(dst, CO_REG_X_PHASE, cfb);
		bgx = ((u32 *)p->dispsw_data)[bgx];
		break;
	}

	cyber2000fb_writel(bgx, CO_REG_FOREGROUND, cfb);
	cyber2000fb_writew(CO_CMD_L_PATTERN_FGCOL, CO_REG_CMD_L, cfb);
	cyber2000fb_writew(0x0800, CO_REG_CMD_H, cfb);
}
Example #11
0
void fbcon_ilbm_clear(struct vc_data *conp, struct display *p, int sy, int sx,
		      int height, int width)
{
    u8 *dest;
    u_int i, rows;
    int bg, bg0;

    dest = p->screen_base+sy*fontheight(p)*p->next_line+sx;

    bg0 = attr_bgcol_ec(p,conp);
    for (rows = height*fontheight(p); rows--;) {
	bg = bg0;
	for (i = p->var.bits_per_pixel; i--; dest += p->next_plane) {
	    if (bg & 1)
		mymemset(dest, width);
	    else
		mymemclear(dest, width);
	    bg >>= 1;
	}
    }
}
Example #12
0
static void fbcon_aty_clear(struct vc_data *conp, struct display *p, int sy,
			    int sx, int height, int width)
{
    u32 bgx;
#ifdef __sparc__
    struct fb_info_aty *fb = (struct fb_info_aty *)(p->fb_info);

    if (fb->mmaped && (!fb->fb_info.display_fg
	|| fb->fb_info.display_fg->vc_num == fb->vtconsole))
	return;
#endif

    bgx = attr_bgcol_ec(p, conp);
    bgx |= (bgx << 8);
    bgx |= (bgx << 16);

    sx *= fontwidth(p);
    sy *= fontheight(p);
    width *= fontwidth(p);
    height *= fontheight(p);

    aty_rectfill(sx, sy, width, height, bgx,
		 (struct fb_info_aty *)p->fb_info);
}
Example #13
0
static void fbcon_riva32_clear_margins(struct vc_data *conp, struct display *p,
				       int bottom_only)
{
	riva_clear_margins(conp, p, bottom_only, ((u32 *)p->dispsw_data)[attr_bgcol_ec(p, conp)]);
}
Example #14
0
static void fbcon_riva8_clear_margins(struct vc_data *conp, struct display *p,
				       int bottom_only)
{
	riva_clear_margins(conp, p, bottom_only, attr_bgcol_ec(p, conp));
}