diff --git a/drivers/video/geode/display_gx.c b/drivers/video/geode/display_gx.c index 825c3405f5c2121fb57d95789bf7a6e83aef0209..0245169366b33b5911df433fc03467f641e4ba1a 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) diff --git a/drivers/video/geode/display_gx.h b/drivers/video/geode/display_gx.h index 86c623361305887675e2099f67ccafaaed553f1c..41e79f440670030947279c79f9d1c73021c1ef0d 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;