OSDN Git Service

intel: tools: aub_mem: reuse already mapped ppgtt buffers
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Mon, 6 Aug 2018 11:06:13 +0000 (12:06 +0100)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Wed, 22 Aug 2018 17:02:11 +0000 (18:02 +0100)
commit4ba12e8c54d530a0034ba714bb0b95dbf3940b40
treee35c2ccdc877c4be208dcd60083f32664bea7eda
parent8fd78b4eea9e54ff77fdde64b154481620b2971f
intel: tools: aub_mem: reuse already mapped ppgtt buffers

When we map a PPGTT buffer into a continous address space of aubinator
to be able to inspect it, we currently add it to the list of BOs to
unmap once we're finished. An optimization we can apply it to look up
that list before trying to remap PPGTT buffers again (we already do
this for GGTT buffers).

We need to take some care before doing this because the list also
contains GGTT BOs. As GGTT & PPGTT are 2 different address spaces, we
can have matching addresses in both that point to different physical
locations.

This changes adds a flag on the elements of the list of mapped BOs to
differenciate between GGTT & PPGTT, which allows use to reuse that
list when looking up both address spaces.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
src/intel/tools/aub_mem.c