Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Aug 2014 18:28:29 +0200
From:      =?windows-1252?Q?Jean-S=E9bastien_P=E9dron?= <dumbbell@FreeBSD.org>
To:        freebsd-current@freebsd.org
Cc:        Aleksandr Rybalko <ray@freebsd.org>, Ed Maste <emaste@FreeBSD.org>, Nathan Whitehorn <nwhitehorn@freebsd.org>, Adrian Chadd <adrian@freebsd.org>
Subject:   Re: r269471 make unusable VT console
Message-ID:  <53F37B2D.3070807@FreeBSD.org>
In-Reply-To: <53F30DF3.1090301@dumbbell.fr>
References:  <20140812232807.0f3aa02570becec15e056af2@fbsd.es>	<20140816011444.301a98d6187aca27e3a2481b@ddteam.net> <CAJ-Vmon3OS3fY1VoHu1n_T=N9NN64U7ZsxdbCkWsXAGbdMhp0g@mail.gmail.com> <53EE9CFF.4080607@freebsd.org> <53F30DF3.1090301@dumbbell.fr>

next in thread | previous in thread | raw e-mail | index | archive | help
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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?53F37B2D.3070807>