Subject: Re: wsdisplay on vesafb is slow
To: Aaron J. Grier <agrier@poofygoof.com>
From: Andrew Doran <ad@netbsd.org>
List: current-users
Date: 12/27/2006 01:04:46
Hi,

On Tue, Dec 26, 2006 at 03:15:38PM -0800, Aaron J. Grier wrote:

> the rasops routines in dev/rasops appear to cover the corner cases,
> alignment, et al; I'm still not entirely sure why they would be so
> horrible unless every video memory access is traversing a VM86 trap or
> something similar.  perhaps luke or jared could shed more light on the
> code?  (I'm still trying to figure out what I'm looking at and tracing
> code paths.)

One nasty (of many nasties, most of my own making) in the rasops code is
that there are additional tests and branches, additional memory references
and longer loop paths for every operation performed than there needs to be,
for the shadow FB I think. I'm not sure how the shadow FB stuff works,
though. For the machines that it was targeted at when I orignally wrote it
the branches did matter.

For x86 CPUs there might be a speed-up for some operations by using an MTRR
to force the framebuffer region to use weak ordering. For character blitting
that may be a win, but I doubt that's where the major problem lies. Running
a profiled kernel would give a good idea of where all the time is going.

I'm rambling on a bit but.. From what I have seen there are lots of PCI
bridges that collect statistics. It would be really nice to have a tool that
collected some of those numbers so we could see what's going on.

Cheers,
Andrew