diff options
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index f4f714e39b7b..4755ba41bfef 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -1431,6 +1431,14 @@ i915_gem_mmap_gtt_ioctl(struct drm_device *dev, void *data, | |||
1431 | 1431 | ||
1432 | obj_priv = obj->driver_private; | 1432 | obj_priv = obj->driver_private; |
1433 | 1433 | ||
1434 | if (obj_priv->madv != I915_MADV_WILLNEED) { | ||
1435 | DRM_ERROR("Attempting to mmap a purgeable buffer\n"); | ||
1436 | drm_gem_object_unreference(obj); | ||
1437 | mutex_unlock(&dev->struct_mutex); | ||
1438 | return -EINVAL; | ||
1439 | } | ||
1440 | |||
1441 | |||
1434 | if (!obj_priv->mmap_offset) { | 1442 | if (!obj_priv->mmap_offset) { |
1435 | ret = i915_gem_create_mmap_offset(obj); | 1443 | ret = i915_gem_create_mmap_offset(obj); |
1436 | if (ret) { | 1444 | if (ret) { |