Index: [thread] [date] [subject] [author]
  From: Brian Julin <bri@forcade.calyx.net>
  To  : ggi-develop@eskimo.com
  Date: Mon, 3 Aug 1998 14:41:53 -0400 (EDT)

Re: Paged modes...

On Mon, 3 Aug 1998, Johan Karlberg wrote:
> Could anyone explain to me the difference between these definces in struct
> kgi_mmio_mapping
> 
> #define MAP_LINEAR_LINEAR       1
> #define MAP_LINEAR_PAGED        2
> #define MAP_PAGED_LINEAR        3
> #define MAP_PAGED_PAGED         4

LINEAR_LINEAR is a straight framebuffer whose whole window fits 
into MMIO space.

LINEAR_PAGED is used for example to make a banked VGA card look
like one continuous framebuffer to the userspace application.

PAGED_LINEAR is used to select just a slice of a window that fits 
into MMIO space, then when something causes a segfault an intelligent
algorithm switches the place in the MMIO window that the slice 
points at.  This is used I think for ping pong buffers.

PAGED_PAGED is if you need to do what PAGED_LINEAR does but 
on a banked hardware arrangement as in LINEAR_PAGED.  One example might
be shuffling pages on a video BIOS area, or making a 
banked emulation layer for porting older svgalib programs.

Personally I'm not sure if I like these defines and the way the
fast_remap handler outthinks you.  For example if you want to
use a sliding bank you are out of luck because the code
that calls your page fault set_offset function has decided
that no matter what value the set_offset function returns for the
offset, it will set the page to a multiple of psize based on the faulting
address, so you essentially have sliced the window into N sections and 
can choose one of them, but you can't place your window half on one 
section and half on the next.  You are also not allowed to change 
the size of your window.

Rather than add more MMAP types I'd say scrap the distinction
and only check that the physical offset and size returned by set_page
are inside the physical/memory window.  This would require the driver 
writers to make sure their set_page function filled in a valid size 
and a offset, tho.  With great power comes annoying little 
responsibilities :).

BTW as I mentioned earlier KGI driver banked modes won't work 
with fbdev without an equivalent of Steffen's fast_remap handler;
The actual remapping code is easy now as the newer kernels
now have remap_page_range and zap_page_range, but there
will be some shortcomings, that KGI and Steffen's new code address
which fbdev won't/doesn't.

--
Brian S. Julin

Index: [thread] [date] [subject] [author]