From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KLywx-0002rU-KY for qemu-devel@nongnu.org; Thu, 24 Jul 2008 07:25:35 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KLyww-0002qB-Ft for qemu-devel@nongnu.org; Thu, 24 Jul 2008 07:25:34 -0400 Received: from [199.232.76.173] (port=55672 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KLyww-0002py-6V for qemu-devel@nongnu.org; Thu, 24 Jul 2008 07:25:34 -0400 Received: from savannah.gnu.org ([199.232.41.3]:39226 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KLyww-0003eA-01 for qemu-devel@nongnu.org; Thu, 24 Jul 2008 07:25:34 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KLywu-0003A9-6q for qemu-devel@nongnu.org; Thu, 24 Jul 2008 11:25:32 +0000 Received: from blueswir1 by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KLywt-00039z-Q9 for qemu-devel@nongnu.org; Thu, 24 Jul 2008 11:25:32 +0000 MIME-Version: 1.0 Errors-To: blueswir1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Blue Swirl Message-Id: Date: Thu, 24 Jul 2008 11:25:31 +0000 Subject: [Qemu-devel] [4936] Fix detection of 15 bit display depth Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 4936 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4936 Author: blueswir1 Date: 2008-07-24 11:25:30 +0000 (Thu, 24 Jul 2008) Log Message: ----------- Fix detection of 15 bit display depth Modified Paths: -------------- trunk/sdl.c Modified: trunk/sdl.c =================================================================== --- trunk/sdl.c 2008-07-23 20:01:27 UTC (rev 4935) +++ trunk/sdl.c 2008-07-24 11:25:30 UTC (rev 4936) @@ -89,6 +89,17 @@ ds->data = screen->pixels; ds->linesize = screen->pitch; ds->depth = screen->format->BitsPerPixel; + /* SDL BitsPerPixel never indicates any values other than + multiples of 8, so we need to check for strange depths. */ + if (ds->depth == 16) { + uint32_t mask; + + mask = screen->format->Rmask; + mask |= screen->format->Gmask; + mask |= screen->format->Bmask; + if ((mask & 0x8000) == 0) + ds->depth = 15; + } if (ds->depth == 32 && screen->format->Rshift == 0) { ds->bgr = 1; } else {