diff options
author | Jordan Crouse <jordan.crouse@amd.com> | 2006-12-08 02:40:52 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-08 08:29:08 -0800 |
commit | 4c1979c8963528cc6f52203ae62162ed22e171f4 (patch) | |
tree | dc3219a7767747fc6e5476d7ea8aec104b8d0852 /drivers/video/geode/display_gx.c | |
parent | 4437cd1e98409e236a9d303fb742fdd53b3a20bb (diff) | |
download | op-kernel-dev-4c1979c8963528cc6f52203ae62162ed22e171f4.zip op-kernel-dev-4c1979c8963528cc6f52203ae62162ed22e171f4.tar.gz |
[PATCH] FB: Get the Geode GX frambuffer size from the BIOS
Use the Geode GX BIOS virtual registers to get the actual size of the
framebuffer.
Signed-off-by: Jordan Crouse <jordan.crouse@amd.com>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Acked-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/video/geode/display_gx.c')
-rw-r--r-- | drivers/video/geode/display_gx.c | 15 |
1 files changed, 12 insertions, 3 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 "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) |