Terry Collins was once rumoured to have said:
> "E. J." wrote:
> > 
> > Hello,
> >         Im having a problem with my Red Hat 7.0 Distribution concerning the
> > switching and cofiguration of screen resolutions. I am using a Cyrix MII 233
> > mhz with a SiS6326 4mb Video Card and a LG monitor with the heighest
> > resolution of 1240*1080.
> 
> Erm, basic maths required.
> 
> 1240 x 1080 @ 8 bit/pixel[1] > 4Mb, which is why it doesn't work.
> try 1024x786 @ 8 bit.

Uh, CRACK INVOLVED.

*gets the cluebat out*.

OK, Video System Maths 101:

First, the basics.
8 bits = 1 byte.
1024^2 bytes = 1048576 bytes = 1mb

Now, that aside, there are 4 common modes of video oepration, 8bpp,
16bpp[1], 24bpp packed, and 32bpp[2].  These use 1, 2, 3 and 4 bytes per
pixel respectively.

now that we have that established, we're working within 4mbs, thats
4194304 bytes.

lets work out the video memory required for 1280x1024.

at 8bpp (256 colours), thats one byte per pixel:
  1280x1024 =  1310270  bytes.

  thats only 31% of the available video memory - that leaves heaps of
  space for offscreen buffering.

at 16bpp (65536 colours), thats two bytes per pixel:
  1280x1024@16bpp = 2621440 bytes.

  Thats only 62% of the available video memory.

at 24bpp (16 million colours):
   ... = 3932160 bytes.... still OK

at 32bpp (16 million colours):
   ... = 5242880 bytes.  OK, this doesn't work.

however, for 8bpp this is still fine.

IIRC, this a rough table of sane maximums:

      800x600      1024x768      1280x1024      1600x1200       2048x1512
1Mb   16bpp        8bpp          -              -               -
2Mb   32bpp        16bpp         8bpp           -               -
4Mb   32bpp        32bpp         24bpp          16bpp           8bpp
8Mb   32bpp        32bpp         32bpp          32bpp           16bpp
16Mb  32bpp        32bpp         32bpp          32bpp           32bpp
...
etc.


You get the idea.

C.


[1] 15bpp is a special case of 16bpp.

[2] 32bpp is still only 2^24 colours, just its faster to work with 4
    bytes, rather than with 3.  32bpp is also used with 3d because it
    gives an extra byte of space to use for alpha channel data.
-- 
--==============================================--
  Crossfire      | This email was brought to you
  [EMAIL PROTECTED] | on 100% Recycled Electrons
--==============================================--
-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to