OSDN Git Service

drm/i915: buddy allocator
authorMatthew Auld <matthew.auld@intel.com>
Fri, 9 Aug 2019 20:29:24 +0000 (21:29 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Sat, 10 Aug 2019 18:47:40 +0000 (19:47 +0100)
commit14d1b9a6247c4548015d940ca92dbea05c0245bb
tree2fb7c79a425eeb57ba6f5dbed109f2e6a674be6a
parent05f219d709ec5775b631b383860d3b4c8691a45f
drm/i915: buddy allocator

Simple buddy allocator. We want to allocate properly aligned
power-of-two blocks to promote usage of huge-pages for the GTT, so 64K,
2M and possibly even 1G. While we do support allocating stuff at a
specific offset, it is more intended for preallocating portions of the
address space, say for an initial framebuffer, for other uses drm_mm is
probably a much better fit. Anyway, hopefully this can all be thrown
away if we eventually move to having the core MM manage device memory.

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20190809202926.14545-2-matthew.auld@intel.com
drivers/gpu/drm/i915/Makefile
drivers/gpu/drm/i915/i915_buddy.c [new file with mode: 0644]
drivers/gpu/drm/i915/i915_buddy.h [new file with mode: 0644]
drivers/gpu/drm/i915/i915_globals.c
drivers/gpu/drm/i915/i915_globals.h
drivers/gpu/drm/i915/selftests/i915_buddy.c [new file with mode: 0644]
drivers/gpu/drm/i915/selftests/i915_mock_selftests.h