mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-21 11:13:30 +00:00
Retire vd_maskbitbltchr. The same functionality can be obtained by testing
for mask != NULL in vd_bitbltchr, which all implementations of vd_bitbltchr() were doing anyway.
This commit is contained in:
parent
a93cbc2be8
commit
0f3ec4da2f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=269685
@ -53,7 +53,6 @@ static const struct vt_driver vt_creatorfb_driver = {
|
||||
.vd_init = creatorfb_init,
|
||||
.vd_blank = creatorfb_blank,
|
||||
.vd_bitbltchr = creatorfb_bitbltchr,
|
||||
.vd_maskbitbltchr = creatorfb_bitbltchr,
|
||||
.vd_fb_ioctl = vt_fb_ioctl,
|
||||
.vd_fb_mmap = vt_fb_mmap,
|
||||
.vd_priority = VD_PRIORITY_SPECIFIC
|
||||
|
@ -61,7 +61,6 @@ static struct vt_driver vt_efifb_driver = {
|
||||
.vd_init = vt_efifb_init,
|
||||
.vd_blank = vt_fb_blank,
|
||||
.vd_bitbltchr = vt_fb_bitbltchr,
|
||||
.vd_maskbitbltchr = vt_fb_maskbitbltchr,
|
||||
.vd_fb_ioctl = vt_fb_ioctl,
|
||||
.vd_fb_mmap = vt_fb_mmap,
|
||||
/* Better than VGA, but still generic driver. */
|
||||
|
@ -50,7 +50,6 @@ static struct vt_driver vt_fb_driver = {
|
||||
.vd_init = vt_fb_init,
|
||||
.vd_blank = vt_fb_blank,
|
||||
.vd_bitbltchr = vt_fb_bitbltchr,
|
||||
.vd_maskbitbltchr = vt_fb_maskbitbltchr,
|
||||
.vd_drawrect = vt_fb_drawrect,
|
||||
.vd_setpixel = vt_fb_setpixel,
|
||||
.vd_postswitch = vt_fb_postswitch,
|
||||
@ -248,70 +247,6 @@ void
|
||||
vt_fb_bitbltchr(struct vt_device *vd, const uint8_t *src, const uint8_t *mask,
|
||||
int bpl, vt_axis_t top, vt_axis_t left, unsigned int width,
|
||||
unsigned int height, term_color_t fg, term_color_t bg)
|
||||
{
|
||||
struct fb_info *info;
|
||||
uint32_t fgc, bgc, cc, o;
|
||||
int c, l, bpp;
|
||||
u_long line;
|
||||
uint8_t b;
|
||||
const uint8_t *ch;
|
||||
|
||||
info = vd->vd_softc;
|
||||
bpp = FBTYPE_GET_BYTESPP(info);
|
||||
fgc = info->fb_cmap[fg];
|
||||
bgc = info->fb_cmap[bg];
|
||||
b = 0;
|
||||
if (bpl == 0)
|
||||
bpl = (width + 7) >> 3; /* Bytes per sorce line. */
|
||||
|
||||
/* Don't try to put off screen pixels */
|
||||
if (((left + width) > info->fb_width) || ((top + height) >
|
||||
info->fb_height))
|
||||
return;
|
||||
|
||||
KASSERT((info->fb_vbase != 0), ("Unmapped framebuffer"));
|
||||
|
||||
line = (info->fb_stride * top) + (left * bpp);
|
||||
for (l = 0; l < height; l++) {
|
||||
ch = src;
|
||||
for (c = 0; c < width; c++) {
|
||||
if (c % 8 == 0)
|
||||
b = *ch++;
|
||||
else
|
||||
b <<= 1;
|
||||
o = line + (c * bpp);
|
||||
cc = b & 0x80 ? fgc : bgc;
|
||||
|
||||
switch(bpp) {
|
||||
case 1:
|
||||
vt_fb_mem_wr1(info, o, cc);
|
||||
break;
|
||||
case 2:
|
||||
vt_fb_mem_wr2(info, o, cc);
|
||||
break;
|
||||
case 3:
|
||||
/* Packed mode, so unaligned. Byte access. */
|
||||
vt_fb_mem_wr1(info, o, (cc >> 16) & 0xff);
|
||||
vt_fb_mem_wr1(info, o + 1, (cc >> 8) & 0xff);
|
||||
vt_fb_mem_wr1(info, o + 2, cc & 0xff);
|
||||
break;
|
||||
case 4:
|
||||
vt_fb_mem_wr4(info, o, cc);
|
||||
break;
|
||||
default:
|
||||
/* panic? */
|
||||
break;
|
||||
}
|
||||
}
|
||||
line += info->fb_stride;
|
||||
src += bpl;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
vt_fb_maskbitbltchr(struct vt_device *vd, const uint8_t *src, const uint8_t *mask,
|
||||
int bpl, vt_axis_t top, vt_axis_t left, unsigned int width,
|
||||
unsigned int height, term_color_t fg, term_color_t bg)
|
||||
{
|
||||
struct fb_info *info;
|
||||
uint32_t fgc, bgc, cc, o;
|
||||
|
@ -39,7 +39,6 @@ void vt_fb_suspend(void);
|
||||
vd_init_t vt_fb_init;
|
||||
vd_blank_t vt_fb_blank;
|
||||
vd_bitbltchr_t vt_fb_bitbltchr;
|
||||
vd_maskbitbltchr_t vt_fb_maskbitbltchr;
|
||||
vd_postswitch_t vt_fb_postswitch;
|
||||
vd_fb_ioctl_t vt_fb_ioctl;
|
||||
vd_fb_mmap_t vt_fb_mmap;
|
||||
|
@ -66,7 +66,6 @@ static const struct vt_driver vt_ofwfb_driver = {
|
||||
.vd_init = ofwfb_init,
|
||||
.vd_blank = vt_fb_blank,
|
||||
.vd_bitbltchr = ofwfb_bitbltchr,
|
||||
.vd_maskbitbltchr = ofwfb_bitbltchr,
|
||||
.vd_fb_ioctl = vt_fb_ioctl,
|
||||
.vd_fb_mmap = vt_fb_mmap,
|
||||
.vd_priority = VD_PRIORITY_GENERIC+1,
|
||||
|
@ -75,7 +75,6 @@ static vd_probe_t vga_probe;
|
||||
static vd_init_t vga_init;
|
||||
static vd_blank_t vga_blank;
|
||||
static vd_bitbltchr_t vga_bitbltchr;
|
||||
static vd_maskbitbltchr_t vga_maskbitbltchr;
|
||||
static vd_drawrect_t vga_drawrect;
|
||||
static vd_setpixel_t vga_setpixel;
|
||||
static vd_putchar_t vga_putchar;
|
||||
@ -87,7 +86,6 @@ static const struct vt_driver vt_vga_driver = {
|
||||
.vd_init = vga_init,
|
||||
.vd_blank = vga_blank,
|
||||
.vd_bitbltchr = vga_bitbltchr,
|
||||
.vd_maskbitbltchr = vga_bitbltchr,
|
||||
.vd_drawrect = vga_drawrect,
|
||||
.vd_setpixel = vga_setpixel,
|
||||
.vd_putchar = vga_putchar,
|
||||
|
@ -290,9 +290,6 @@ typedef void vd_blank_t(struct vt_device *vd, term_color_t color);
|
||||
typedef void vd_bitbltchr_t(struct vt_device *vd, const uint8_t *src,
|
||||
const uint8_t *mask, int bpl, vt_axis_t top, vt_axis_t left,
|
||||
unsigned int width, unsigned int height, term_color_t fg, term_color_t bg);
|
||||
typedef void vd_maskbitbltchr_t(struct vt_device *vd, const uint8_t *src,
|
||||
const uint8_t *mask, int bpl, vt_axis_t top, vt_axis_t left,
|
||||
unsigned int width, unsigned int height, term_color_t fg, term_color_t bg);
|
||||
typedef void vd_putchar_t(struct vt_device *vd, term_char_t,
|
||||
vt_axis_t top, vt_axis_t left, term_color_t fg, term_color_t bg);
|
||||
typedef int vd_fb_ioctl_t(struct vt_device *, u_long, caddr_t, struct thread *);
|
||||
@ -311,7 +308,6 @@ struct vt_driver {
|
||||
/* Drawing. */
|
||||
vd_blank_t *vd_blank;
|
||||
vd_bitbltchr_t *vd_bitbltchr;
|
||||
vd_maskbitbltchr_t *vd_maskbitbltchr;
|
||||
vd_drawrect_t *vd_drawrect;
|
||||
vd_setpixel_t *vd_setpixel;
|
||||
|
||||
|
@ -887,7 +887,7 @@ vt_flush(struct vt_device *vd)
|
||||
if ((vd->vd_my + m->h) > (size.tp_row * vf->vf_height))
|
||||
h = (size.tp_row * vf->vf_height) - vd->vd_my - 1;
|
||||
|
||||
vd->vd_driver->vd_maskbitbltchr(vd, m->map, m->mask, bpl,
|
||||
vd->vd_driver->vd_bitbltchr(vd, m->map, m->mask, bpl,
|
||||
vd->vd_offset.tp_row + vd->vd_my,
|
||||
vd->vd_offset.tp_col + vd->vd_mx,
|
||||
w, h, TC_WHITE, TC_BLACK);
|
||||
@ -2103,8 +2103,6 @@ vt_allocate(struct vt_driver *drv, void *softc)
|
||||
}
|
||||
vd = main_vd;
|
||||
VT_LOCK(vd);
|
||||
if (drv->vd_maskbitbltchr == NULL)
|
||||
drv->vd_maskbitbltchr = drv->vd_bitbltchr;
|
||||
|
||||
if (vd->vd_flags & VDF_ASYNC) {
|
||||
/* Stop vt_flush periodic task. */
|
||||
|
@ -77,7 +77,6 @@ static struct vt_driver vt_ps3fb_driver = {
|
||||
.vd_init = ps3fb_init,
|
||||
.vd_blank = vt_fb_blank,
|
||||
.vd_bitbltchr = vt_fb_bitbltchr,
|
||||
.vd_maskbitbltchr = vt_fb_maskbitbltchr,
|
||||
.vd_fb_ioctl = vt_fb_ioctl,
|
||||
.vd_fb_mmap = vt_fb_mmap,
|
||||
/* Better than VGA, but still generic driver. */
|
||||
|
Loading…
Reference in New Issue
Block a user