Re: video drivers, agp, mtrr, and write-combining

From: Dave Jones
Date: Wed Apr 20 2005 - 16:27:07 EST


On Wed, Apr 20, 2005 at 02:12:38PM -0700, Alice Corbin wrote:

> I've noticed that some, though no all, video drivers add their video memory
> to MTRR as 'write-combining' if both MTRR and AGP are configured in.
>
> Is there a reason that all video drivers don't do this? Is it all would
> benefit from write-combining memory, but that some simply haven't been
> updated to take advantage of it? Or could write-combining actually be
> detrimental to some video drivers?

Either the drivers dont do it (for whatever reason), or the system
doesnt have any spare MTRRs, or the system has broken WC MTRRs.
Got a specific example of a failing system ?

> (And if the former, would it make
> more sense to do the mtrr_add in a central location, say agpgart?)

It *could*, though it's not always straight-forward.
Here's an example of one awkward situation..

Matrox G550: Prefetchable memory behind bridge: f8000000-f9ffffff (31MB)
As MTRRs need to be a power-of-2, thats non-fun.

An NVIDIA GeForce256 --
Prefetchable memory behind bridge: d0000000-d7ffffff (127MB)

Ok, looks like a pattern but some systems with onboard gfx do this..
Prefetchable memory behind bridge: d8000000-dc0fffff (64MB)

There also exist some AGP cards which don't seem to use AGP features,
and have their range listed as fff00000-000fffff, which means
"I have no RAM" iirc.

The heuristics to get all this right would likely be a real mess,
so I feel its better to do it in the gfx card specific driver.


An even better solution would be to get PAT support into the kernel
so we can forget MTRRs ever existed.

Dave

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/