Subject: Re: framebuffer mmap access
To: Brett D. Slager <bds@snarf.thnet.com>
From: Scott Reynolds <scott.reynolds@Plexus.COM>
List: port-alpha
Date: 03/21/1999 20:58:31
On Sun, 21 Mar 1999, Brett D. Slager wrote:

>  1. Shouldn't wsdisplaymmap allow mapping under both text and
>   graphics conditions?

I've run into a similar issue with converting the mac68k port to wscons.
I've got a binary compatibility issue to work out with regard to mmap() due
to the fact that our grf interface allows a display to be mapped regardless
of whether the ite (terminal emulator) is active on the display.

Since it's an application-level thing, though, your problem is trivial to
solve, though:

    int mode = WSDISPLAYIO_MODE_MAPPED;

    ioctl(f, WSDISPLAYIO_SMODE, &mode);

This will put the display, whether console or not, into mapped mode, and
mmap() will work fine.  (To revert back to the emulation, use
WSDISPLAYIO_MODE_EMUL.)

>   It's perfectly reasonable to want to
>   mmap the display on a tga regardless of any text emulations.

For a display that operates exclusively in a bitmapped mode, I'd agree.  On
the other hand, the interface as it stands allows the implementor to have a
way to switch between a bitmapped display for framebuffer access and a
hardware-based text mode, and have well-defined results in each case.

--scott