]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915/selftests: Report ENOMEM clearly for an allocation failure
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 17 Nov 2017 16:29:45 +0000 (16:29 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 17 Nov 2017 18:20:36 +0000 (18:20 +0000)
commit6700469358fdd7ab28cb9edb5f28a432d1fae87a
tree1cfd2995c8b38bd72dc90fc785ca9ff90ca64ff8
parent25b1d7d20afcfce3af24f8dd1a383abd334cb816
drm/i915/selftests: Report ENOMEM clearly for an allocation failure

If we can not run the drunk_hole test because we couldn't allocate the
memory for the permutation array (even after we tried trimming the
size), report a clear ENOMEM. Similary, if we are asked to operate on a
hole too small for ourselves, make it skip quietly.

v2: Avoid malloc(0) since that returns ZERO_SIZE_PTR not NULL.
v3: Fixup similar construction for lowlevel_hole
v4: Use u64 >> 1 to avoid 64b div.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171117101732.4335-1-chris@chris-wilson.co.uk
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171117162945.16390-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/selftests/i915_gem_gtt.c