diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-06-19 17:16:01 +0200 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-06-20 11:19:20 +0200 |
commit | 5fa8be65e950e4f2a4e7dc31f823fca41b9e650e (patch) | |
tree | 28911378984e09c52d2a1d8a30ae5d48acbd339c /drivers | |
parent | 73c273eb7547d2557b49f9d1f42e298145c1e635 (diff) |
drm/i915: return -ENODEV if hw context are not supported
Otherwise userspace has no way to figure this out.
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_context.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c index 1b5041c5256..e58e8366f47 100644 --- a/drivers/gpu/drm/i915/i915_gem_context.c +++ b/drivers/gpu/drm/i915/i915_gem_context.c @@ -480,6 +480,7 @@ int i915_switch_context(struct intel_ring_buffer *ring, int i915_gem_context_create_ioctl(struct drm_device *dev, void *data, struct drm_file *file) { + struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_gem_context_create *args = data; struct drm_i915_file_private *file_priv = file->driver_priv; struct i915_hw_context *ctx; @@ -488,6 +489,9 @@ int i915_gem_context_create_ioctl(struct drm_device *dev, void *data, if (!(dev->driver->driver_features & DRIVER_GEM)) return -ENODEV; + if (dev_priv->hw_contexts_disabled) + return -ENODEV; + ret = i915_mutex_lock_interruptible(dev); if (ret) return ret; |