determine the amout of video ram

Karen Spearel kas11 at tampabay.rr.com
Fri Dec 12 06:12:29 UTC 2003


Rick Stevens wrote:

>      video RAM needed (in MB) = (width x height x
number-of-bits)/1048576

Actually, bits and bytes are being mixed above so the numbers are off by
a factor of 8.  To simplify, I would state the above equation as:  

Minimum Video RAM needed in bytes = (width x height) x (bytes/pixel)

In other words, the video memory required is the number of pixels on the
screen times the number of bytes per pixel required for the color depth
in use...1, 2 or 4 for 8 bit, 16 bit and 24/32 bit color respectively.

For example, 16 bit color at 1152x864 resolution requires 1152 x 864
pixels x 2 bytes/pixel or 1,990,656 bytes.  Convert to MB by dividing by
1,048,576 bytes/MB which gives about 1.9 MB. 24 bit color would take
twice this amount or just under 4 MB...so a double buffer will fit in 8
MB...a bare minimum for any sort of reasonable 2D graphic performance. 
And yes, the rest of the the memory on that 128 MB monster you might
have is being used in various other ways, but that is an entirely
different kettle of fish.

I say minimum above because frame buffer mapping in some modes may well
be a little funky depending on the chip and video BIOS.  Also, for
design reasons, 24 bit color actually consumes 4 bytes/pixel (24 isn't a
power of 2 but 32 is) so we end up with an 8-bit/pixel alpha channel
associated with 24 bit color in order to use the memory that isn't used
for display and would otherwise be wasted...ok, so it still isn't used
very often but transparency is coming).

HTH

kas (who thinks people knew all this but got befuddled by the numbers)





More information about the fedora-list mailing list