From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jordan Crouse" Subject: [PATCH 1/4] FB: Get the Geode GX frambuffer size from the BIOS Date: Mon, 24 Jul 2006 10:56:00 -0600 Message-ID: <20060724165600.18822.56476.stgit@cosmic.amd.com> References: <20060724165454.18822.30310.stgit@cosmic.amd.com> Reply-To: linux-fbdev-devel@lists.sourceforge.net Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from sc8-sf-mx2-b.sourceforge.net ([10.3.1.92] helo=mail.sourceforge.net) by sc8-sf-list1-new.sourceforge.net with esmtp (Exim 4.43) id 1G547x-0006RX-ST for linux-fbdev-devel@lists.sourceforge.net; Mon, 24 Jul 2006 10:21:58 -0700 Received: from outbound-fra.frontbridge.com ([62.209.45.174] helo=outbound1-fra-R.bigfish.com) by mail.sourceforge.net with esmtps (TLSv1:DES-CBC3-SHA:168) (Exim 4.44) id 1G547u-0008A5-V2 for linux-fbdev-devel@lists.sourceforge.net; Mon, 24 Jul 2006 10:21:57 -0700 In-Reply-To: <20060724165454.18822.30310.stgit@cosmic.amd.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-fbdev-devel-bounces@lists.sourceforge.net Errors-To: linux-fbdev-devel-bounces@lists.sourceforge.net To: akpm@osdl.org Cc: blizzard@redhat.com, dwmw2@redhat.com, linux-fbdev-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org From: Jordan Crouse Use the Geode GX BIOS virtual registers to get the actual size of the framebuffer. Signed-off-by: Jordan Crouse --- drivers/video/geode/display_gx.c | 15 ++++++++++++--- drivers/video/geode/display_gx.h | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/video/geode/display_gx.c b/drivers/video/geode/display_gx.c index 825c340..0245169 100644 --- a/drivers/video/geode/display_gx.c +++ b/drivers/video/geode/display_gx.c @@ -21,10 +21,19 @@ #include #include "geodefb.h" #include "display_gx.h" -int gx_frame_buffer_size(void) +unsigned int gx_frame_buffer_size(void) { - /* Assuming 16 MiB. */ - return 16*1024*1024; + unsigned int val; + + /* FB size is reported by a virtual register */ + /* Virtual register class = 0x02 */ + /* VG_MEM_SIZE(512Kb units) = 0x00 */ + + outw(0xFC53, 0xAC1C); + outw(0x0200, 0xAC1C); + + val = (unsigned int)(inw(0xAC1E)) & 0xFFl; + return (val << 19); } int gx_line_delta(int xres, int bpp) diff --git a/drivers/video/geode/display_gx.h b/drivers/video/geode/display_gx.h index 86c6233..41e79f4 100644 --- a/drivers/video/geode/display_gx.h +++ b/drivers/video/geode/display_gx.h @@ -11,7 +11,7 @@ #ifndef __DISPLAY_GX_H__ #define __DISPLAY_GX_H__ -int gx_frame_buffer_size(void); +unsigned int gx_frame_buffer_size(void); int gx_line_delta(int xres, int bpp); extern struct geode_dc_ops gx_dc_ops; ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV