Skip to content

Commit

Permalink
drm/i915: return -ENODEV if hw context are not supported
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Daniel Vetter committed Jun 20, 2012
1 parent 73c273e commit 5fa8be6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/gpu/drm/i915/i915_gem_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 5fa8be6

Please sign in to comment.