projects
/
firefly-linux-kernel-4.4.55.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bb6baf7
)
drm/i915: Warn before mmaping a purgeable buffer.
author
Chris Wilson
<chris@chris-wilson.co.uk>
Tue, 22 Sep 2009 17:46:17 +0000
(18:46 +0100)
committer
Chris Wilson
<chris@chris-wilson.co.uk>
Wed, 23 Sep 2009 00:10:39 +0000
(
01:10
+0100)
Only allow the user to mmap buffers that have not been marked as
purgeable.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
drivers/gpu/drm/i915/i915_gem.c
patch
|
blob
|
history
diff --git
a/drivers/gpu/drm/i915/i915_gem.c
b/drivers/gpu/drm/i915/i915_gem.c
index f4f714e39b7b6e2f15db60dd1065710ebdf75c75..4755ba41bfef92ac27e72f47287bed8f37e185cb 100644
(file)
--- 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,
obj_priv = obj->driver_private;
+ if (obj_priv->madv != I915_MADV_WILLNEED) {
+ DRM_ERROR("Attempting to mmap a purgeable buffer\n");
+ drm_gem_object_unreference(obj);
+ mutex_unlock(&dev->struct_mutex);
+ return -EINVAL;
+ }
+
+
if (!obj_priv->mmap_offset) {
ret = i915_gem_create_mmap_offset(obj);
if (ret) {