Skip to contentSkip to conversation

gxfb: Get the frambuffer size from the BIOS

PATCH David Vrabel 1 participant 1 message May 30, 2006 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

This works for me but the board I have can only have 16 MiB available for the framebuffer so I've not tested any other sizes.

David Vrabel

Signature · 4 lines
David Vrabel, Design Engineer

Arcom, Clifton Road           Tel: +44 (0)1223 411200 ext. 3233
Cambridge CB1 7EA, UK         Web: http://www.arcom.com/

gxfb: Get the frambuffer size from the BIOS

From: Jordan Crouse <[email protected]>

Use the Geode GX BIOS virtual registers to get the actual size of the framebuffer.

---

 drivers/video/geode/display_gx.c |   15 ++++++++++++---
 drivers/video/geode/display_gx.h |    2 +-
 2 files changed, 13 insertions(+), 4 deletions(-)
drivers/video/geode/display_gx.c +12 -3
index 825c340..7c39925 100644
@@ -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)
drivers/video/geode/display_gx.h +1 -1
index 86c6233..41e79f4 100644
@@ -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;