sna: Check for EINVAL after mmapping

I want to catch this error as it happens to see which (stolen) bo is
being erroneously mmapped.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2013-08-09 10:07:59 +01:00
parent 039a64e89e
commit f1d3d1f8c6
1 changed files with 8 additions and 0 deletions

View File

@ -335,6 +335,8 @@ retry_gtt:
if (drmIoctl(kgem->fd, DRM_IOCTL_I915_GEM_MMAP_GTT, &mmap_arg)) {
int err = errno;
assert(err != EINVAL);
(void)__kgem_throttle_retire(kgem, 0);
if (kgem_expire_cache(kgem))
goto retry_gtt;
@ -355,6 +357,8 @@ retry_mmap:
if (ptr == MAP_FAILED) {
int err = errno;
assert(err != EINVAL);
if (__kgem_throttle_retire(kgem, 0))
goto retry_mmap;
@ -5056,6 +5060,8 @@ retry:
if (drmIoctl(kgem->fd, DRM_IOCTL_I915_GEM_MMAP, &mmap_arg)) {
int err = errno;
assert(err != EINVAL);
if (__kgem_throttle_retire(kgem, 0))
goto retry;
@ -5098,6 +5104,8 @@ retry:
if (drmIoctl(kgem->fd, DRM_IOCTL_I915_GEM_MMAP, &mmap_arg)) {
int err = errno;
assert(err != EINVAL);
if (__kgem_throttle_retire(kgem, 0))
goto retry;