Port-sparc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Improved memory detection for cgsix



Hello all

So recently I got my hands on a GX+ (501-2039) and when I tried it out
on netbsd I noticed that it only detected 1M or vram instead of the 4M
the card has. Looking through the source code I found this.

src/sys/dev/sbus/cgsix_sbus.c: line 175

    sc->sc_ramsize = prom_getpropint(node, "fbmapped", 1024 * 1024);

However when I looked at the attributes of the GX+ I saw it didn't
even define an fbmapped at all, but it does have a vmsize = 4. Then I
checked a GX (501-1996) and it also does not have fbmapped but it does
have vmsize = 1. Finally I check a TGX+ clone w/ 2M of vram and it
does have fbmapped = 2M and it also has vmsize = 2. Based on this
limited sample size I believe the fbmapped attribute was added in the
TGX line. Attached below is a patch to check both attributes which
correctly detects the memory size on the cards I have.

After that I ran into a second problem in that the xserver would only
map 2M of ram. Looking at the code I found the xdriver doesn't detect
the memory size at all it just blindly tries to map memory til it
succeeds. I wasn't sure how to add memory detection to the driver so I
just raised the max amount it would try to 4M, patch below.

With these changes my GX+ is now properly detected as shown here.

[     1.000003] cgsix0 at sbus0 slot 1 offset 0x0 level 9:
SUNW,501-1717, 1152 x 900, rev 7
[     1.000003] cgsix0: attached to /dev/fb0
[     1.000003] cgsix0: framebuffer size: 4 MB

[   305.720] (II) SUNCG6(0): mapped 4096 KB video RAM
...
[   305.916] (II) EXA(0): Offscreen pixmap area of 3156480 bytes

Due to the extra ram the GX+ also gives a modest performance increase
over the GX.
ss10 - sm61  x11perf -comppixwin
GX    4510/s   613/s    31/s
GX+  5190/s  1870/s  123/s

Hope this helps.

Attachment: cgsix_sbus.diff
Description: Binary data

Attachment: cg6_xdriver.diff
Description: Binary data



Home | Main Index | Thread Index | Old Index