drm/i915/gem: Apply lmem size restriction to get_pages
authorChris Wilson <chris@chris-wilson.co.uk>
Mon, 16 Dec 2019 12:26:03 +0000 (12:26 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Mon, 16 Dec 2019 23:13:12 +0000 (23:13 +0000)
commit0a9a5532d2962a74004e041eeb2217de930f8c27
tree002a6ff59443b6b210ce7c917add4038daf166fe
parent884054403393a46ae88f24b0d76581278222f5ce
drm/i915/gem: Apply lmem size restriction to get_pages

When creating a handle, it is just that, an abstract handle. The fact
that we cannot currently support a handle larger than the size of the
backing storage is an artifact of our whole-object-at-a-time handling in
get_pages() and being an implementation limitation is best handled at
that point -- similar to shmem, where we only barf when asked to
populate the whole object if larger than RAM. (Pinning the whole object
at a time is major hindrance that we are likely to have to overcome in
the near future.) In the case of the buddy allocator, the late check is
preferable as the request size may often be smaller than the required
size.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191216122603.2598155-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/gem/i915_gem_lmem.c
drivers/gpu/drm/i915/gem/selftests/huge_pages.c
drivers/gpu/drm/i915/intel_memory_region.c