aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2014-11-24 05:12:42 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-12-03 03:29:35 -0500
commitd472fcc8379c062bd56a3876fc6ef22258f14a91 (patch)
treee8800184aa8beea145c25732a36f4ed260bccdbe
parent2b387059817fd100cddc5a97118d63e3f3fade74 (diff)
drm/i915: Disallow pin ioctl completely for kms drivers
The problem here is that SNA pins batchbuffers to etch out a bit more performance. Iirc it started out as a w/a for i830M (which we've implemented in the kernel since a long time already). The problem is that the pin ioctl wasn't added in commit d23db88c3ab233daed18709e3a24d6c95344117f Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Fri May 23 08:48:08 2014 +0200 drm/i915: Prevent negative relocation deltas from wrapping Fix this by simply disallowing pinning from userspace so that the kernel is in full control of batch placement again. Especially since distros are moving towards running X as non-root, so most users won't even be able to see any benefits. UMS support is dead now, but we need this minimal patch for backporting. Follow-up patch will remove the pin ioctl code completely. Note to backporters: You must have both commit b45305fce5bb1abec263fcff9d81ebecd6306ede Author: Daniel Vetter <daniel.vetter@ffwll.ch> Date: Mon Dec 17 16:21:27 2012 +0100 drm/i915: Implement workaround for broken CS tlb on i830/845 which laned in 3.8 and commit c4d69da167fa967749aeb70bc0e94a457e5d00c1 Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Mon Sep 8 14:25:41 2014 +0100 drm/i915: Evict CS TLBs between batches which is also marked cc: stable. Otherwise this could introduce a regression by disabling the userspace w/a without the kernel w/a being fully functional on i830/45. References: https://bugs.freedesktop.org/show_bug.cgi?id=76554#c116 Cc: stable@vger.kernel.org # requires c4d69da167fa967749a and v3.8 Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index fd17ccabd8a4..97b86a55e138 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -4263,7 +4263,7 @@ i915_gem_pin_ioctl(struct drm_device *dev, void *data,
4263 struct drm_i915_gem_object *obj; 4263 struct drm_i915_gem_object *obj;
4264 int ret; 4264 int ret;
4265 4265
4266 if (INTEL_INFO(dev)->gen >= 6) 4266 if (drm_core_check_feature(dev, DRIVER_MODESET))
4267 return -ENODEV; 4267 return -ENODEV;
4268 4268
4269 ret = i915_mutex_lock_interruptible(dev); 4269 ret = i915_mutex_lock_interruptible(dev);
@@ -4319,6 +4319,9 @@ i915_gem_unpin_ioctl(struct drm_device *dev, void *data,
4319 struct drm_i915_gem_object *obj; 4319 struct drm_i915_gem_object *obj;
4320 int ret; 4320 int ret;
4321 4321
4322 if (drm_core_check_feature(dev, DRIVER_MODESET))
4323 return -ENODEV;
4324
4322 ret = i915_mutex_lock_interruptible(dev); 4325 ret = i915_mutex_lock_interruptible(dev);
4323 if (ret) 4326 if (ret)
4324 return ret; 4327 return ret;