From owner-freebsd-current@FreeBSD.ORG Tue Aug 19 16:28:48 2014 Return-Path: Delivered-To: freebsd-current@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 C6A9CB9B; Tue, 19 Aug 2014 16:28:48 +0000 (UTC) Received: from mail.made4.biz (mail.made4.biz [IPv6:2001:41d0:2:c018::1:3]) (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 84D8932AC; Tue, 19 Aug 2014 16:28:48 +0000 (UTC) Received: from [2001:1b48:10b:cafe:225:64ff:febe:589f] (helo=viking.yzserv.com) by mail.made4.biz with esmtpsa (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.82_1-5b7a7c0-XX (FreeBSD)) (envelope-from ) id 1XJmH8-000OPr-8h; Tue, 19 Aug 2014 18:28:46 +0200 Message-ID: <53F37B2D.3070807@FreeBSD.org> Date: Tue, 19 Aug 2014 18:28:29 +0200 From: =?windows-1252?Q?Jean-S=E9bastien_P=E9dron?= User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: freebsd-current@freebsd.org Subject: Re: r269471 make unusable VT console References: <20140812232807.0f3aa02570becec15e056af2@fbsd.es> <20140816011444.301a98d6187aca27e3a2481b@ddteam.net> <53EE9CFF.4080607@freebsd.org> <53F30DF3.1090301@dumbbell.fr> In-Reply-To: <53F30DF3.1090301@dumbbell.fr> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="puodK99i3luKTF3wpENEnasbW8lGc7WlE" Cc: Aleksandr Rybalko , Ed Maste , Nathan Whitehorn , Adrian Chadd X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Aug 2014 16:28:49 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --puodK99i3luKTF3wpENEnasbW8lGc7WlE Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 19.08.2014 10:42, Jean-S=E9bastien P=E9dron wrote: > On 16.08.2014 01:51, Nathan Whitehorn wrote: >> It also has bad effects on boot time. My desktop takes something like = 3 >> times as long to boot after r269471. If it can't be fixed quickly, it >> needs to be reverted. >=20 > Just a quick note: I'm working on an update to vt_vga. Hello! Here's a first version of the patch I was talking about: https://people.freebsd.org/~dumbbell/vt/vt-vga.5.patch What's new/fixed: o vt_vga introduces a new callback, vd_bitblt_text_t, which takes as argument the text buffer, the dirty area, the font and the cursor (position, map, colors). With all this information at hand, it can redraw the dirty area with almost no read from the video memory. This greatly improves the performance. The implementation is quite naive and I put a lot of comments. This could probably be simplfied/improved. The cursor is drawn at the same time than the text: this avoids flickering of the mouse pointer. The patch reads from the video memory only when the byte to write uses more than 2 colors (fg/bg). But this only happens with colored text around the cursor or with fonts who's width isn't a multiple of 8. o In vt_flush(), handle the cursor position before getting the dirty area. This fixes a bug where, if we move the cursor too fast, its new location is outside the marked area and it disappears from the screen. While here, mark the new position of the cursor as dirty, not only the old one. For the cursor to be drawn, VWF_MOUSE_HIDE must not be set *and* VDF_MOUSECURSOR must be set! Before, only the former was checked when deciding if the cursor position should be marked as dirty. Finally, if the cursor didn't move, don't mark its position as dirty. Before, these two problems caused major redraw of a large part of the screen for nothing, due to a mouse pointer location of [0;0] (even if disabled) and its position always marked as dirty. o When the mouse state is changed, mark its position as dirty. o The flush timer is paused during a window switch. In the case of vt_vga, vga_initialize() is called and it messes with VGA registers and the video memory. If vt_flush() is triggered at the same time, unexpected data are displayed. This is fixed, though, there's still a annoying flickering, because the sync signal is temporarily stopped during vga_initialize(). o The patch includes another non-related patch, which tries to stabilize the refresh rate. Currently, we schedule the next redraw in 40 ms (25 Hz), but that doesn't count for the time taken to redraw. o Change how the mouse is enabled/disabled/shown/hidden. Now, the GETLEVEL and GETMODE ioctls don't touch this. Everything goes through the CONS_MOUSECTL ioctl. This fixes vidcontrol -m on|off. Known issues: o Instead of having an "if (bitblt_text !=3D NULL)" check in vt_flush(), I'll add a generic bitblt_text callback which implements the old code, so that other drivers can be changed incrementally. o In vt_vga, the screen flickers during a window switch, because it stops the sync signal and zeroes the memory. It would be nice to avoid that. o Several issues when the font is changed: 1. The offset to center the text area is global, not per window. Therefore other window are not centered anymore. 2. There's a bug with my patch, where other windows have the top-left letter wrongly shifted. 3. When the text area changes (compared to the whole screen), there's garbage in the borders. 4. The text cursor (the square) may be broken on other windows. o The mouse pointer is somtimes not erased during a move. o The text square cursor handling in vt_vga could be improved: colors are just reversed, we shouldn't change the fg/bg colors, just write a 0x00 pattern instead. o The vt_flush() timer could maybe be stopped when there's nothing to draw. No need to wakeup a core for that. Any comments? --=20 Jean-S=E9bastien P=E9dron --puodK99i3luKTF3wpENEnasbW8lGc7WlE Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJT83s9AAoJEDnpl2Gl/ZTMokUQANVY9pDdQpi1MYtdWa17IC9A XoaFRdcywQal/UiEpwTzt6eNEHPpVfM6X+mfe8eNNlKjCS8RYlUlOTqOPQuBOc33 kqnLta2k8dp4KGjHFSlwah5JJpA0CHW04CHz38pxSX1XzDd4/wox7wchoJAcNYf9 3pW9kQTWTg6kM9f1jhMDZAueLOXer1/rLjW4dq2gc/O+NGQeEGWDeQ1PVLS9uyfJ xRYwiRi6Z7Zj5BgNemnLWXgdPXN6bjw0CbyxalFhQ51y0/D5m5UCeCbD79zgcfN4 9MgcLHCj1EdLT8Puh3IWPeUOunZ03nWIEIIs06ESPc+6dWu6VZowb4E9VG4eL5al nTYD+egJ5JxYIU57JBP+oUk4gtISpdnxbmhq89/rBvcXuhlcWLLQovEbcLULtA37 rQ76zTIM9HAfr/M9wua7s+gaiOFlxdMYd+rBXtJyjjVpiUlHGui/Am/clorRLq9c XQSXkJC1DwVxMg9V0cKtbXLUp/edsTs+oM+UbEbx8CWJ1JcqzgSoAyB7Om6d8CZ+ FfsVGi9mP7jE2z0uYWQMW0oqUmtlolU0O5sd7IsENb3bEBSlTJHXHUDVF3uJilqH jkXGW9sg4KhUdmLaQUjayZOlaRcJvaEGGUUnq1gCFtWYKqg97boueovv+8kR7YvF 8IUsu98T0JFqHH9KPc1m =f8y7 -----END PGP SIGNATURE----- --puodK99i3luKTF3wpENEnasbW8lGc7WlE--