tests/gem_mmap_gtt: add huge BO test

Add a straightforward test that allocates a BO that is bigger than
(by 1 page currently) the mappable aperture, tests mmap access to it
by CPU directly and through GTT in sequence.

Currently it is expected for the GTT access to gracefully fail as
all objects are attempted to get pinned to GTT completely for mmap
access. Once the partial view support is merged to kernel, the test
should pass for all parts.

v2:
- Corrected BO domain handling (Chris Wilson)
- Check again after GTT access for added paranoia (Chris Wilson)

v3:
- Avoid flush by using pread (Chris Wilson)
- Free gtt_pattern buffer too.

v4:
- Add more comments (Tvrtko Ursulin)
- Use igt_require (Tvrtko Ursulin)

v5:
- Remove wrong message from igt_require_f (Tvrtko Ursulin)
- After digging deeper to it, just igt_assert that the CPU
  mapping needs to succeed.

Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
[Thomas: remove unused label]
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
1 file changed