Port-sparc64 archive

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

Printing radeon total memory



Hi,

I have an XVR-300 in my U45, and the attach line implies that it has 64MB
of memory.  This confused me, as I was fairly sure that the card had 128MB.

How about this change, so that we print the total memory if it's more than
64MB?  With it, I see:

  [   1.0000000] radeonfb0: 128 MB, 64 MB aperture at 0x10000000, 64 KB registers at 0x00100000

Regards,

Julian

-- 
--- src/sys/dev/pci/radeonfb.c.dist	2026-05-26 15:53:49.079974471 +0200
+++ src/sys/dev/pci/radeonfb.c	2026-05-26 15:52:52.889974505 +0200
@@ -463,6 +463,7 @@
 	pcireg_t		screg;
 	int			i, j, fg, bg, ul, flags;
 	uint32_t		v;
+	char			memstr[16] = "";
 
 	sc->sc_dev = dev;
 	sc->sc_id = pa->pa_id;
@@ -654,8 +655,10 @@
 	radeonfb_set_fbloc(sc);
 
 	/* 64 MB should be enough -- more just wastes map entries */
-	if (sc->sc_memsz > (64 << 20))
+	if (sc->sc_memsz > (64 << 20)) {
+		snprintf(memstr, 16, " %d MB,", (int)sc->sc_memsz >> 20);
 		sc->sc_memsz = (64 << 20);
+	}
 
 	for (i = 0; radeonfb_limits[i].size; i++) {
 		if (sc->sc_memsz >= radeonfb_limits[i].size) {
@@ -806,8 +809,8 @@
 		goto error;
 	}
 
-	aprint_normal("%s: %d MB aperture at 0x%08x, "
-	    "%d KB registers at 0x%08x\n", XNAME(sc),
+	aprint_normal("%s:%s %d MB aperture at 0x%08x, "
+	    "%d KB registers at 0x%08x\n", XNAME(sc), memstr,
 	    (int)sc->sc_memsz >> 20, (unsigned)sc->sc_memaddr,
 	    (int)sc->sc_regsz >> 10, (unsigned)sc->sc_regaddr);
 


Home | Main Index | Thread Index | Old Index