drm/i915: Treat stolen memory as DMA addresses
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 27 Jan 2017 16:55:30 +0000 (16:55 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Tue, 31 Jan 2017 11:16:07 +0000 (11:16 +0000)
commitc88473878d47131ccfc67a00ba688d4d7d0f4519
tree772660e15b308c4333da02d556840c71900b7327
parent4703b0472e126c715019a9671ea0fe38556114bb
drm/i915: Treat stolen memory as DMA addresses

The conversion of stolen to use phys_addr_t (from essentially u32)
sparked an interesting discussion. We treat stolen memory as only
accessible from the GPU (the DMA device) - an attempt to use it from the
CPU will generate a MCE on gen6 onwards, although it is in theory a
physical address that can be dereferenced from the CPU as demonstrated
by earlier generations. As such, using phys_addr_t has the wrong
connotations and as we pass the address into the DMA device via
dma_addr_t (through the scatterlists used to program the GTT entries),
we should treat it as dma_addr_t throughout.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170127165531.28135-1-chris@chris-wilson.co.uk
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_gem_stolen.c