Fix VMware VGA depth computation
commit4b5db3749c5fdba93e1ac0e8748c9a9a1064319f
authorAnthony Liguori <aliguori@us.ibm.com>
Thu, 17 Dec 2009 22:08:09 +0000 (18 08:08 +1000)
committerAnthony Liguori <aliguori@us.ibm.com>
Sat, 19 Dec 2009 14:26:23 +0000 (19 08:26 -0600)
treeabdc1d9efe2d7ea855cdf8cacca990bd6fcd4ebc
parenta1497a782c3e3b12e53dcab668ad5d6d00f9a0e6
Fix VMware VGA depth computation

VMware VGA requires that the depth presented to the guest is the same as the
DisplaySurface that it renders to.  This is because it performs a very simple
memcpy() to blit from one surface to another.

We currently hardcode a 24-bit depth.  The surface allocator for SDL may, and
usually will, allocate a surface with a different depth causing screen
corruption.

This changes the code to allocate the DisplaySurface before initializing the
device which allows the depth of the DisplaySurface to be used instead of
hardcoding something.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit a6109ff1b5d7184a9d490c4ff94f175940232ebd)
hw/vmware_vga.c