From owner-svn-src-head@FreeBSD.ORG Fri Aug 22 21:46:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 40449992; Fri, 22 Aug 2014 21:46:29 +0000 (UTC) Received: from anubis.delphij.net (anubis.delphij.net [64.62.153.212]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "anubis.delphij.net", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 25EA137A3; Fri, 22 Aug 2014 21:46:28 +0000 (UTC) Received: from zeta.ixsystems.com (unknown [12.229.62.2]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id C192DA9D3; Fri, 22 Aug 2014 14:46:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphij.net; s=anubis; t=1408743981; x=1408758381; bh=3QEypGBUiVFtjvWO7zFpQQMraEmG7QvL2TX5joqC+G0=; h=Date:From:Reply-To:To:Subject:References:In-Reply-To; b=spgUCbwUSMZ2e9Y/d9/GBHyHWYrKq0GaKYbWpfcsM9vxqvVw+MeV1CYide5fGaLoV U8QiAYoBJcc4GThYfbCt70rP3RhBP76LdvgnLGWnnqW9J/M9f4awxSFJDVcmXg0RxI T/lnP2woo8tU32fd8Jw8Gav2lLN8Nl5yEdWjTTr4= Message-ID: <53F7BA2D.7070603@delphij.net> Date: Fri, 22 Aug 2014 14:46:21 -0700 From: Xin Li Reply-To: d@delphij.net Organization: The FreeBSD Project MIME-Version: 1.0 To: Jean-Sebastien Pedron , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r270342 - head/sys/dev/vt References: <201408221709.s7MH9W3Y049318@svn.freebsd.org> In-Reply-To: <201408221709.s7MH9W3Y049318@svn.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Aug 2014 21:46:29 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 08/22/14 10:09, Jean-Sebastien Pedron wrote: > Author: dumbbell Date: Fri Aug 22 17:09:31 2014 New Revision: > 270342 URL: http://svnweb.freebsd.org/changeset/base/270342 > > Log: vt(4): Use the actual size of the mouse when marking its > position as dirty > > This fixes a bug where part of the cursor was not erased. This breaks pc98 LINT build in my 'make tinderbox' build because 'vd_mcursor' is not available when SC_NO_CUTPASTE is defined. Could you please fix it? Thanks in advance! > MFC after: 1 week > > Modified: head/sys/dev/vt/vt.h head/sys/dev/vt/vt_buf.c > head/sys/dev/vt/vt_core.c > > Modified: head/sys/dev/vt/vt.h > ============================================================================== > > - --- head/sys/dev/vt/vt.h Fri Aug 22 17:05:41 2014 (r270341) > +++ head/sys/dev/vt/vt.h Fri Aug 22 17:09:31 2014 (r270342) @@ > -203,12 +203,12 @@ void vtbuf_grow(struct vt_buf *, const t void > vtbuf_putchar(struct vt_buf *, const term_pos_t *, term_char_t); > void vtbuf_cursor_position(struct vt_buf *, const term_pos_t *); > void vtbuf_scroll_mode(struct vt_buf *vb, int yes); +void > vtbuf_dirty(struct vt_buf *vb, const term_rect_t *area); void > vtbuf_undirty(struct vt_buf *, term_rect_t *, struct vt_bufmask > *); void vtbuf_sethistory_size(struct vt_buf *, int); int > vtbuf_iscursor(const struct vt_buf *vb, int row, int col); void > vtbuf_cursor_visibility(struct vt_buf *, int); #ifndef > SC_NO_CUTPASTE -void vtbuf_mouse_cursor_position(struct vt_buf *vb, > int col, int row); int vtbuf_set_mark(struct vt_buf *vb, int type, > int col, int row); int vtbuf_get_marked_len(struct vt_buf *vb); > void vtbuf_extract_marked(struct vt_buf *vb, term_char_t *buf, int > sz); > > Modified: head/sys/dev/vt/vt_buf.c > ============================================================================== > > - --- head/sys/dev/vt/vt_buf.c Fri Aug 22 17:05:41 2014 (r270341) > +++ head/sys/dev/vt/vt_buf.c Fri Aug 22 17:09:31 2014 (r270342) @@ > -246,7 +246,7 @@ vtbuf_dirty_locked(struct vt_buf *vb, co > vtbuf_dirty_axis(area->tr_begin.tp_col, area->tr_end.tp_col); } > > -static inline void +void vtbuf_dirty(struct vt_buf *vb, const > term_rect_t *area) { > > @@ -558,18 +558,6 @@ vtbuf_cursor_position(struct vt_buf *vb, } > > #ifndef SC_NO_CUTPASTE -void -vtbuf_mouse_cursor_position(struct > vt_buf *vb, int col, int row) -{ - term_rect_t area; - - > area.tr_begin.tp_row = MAX(row - 1, 0); - area.tr_begin.tp_col = > MAX(col - 1, 0); - area.tr_end.tp_row = MIN(row + 2, > vb->vb_scr_size.tp_row); - area.tr_end.tp_col = MIN(col + 2, > vb->vb_scr_size.tp_col); - vtbuf_dirty(vb, &area); -} - static > void vtbuf_flush_mark(struct vt_buf *vb) { > > Modified: head/sys/dev/vt/vt_core.c > ============================================================================== > > - --- head/sys/dev/vt/vt_core.c Fri Aug 22 17:05:41 2014 (r270341) > +++ head/sys/dev/vt/vt_core.c Fri Aug 22 17:09:31 2014 (r270342) @@ > -819,6 +819,28 @@ vt_determine_colors(term_char_t c, int c } > > static void +vt_mark_mouse_position_as_dirty(struct vt_device *vd, > int x, int y) +{ + term_rect_t area; + struct vt_window *vw; + > struct vt_font *vf; + + vw = vd->vd_curwindow; + vf = vw->vw_font; > + + area.tr_begin.tp_col = (x - vw->vw_offset.tp_col) / > vf->vf_width; + area.tr_begin.tp_row = (y - vw->vw_offset.tp_row) / > vf->vf_height; + area.tr_end.tp_col = + ((x + > vd->vd_mcursor->width - vw->vw_offset.tp_col) / + > vf->vf_width) + 1; + area.tr_end.tp_row = + ((y + > vd->vd_mcursor->height - vw->vw_offset.tp_row) / + > vf->vf_height) + 1; + + vtbuf_dirty(&vw->vw_buf, &area); +} + > +static void vt_bitblt_char(struct vt_device *vd, struct vt_font > *vf, term_char_t c, int iscursor, unsigned int row, unsigned int > col) { @@ -884,23 +906,11 @@ vt_flush(struct vt_device *vd) /* * > Mark last mouse position as dirty to erase. * - * FIXME: The > font size could be different among - * all windows, so the > column/row calculation - * below isn't correct for all windows. > - * - * FIXME: The cursor can span more than one - * > character cell. vtbuf_mouse_cursor_position - * marks > surrounding cells as dirty. But due - * to font size possibly > inconsistent across - * windows, this may not be sufficient. > This - * causes part of the cursor to not be erased. - * * > FIXME: The vt_buf lock is acquired twice in a * row. */ - > vtbuf_mouse_cursor_position(&vw->vw_buf, - vd->vd_moldx / > vf->vf_width, - vd->vd_moldy / vf->vf_height); + > vt_mark_mouse_position_as_dirty(vd, + vd->vd_moldx, > vd->vd_moldy); > > /* * Save point of last mouse cursor to erase it @@ -915,9 +925,8 > @@ vt_flush(struct vt_device *vd) cursor_displayed = 1; > > /* Mark new mouse position as dirty. */ - > vtbuf_mouse_cursor_position(&vw->vw_buf, - vd->vd_mx / > vf->vf_width, - vd->vd_my / vf->vf_height); + > vt_mark_mouse_position_as_dirty(vd, + vd->vd_mx, vd->vd_my); > } } #endif @@ -1618,14 +1627,8 @@ vt_mouse_state(int show) break; > } > > - /* - * Mark mouse position as dirty. - * - * FIXME: See > comments in vt_flush(). - */ - > vtbuf_mouse_cursor_position(&vw->vw_buf, - vd->vd_mx / > vw->vw_font->vf_width, - vd->vd_my / vw->vw_font->vf_height); + > /* Mark mouse position as dirty. */ + > vt_mark_mouse_position_as_dirty(vd, vd->vd_mx, vd->vd_my); } > #endif > > - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0 iQIcBAEBCgAGBQJT97otAAoJEJW2GBstM+ns29oQAIcd6IkBghJMIf8KEuSgxHFT sUjnXAPbsMLoecxtmKRZZrvpWXrB+VVH+BNIQy7g8qvXVddSRI8dmgq2IeAxaQNz 7KBAcqmwahjhAJm6dWO/giT5+a71SuyBNPtuDcWWc97RbYc4SXicnCXHEx4yHag9 xHmfCizjnaPiV4PrDOUSkYSrxomCag5lYRVTA4yM+lELF3/hd6EXCGZPXYzVtqWO K5osuXaAEeRv6RBHCx751zR6LkMtp0VP64eCyLm7ydxvJVc+G3yrZvnAjTuNwG6K +Y8Z5oaj70YnVnn7cq9vegA/zwm+/OVZJdAKT3XvbeYbf+67f2hr+vD5RNbxfbIh wjlG+sRO0M7Ozas0/b5YW17bBIq67dCgJU4pul2F8X6Fs3sLd5L7+degGQnUN2lO C5vwHd4Whhh0/u/4ezdldRrXWVnL4fRZ5wQiyn1dWAUitEGZeJixhY7hgCI6DaSd 4vA7zpD40ozCCXbQL3Eobl56+WgLN0JDtxuDPWWOrbrnT0msBqtHELD49uLY2rjr IWqhEkwH9cky+OhMgqNf2WyyNGqqrFTJFYrcO64Imh4HGQG3+RzeansmE72/PvI2 eWwVpFU2OELCj53/70H7CT8wseaPHBosfh3EGIgoS1NGnAlNbvr/RzPe30zLNIfV NtUTkyfa63Npg2qJO/Zb =MXbx -----END PGP SIGNATURE-----