On Tue, Oct 18, 2016 at 04:13:10PM +1000, Dave Airlie wrote:
> Okay I spent some time looking into it, and this is the result.
> We have to manually insert the VRAM BAR into the pat memory tracking
> table as WC. The only other way things get inserted are via ioremap,
> which we never do for the whole VRAM BAR. We could in theory map
> the VRAM BAR using the iomap stuff that i915 uses, but we don't
> and this seems easier for now.
> We have to fix up at least nouveau and radeon I think as well.

We have something pretty close to this in i915 already, in i915/i915_mm.c.
Our idea was to reuse struct io_mapping, since that one already tracks the
cache type for us (so that it could do the on-demand kmap stuff properly).
Extending that to writing userspace ptes was pretty straightforward. And
it has the upshot that it keeps the memtype tracking encapsulated (at
least if we'd move the helper from i915_mm.c into core).
Daniel Vetter
Software Engineer, Intel Corporation
amd-gfx mailing list

Reply via email to