drm/i915: rip out GEM drm feature checks
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 23 Apr 2012 14:50:50 +0000 (16:50 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 3 May 2012 09:18:14 +0000 (11:18 +0200)
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>
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/intel_ringbuffer.c

index 1b808d0419498894f415f2ad727aab55b8b25496..0d53eacd293f2993643d136605de5fcd0c01a6d5 100644 (file)
@@ -168,9 +168,6 @@ i915_gem_get_aperture_ioctl(struct drm_device *dev, void *data,
        struct drm_i915_gem_object *obj;
        size_t pinned;
 
-       if (!(dev->driver->driver_features & DRIVER_GEM))
-               return -ENODEV;
-
        pinned = 0;
        mutex_lock(&dev->struct_mutex);
        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,
                      struct drm_file *file)
 {
        struct drm_i915_gem_create *args = data;
+
        return i915_gem_create(file, dev,
                               args->size, &args->handle);
 }
@@ -931,9 +929,6 @@ i915_gem_set_domain_ioctl(struct drm_device *dev, void *data,
        uint32_t write_domain = args->write_domain;
        int ret;
 
-       if (!(dev->driver->driver_features & DRIVER_GEM))
-               return -ENODEV;
-
        /* Only handle setting domains to types used by the CPU. */
        if (write_domain & I915_GEM_GPU_DOMAINS)
                return -EINVAL;
@@ -987,9 +982,6 @@ i915_gem_sw_finish_ioctl(struct drm_device *dev, void *data,
        struct drm_i915_gem_object *obj;
        int ret = 0;
 
-       if (!(dev->driver->driver_features & DRIVER_GEM))
-               return -ENODEV;
-
        ret = i915_mutex_lock_interruptible(dev);
        if (ret)
                return ret;
@@ -1025,9 +1017,6 @@ i915_gem_mmap_ioctl(struct drm_device *dev, void *data,
        struct drm_gem_object *obj;
        unsigned long addr;
 
-       if (!(dev->driver->driver_features & DRIVER_GEM))
-               return -ENODEV;
-
        obj = drm_gem_object_lookup(dev, file, args->handle);
        if (obj == NULL)
                return -ENOENT;
@@ -1255,9 +1244,6 @@ i915_gem_mmap_gtt(struct drm_file *file,
        struct drm_i915_gem_object *obj;
        int ret;
 
-       if (!(dev->driver->driver_features & DRIVER_GEM))
-               return -ENODEV;
-
        ret = i915_mutex_lock_interruptible(dev);
        if (ret)
                return ret;
@@ -1315,9 +1301,6 @@ i915_gem_mmap_gtt_ioctl(struct drm_device *dev, void *data,
 {
        struct drm_i915_gem_mmap_gtt *args = data;
 
-       if (!(dev->driver->driver_features & DRIVER_GEM))
-               return -ENODEV;
-
        return i915_gem_mmap_gtt(file, dev, args->handle, &args->offset);
 }
 
index b7f446ee28da70feaf71e5db4b1209caad156420..427b7c55ffe0de9feddb3ba878f2b060a603cdb6 100644 (file)
@@ -1164,15 +1164,12 @@ int intel_wait_ring_buffer(struct intel_ring_buffer *ring, int n)
                return ret;
 
        trace_i915_ring_wait_begin(ring);
-       if (drm_core_check_feature(dev, DRIVER_GEM))
-               /* With GEM the hangcheck timer should kick us out of the loop,
-                * leaving it early runs the risk of corrupting GEM state (due
-                * to running on almost untested codepaths). But on resume
-                * timers don't work yet, so prevent a complete hang in that
-                * case by choosing an insanely large timeout. */
-               end = jiffies + 60 * HZ;
-       else
-               end = jiffies + 3 * HZ;
+       /* With GEM the hangcheck timer should kick us out of the loop,
+        * leaving it early runs the risk of corrupting GEM state (due
+        * to running on almost untested codepaths). But on resume
+        * timers don't work yet, so prevent a complete hang in that
+        * case by choosing an insanely large timeout. */
+       end = jiffies + 60 * HZ;
 
        do {
                ring->head = I915_READ_HEAD(ring);