From owner-svn-src-all@FreeBSD.ORG Fri Aug 22 15:16:42 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B608114C; Fri, 22 Aug 2014 15:16:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9610E3DAF; Fri, 22 Aug 2014 15:16:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7MFGgFU096857; Fri, 22 Aug 2014 15:16:42 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7MFGgaQ096850; Fri, 22 Aug 2014 15:16:42 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201408221516.s7MFGgaQ096850@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: Jean-Sebastien Pedron Date: Fri, 22 Aug 2014 15:16:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270336 - in head/sys/dev/vt: . hw/vga X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Aug 2014 15:16:42 -0000 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 { /*