From owner-freebsd-multimedia Wed Dec 1 16:16:31 1999 Delivered-To: freebsd-multimedia@freebsd.org Received: from tusk.mountain-inter.net (tusk.mountain-inter.net [204.244.200.1]) by hub.freebsd.org (Postfix) with ESMTP id 6543714C2C for ; Wed, 1 Dec 1999 16:16:24 -0800 (PST) (envelope-from sreid@sea-to-sky.net) Received: from grok.localnet (unknown@analog40.sq.mntn.net [204.244.200.49]) by tusk.mountain-inter.net (8.9.3/8.9.3) with ESMTP id QAA05421 for ; Wed, 1 Dec 1999 16:13:45 -0800 Received: by grok.localnet (Postfix, from userid 1000) id DB8DC212E07; Wed, 1 Dec 1999 16:12:20 -0800 (PST) Date: Wed, 1 Dec 1999 16:12:20 -0800 From: Steve Reid To: freebsd-multimedia@freebsd.org Subject: GLX, Matrox G200/G400, MTRR Message-ID: <19991201161220.A381@grok.localnet> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.4i Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org I've whipped up a small kernel module that improves the performance of Utah GLX [http://glx.on.openprojects.net/] with the Matrox cards. It does this by setting write combining on the system heap. This assumes that you've set aside some memory for GLX by compiling a kernel with the MAXMEM option (which, if you care about mga 3D performance, you'll do). I'm pretty sure this only affects the Matrox cards. As far as I know the code for the NVidea cards doesn't use system heap. Also, this will probably only work on systems with a single Pentium Pro/II/III, Celeron, or (I think) Athlon processor. I don't think it works on the K6 series. Q3 timedemo, Before: DEMO001: 1346 frames, 66.7 seconds: 20.2 fps DEMO002: 1399 frames, 73.3 seconds: 19.1 fps Q3 timedemo, After: DEMO001: 1346 frames, 57.9 seconds: 23.3 fps DEMO002: 1399 frames, 62.4 seconds: 22.4 fps The source for the kernel module is at http://sea-to-sky.net/~sreid/mtrrhack.tar.gz (1281 bytes) Beware, it doesn't have a user interface. You'll have to hand-edit the .c file and adjust things in the mtrr_settings struct for your system. It's currently set for my system, which is 64 MB total with the top 8 MB set aside for GLX (options "MAXMEM=(56*1024)" in my kernel config, plus relevant stuff in my glx.conf). Edit the .c file, type "make", then (as root) "kldload ./mtrrhack.ko". You can immediately "kldunload mtrrhack" if you want; the MTRRs will remain set. If you can't figure this out for yourself, email me with your memory configuration and I'll send you the required changes in the .c file. This module only sets the MTRRs for one CPU, which will very likely cause problems if you try to use it on an SMP machine. It also doesn't flush the caches or do other cleanup while messing with the MTRRs, but this seems to be okay because (if you edited the .c file properly) the memory used by the OS is set write-back both before and after the MTRRs are changed. Technical trivia: This program sets the variable-range MTRRs, not to be confused with the fixed-range MTRRs set by "fastvid" (and now handled by the BIOS). To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message