aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2012-04-23 10:50:50 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-05-03 05:18:14 -0400
commit63ed2cb2d15019edf8af324479028996046c8631 (patch)
tree538c7bfbab43b996ec26edb2d0a2ced7bf12fcd5 /drivers/gpu
parent7bb6fb8dd958ae773ac205282e3c0b56c22e01ed (diff)
drm/i915: rip out GEM drm feature checks
We always set it so there's no point in checking. We could instead add a bit that tells us whether gem is actually initialized (i.e. either kms or gem_init_ioctl called), but that's imho not worth it. So just rip it out. There's a little change in the wait_ring timeout, but we've never run with anything else than the 60 second timeout, even on dri1 userspace. Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c19
-rw-r--r--drivers/gpu/drm/i915/intel_ringbuffer.c15
2 files changed, 7 insertions, 27 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 1b808d041949..0d53eacd293f 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -168,9 +168,6 @@ i915_gem_get_aperture_ioctl(struct drm_device *dev, void *data,
168 struct drm_i915_gem_object *obj; 168 struct drm_i915_gem_object *obj;
169 size_t pinned; 169 size_t pinned;
170 170
171 if (!(dev->driver->driver_features & DRIVER_GEM))
172 return -ENODEV;
173
174 pinned = 0; 171 pinned = 0;
175 mutex_lock(&dev->struct_mutex); 172 mutex_lock(&dev->struct_mutex);
176 list_for_each_entry(obj, &dev_priv->mm.gtt_list, gtt_list) 173 list_for_each_entry(obj, &dev_priv->mm.gtt_list, gtt_list)
@@ -246,6 +243,7 @@ i915_gem_create_ioctl(struct drm_device *dev, void *data,
246 struct drm_file *file) 243 struct drm_file *file)
247{ 244{
248 struct drm_i915_gem_create *args = data; 245 struct drm_i915_gem_create *args = data;
246
249 return i915_gem_create(file, dev, 247 return i915_gem_create(file, dev,
250 args->size, &args->handle); 248 args->size, &args->handle);
251} 249}
@@ -931,9 +929,6 @@ i915_gem_set_domain_ioctl(struct drm_device *dev, void *data,
931 uint32_t write_domain = args->write_domain; 929 uint32_t write_domain = args->write_domain;
932 int ret; 930 int ret;
933 931
934 if (!(dev->driver->driver_features & DRIVER_GEM))
935 return -ENODEV;
936
937 /* Only handle setting domains to types used by the CPU. */ 932 /* Only handle setting domains to types used by the CPU. */
938 if (write_domain & I915_GEM_GPU_DOMAINS) 933 if (write_domain & I915_GEM_GPU_DOMAINS)
939 return -EINVAL; 934 return -EINVAL;
@@ -987,9 +982,6 @@ i915_gem_sw_finish_ioctl(struct drm_device *dev, void *data,
987 struct drm_i915_gem_object *obj; 982 struct drm_i915_gem_object *obj;
988 int ret = 0; 983 int ret = 0;
989 984
990 if (!(dev->driver->driver_features & DRIVER_GEM))
991 return -ENODEV;
992
993 ret = i915_mutex_lock_interruptible(dev); 985 ret = i915_mutex_lock_interruptible(dev);
994 if (ret) 986 if (ret)
995 return ret; 987 return ret;
@@ -1025,9 +1017,6 @@ i915_gem_mmap_ioctl(struct drm_device *dev, void *data,
1025 struct drm_gem_object *obj; 1017 struct drm_gem_object *obj;
1026 unsigned long addr; 1018 unsigned long addr;
1027 1019
1028 if (!(dev->driver->driver_features & DRIVER_GEM))
1029 return -ENODEV;
1030
1031 obj = drm_gem_object_lookup(dev, file, args->handle); 1020 obj = drm_gem_object_lookup(dev, file, args->handle);
1032 if (obj == NULL) 1021 if (obj == NULL)
1033 return -ENOENT; 1022 return -ENOENT;
@@ -1255,9 +1244,6 @@ i915_gem_mmap_gtt(struct drm_file *file,
1255 struct drm_i915_gem_object *obj; 1244 struct drm_i915_gem_object *obj;
1256 int ret; 1245 int ret;
1257 1246
1258 if (!(dev->driver->driver_features & DRIVER_GEM))
1259 return -ENODEV;
1260
1261 ret = i915_mutex_lock_interruptible(dev); 1247 ret = i915_mutex_lock_interruptible(dev);
1262 if (ret) 1248 if (ret)
1263 return ret; 1249 return ret;
@@ -1315,9 +1301,6 @@ i915_gem_mmap_gtt_ioctl(struct drm_device *dev, void *data,
1315{ 1301{
1316 struct drm_i915_gem_mmap_gtt *args = data; 1302 struct drm_i915_gem_mmap_gtt *args = data;
1317 1303
1318 if (!(dev->driver->driver_features & DRIVER_GEM))
1319 return -ENODEV;
1320
1321 return i915_gem_mmap_gtt(file, dev, args->handle, &args->offset); 1304 return i915_gem_mmap_gtt(file, dev, args->handle, &args->offset);
1322} 1305}
1323 1306
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index b7f446ee28da..427b7c55ffe0 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -1164,15 +1164,12 @@ int intel_wait_ring_buffer(struct intel_ring_buffer *ring, int n)
1164 return ret; 1164 return ret;
1165 1165
1166 trace_i915_ring_wait_begin(ring); 1166 trace_i915_ring_wait_begin(ring);
1167 if (drm_core_check_feature(dev, DRIVER_GEM)) 1167 /* With GEM the hangcheck timer should kick us out of the loop,
1168 /* With GEM the hangcheck timer should kick us out of the loop, 1168 * leaving it early runs the risk of corrupting GEM state (due
1169 * leaving it early runs the risk of corrupting GEM state (due 1169 * to running on almost untested codepaths). But on resume
1170 * to running on almost untested codepaths). But on resume 1170 * timers don't work yet, so prevent a complete hang in that
1171 * timers don't work yet, so prevent a complete hang in that 1171 * case by choosing an insanely large timeout. */
1172 * case by choosing an insanely large timeout. */ 1172 end = jiffies + 60 * HZ;
1173 end = jiffies + 60 * HZ;
1174 else
1175 end = jiffies + 3 * HZ;
1176 1173
1177 do { 1174 do {
1178 ring->head = I915_READ_HEAD(ring); 1175 ring->head = I915_READ_HEAD(ring);