drm: Add colouring to the range allocator
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 10 Jul 2012 10:15:23 +0000 (11:15 +0100)
committerDave Airlie <airlied@gmail.com>
Sun, 15 Jul 2012 19:59:37 +0000 (05:59 +1000)
commit6b9d89b4365ab52bc26f8259122f422e93d87821
tree4084be89a72fe6d0575477e986ca2ff5e4b0e5f0
parent49099c4991da3c94773f888aea2e9d27b8a7c6d1
drm: Add colouring to the range allocator

In order to support snoopable memory on non-LLC architectures (so that
we can bind vgem objects into the i915 GATT for example), we have to
avoid the prefetcher on the GPU from crossing memory domains and so
prevent allocation of a snoopable PTE immediately following an uncached
PTE. To do that, we need to extend the range allocator with support for
tracking and segregating different node colours.

This will be used by i915 to segregate memory domains within the GTT.

v2: Now with more drm_mm helpers and less driver interference.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Dave Airlie <airlied@redhat.com
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Jerome Glisse <jglisse@redhat.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@gmail.com>
drivers/gpu/drm/drm_gem.c
drivers/gpu/drm/drm_mm.c
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/i915_gem_evict.c
include/drm/drm_mm.h