Thread (14 messages) 14 messages, 4 authors, 2006-11-27

Re: 2.6.19-rc5: Geode GX frame buffer takes 13 seconds to initialize

From: Ben Gardner <hidden>
Date: 2006-11-21 14:44:10

Hi Jordan,

Now that you mention it, the kernel logs say it has 123 MB of LOWMEM,
so it must have 4 MB allocated to video memory. (128 MB total).

I'll try the patch on Monday -- I'm on holiday and don't have access
to the hardware.

If it works, (and I assume it will), can we get this pushed into the
main kernel tree?
IMO, this is a bug fix, not a new feature. =)

Thanks,
Ben

On 11/20/06, Jordan Crouse [off-list ref] wrote:
quoted hunk ↗ jump to hunk
On 20/11/06 16:47 -0600, Ben Gardner wrote:
quoted
I tracked it down to the memset_io() call in gxfb_core.c that clears
all the video memory.

It take 12.5 seconds to memset() a mere 16,384 Kibyte of memory.
That seems a bit strange to me.

What's stranger is the time it takes to clear the fb memory:
The first 4 MB clear in 0.01 s each.
The last 12MB are SLOW.
Hmmm - thats interesting.  One thing about the current gxfb driver is that
it assumes a 16Mb framebuffer, which may or may not be what you have, since
the amount of memory that is assigned to the graphics engine is configurable.

Its possible that you only have 4Mb of memory assigned to the graphics
engine, and that memsetting further is out being subtractively decoded on
the PCI bus and going nowhere slowly.

The attached patch queries the BIOS for the true amount of memory that
is configured.  The patch has been kicking around in the Geode git tree and
-mm for a while so it should be sane.  Give it a try and see if it helps.

Jordan


Author: Jordan Crouse [off-list ref]
Date:   Mon May 15 20:54:51 2006 -0600

    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 [off-list ref]
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 <asm/delay.h>
 #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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help