svn commit: r270336 - in head/sys/dev/vt: . hw/vga
Jean-Sebastien Pedron
dumbbell at FreeBSD.org
Fri Aug 22 15:16:42 UTC 2014
Author: dumbbell
Date: Fri Aug 22 15:16:41 2014
New Revision: 270336
URL: http://svnweb.freebsd.org/changeset/base/270336
Log:
vt(4): Give the window to vd_bitblt_text_t callback
... instead of both the buffer and the font. Again, this simplifies the
API.
MFC after: 1 week
Modified:
head/sys/dev/vt/hw/vga/vt_vga.c
head/sys/dev/vt/vt.h
head/sys/dev/vt/vt_core.c
Modified: head/sys/dev/vt/hw/vga/vt_vga.c
==============================================================================
--- head/sys/dev/vt/hw/vga/vt_vga.c Fri Aug 22 15:12:56 2014 (r270335)
+++ head/sys/dev/vt/hw/vga/vt_vga.c Fri Aug 22 15:16:41 2014 (r270336)
@@ -520,14 +520,16 @@ vga_bitblt_pixels_block_ncolors(struct v
}
static void
-vga_bitblt_one_text_pixels_block(struct vt_device *vd, const struct vt_buf *vb,
- const struct vt_font *vf, unsigned int x, unsigned int y,
+vga_bitblt_one_text_pixels_block(struct vt_device *vd,
+ const struct vt_window *vw, unsigned int x, unsigned int y,
int cursor_displayed)
{
+ const struct vt_buf *vb;
+ const struct vt_font *vf;
unsigned int i, col, row, src_x, x_count;
unsigned int used_colors_list[16], used_colors;
- uint8_t pattern_2colors[vf->vf_height];
- uint8_t pattern_ncolors[vf->vf_height * 16];
+ uint8_t pattern_2colors[vw->vw_font->vf_height];
+ uint8_t pattern_ncolors[vw->vw_font->vf_height * 16];
term_char_t c;
term_color_t fg, bg;
const uint8_t *src;
@@ -536,6 +538,9 @@ vga_bitblt_one_text_pixels_block(struct
unsigned int mx, my;
#endif
+ vb = &vw->vw_buf;
+ vf = vw->vw_font;
+
/*
* The current pixels block.
*
@@ -680,12 +685,15 @@ vga_bitblt_one_text_pixels_block(struct
}
static void
-vga_bitblt_text_gfxmode(struct vt_device *vd, const struct vt_buf *vb,
- const struct vt_font *vf, const term_rect_t *area, int cursor_displayed)
+vga_bitblt_text_gfxmode(struct vt_device *vd, const struct vt_window *vw,
+ const term_rect_t *area, int cursor_displayed)
{
+ const struct vt_font *vf;
unsigned int col, row;
unsigned int x1, y1, x2, y2, x, y;
+ vf = vw->vw_font;
+
/*
* Compute the top-left pixel position aligned with the video
* adapter pixels block size.
@@ -763,23 +771,25 @@ vga_bitblt_text_gfxmode(struct vt_device
for (y = y1; y < y2; y += vf->vf_height) {
for (x = x1; x < x2; x += VT_VGA_PIXELS_BLOCK) {
- vga_bitblt_one_text_pixels_block(vd, vb, vf, x, y,
+ vga_bitblt_one_text_pixels_block(vd, vw, x, y,
cursor_displayed);
}
}
}
static void
-vga_bitblt_text_txtmode(struct vt_device *vd, const struct vt_buf *vb,
+vga_bitblt_text_txtmode(struct vt_device *vd, const struct vt_window *vw,
const term_rect_t *area, int cursor_displayed)
{
struct vga_softc *sc;
+ const struct vt_buf *vb;
unsigned int col, row;
term_char_t c;
term_color_t fg, bg;
uint8_t ch, attr;
sc = vd->vd_softc;
+ vb = &vw->vw_buf;
for (row = area->tr_begin.tp_row; row < area->tr_end.tp_row; ++row) {
for (col = area->tr_begin.tp_col;
@@ -812,14 +822,14 @@ vga_bitblt_text_txtmode(struct vt_device
}
static void
-vga_bitblt_text(struct vt_device *vd, const struct vt_buf *vb,
- const struct vt_font *vf, const term_rect_t *area, int cursor_displayed)
+vga_bitblt_text(struct vt_device *vd, const struct vt_window *vw,
+ const term_rect_t *area, int cursor_displayed)
{
if (!(vd->vd_flags & VDF_TEXTMODE)) {
- vga_bitblt_text_gfxmode(vd, vb, vf, area, cursor_displayed);
+ vga_bitblt_text_gfxmode(vd, vw, area, cursor_displayed);
} else {
- vga_bitblt_text_txtmode(vd, vb, area, cursor_displayed);
+ vga_bitblt_text_txtmode(vd, vw, area, cursor_displayed);
}
}
Modified: head/sys/dev/vt/vt.h
==============================================================================
--- head/sys/dev/vt/vt.h Fri Aug 22 15:12:56 2014 (r270335)
+++ head/sys/dev/vt/vt.h Fri Aug 22 15:16:41 2014 (r270336)
@@ -302,8 +302,8 @@ typedef void vd_bitbltchr_t(struct vt_de
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 void vd_bitblt_text_t(struct vt_device *vd, const struct vt_buf *vb,
- const struct vt_font *vf, const term_rect_t *area, int cursor_displayed);
+typedef void vd_bitblt_text_t(struct vt_device *vd, const struct vt_window *vw,
+ const term_rect_t *area, int cursor_displayed);
typedef int vd_fb_ioctl_t(struct vt_device *, u_long, caddr_t, struct thread *);
typedef int vd_fb_mmap_t(struct vt_device *, vm_ooffset_t, vm_paddr_t *, int,
vm_memattr_t *);
Modified: head/sys/dev/vt/vt_core.c
==============================================================================
--- head/sys/dev/vt/vt_core.c Fri Aug 22 15:12:56 2014 (r270335)
+++ head/sys/dev/vt/vt_core.c Fri Aug 22 15:16:41 2014 (r270336)
@@ -935,8 +935,8 @@ vt_flush(struct vt_device *vd)
if (vd->vd_driver->vd_bitblt_text != NULL) {
if (tarea.tr_begin.tp_col < tarea.tr_end.tp_col) {
- vd->vd_driver->vd_bitblt_text(vd, &vw->vw_buf, vf,
- &tarea, cursor_displayed);
+ vd->vd_driver->vd_bitblt_text(vd, vw, &tarea,
+ cursor_displayed);
}
} else {
/*
More information about the svn-src-all
mailing list