diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-04-24 08:29:42 +0200 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-05-03 11:18:14 +0200 |
commit | cd9d4e9f9fa2809dedc637406fa15016bfcb2ad0 (patch) | |
tree | 004796f781c192f694486b97667fc9e271a44fc9 /drivers/gpu/drm/i915/i915_irq.c | |
parent | drm/i915: rip out dev_priv->has_gem (diff) | |
download | linux-cd9d4e9f9fa2809dedc637406fa15016bfcb2ad0.tar.xz linux-cd9d4e9f9fa2809dedc637406fa15016bfcb2ad0.zip |
drm/i915: check for kms in dri1 ioctls
Calling these when gem assumes full control of the hw won't end
in anything else than tears. So be a bit more paranoid here.
Just serves as documentation.
v2: Bail out with ENODEV as suggested by Chris Wilson.
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_irq.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_irq.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 24e1dd252575..0211263aad7d 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c @@ -1612,6 +1612,9 @@ int i915_irq_emit(struct drm_device *dev, void *data, drm_i915_irq_emit_t *emit = data; int result; + if (drm_core_check_feature(dev, DRIVER_MODESET)) + return -ENODEV; + if (!dev_priv || !LP_RING(dev_priv)->virtual_start) { DRM_ERROR("called with no initialization\n"); return -EINVAL; @@ -1639,6 +1642,9 @@ int i915_irq_wait(struct drm_device *dev, void *data, drm_i915_private_t *dev_priv = dev->dev_private; drm_i915_irq_wait_t *irqwait = data; + if (drm_core_check_feature(dev, DRIVER_MODESET)) + return -ENODEV; + if (!dev_priv) { DRM_ERROR("called with no initialization\n"); return -EINVAL; @@ -1801,6 +1807,9 @@ int i915_vblank_pipe_set(struct drm_device *dev, void *data, { drm_i915_private_t *dev_priv = dev->dev_private; + if (drm_core_check_feature(dev, DRIVER_MODESET)) + return -ENODEV; + if (!dev_priv) { DRM_ERROR("called with no initialization\n"); return -EINVAL; @@ -1815,6 +1824,9 @@ int i915_vblank_pipe_get(struct drm_device *dev, void *data, drm_i915_private_t *dev_priv = dev->dev_private; drm_i915_vblank_pipe_t *pipe = data; + if (drm_core_check_feature(dev, DRIVER_MODESET)) + return -ENODEV; + if (!dev_priv) { DRM_ERROR("called with no initialization\n"); return -EINVAL; |