Vramfs: filesystem driver to utilize extra RAM on VGA devices

Jonathan Campbell jon at nerdgrounds.com
Fri Jan 30 03:20:36 UTC 2009

I don't really see the similarity between the MTD subsystem and dividing 
vram up by files. Video cards don't have "erase blocks". And MTD is not 
a filesystem. And the onboard memory mtd driver (map system RAM) only 
handles one fixed region determined at load time.

Vramfs on the other hand determines what resources to use at mount time. 
It supports multiple mounts, one per PCI device, if you want the 
combined VRAM of two VGA cards in your system.

I don't think vramfs would fit well into the MTD subsystem.
> Jonathan Campbell wrote:
>> Every VGA device connected to the PCI bus has resources that are known
>> to the Linux kernel. One of the memory resources is the video RAM
>> (always the largest prefetchable resource listed), with the base and
>> length known to the PCI subsystem. So, all vramfs needs on mount is the
>> PCI device, and the mountpoint, and it can dole it out to userspace.
>> Reading and writing is handled with ioremap(). mmap() is handled by
>> directly mmaping() that VRAM into user-space (just like /dev/fb0). Files
>> are recorded in system memory as a list of entities with a starting
>> block and length, so no fragmentation is possible.
>> No communication with the GPU is needed to do this, it's possible to use
>> VRAM this way even on devices that nobody in the system knows how to
>> talk to.
> There still seems to be quite a bit of overlap between this and the MTD
> subsystem...
> 	-hpa

More information about the devel mailing list