summaryrefslogtreecommitdiff
path: root/src/sna/kgem.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-08-09 10:07:59 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-08-09 11:09:42 +0100
commitf1d3d1f8c677b938362eee8b9f4e81f5463bc16a (patch)
treed65588d20f13ccd06c7714552b5586fc0c3e6133 /src/sna/kgem.c
parent039a64e89e0323bd02eec24fba21a3924ee5cc31 (diff)
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>
Diffstat (limited to 'src/sna/kgem.c')
-rw-r--r--src/sna/kgem.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index a04b9549..fea7dcbf 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -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;