]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/video/geode/display_gx.c
gxfb: replace FBSIZE config option with a module parameter
[linux-2.6-omap-h63xx.git] / drivers / video / geode / display_gx.c
index 825c3405f5c2121fb57d95789bf7a6e83aef0209..8cd75725a31b6ce896a319ebc7b2f8990628d895 100644 (file)
 #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)
@@ -81,6 +90,7 @@ static void gx_set_mode(struct fb_info *info)
        writel(((info->var.xres * info->var.bits_per_pixel/8) >> 3) + 2,
               par->dc_regs + DC_LINE_SIZE);
 
+
        /* Enable graphics and video data and unmask address lines. */
        dcfg |= DC_DCFG_GDEN | DC_DCFG_VDEN | DC_DCFG_A20M | DC_DCFG_A18M;