drm/i915: protect ringbuffer sarea update behind !MODESET
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 12 Feb 2014 22:44:34 +0000 (23:44 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 12 Feb 2014 22:44:34 +0000 (23:44 +0100)
Avoids surprises when userspace races open/closes against this.

Cc: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_ringbuffer.c

index ba686d75ff32bb289c87583d4ec4b78c056ce59a..ae6d234b8c12c0865a0914c869e5436e715367dc 100644 (file)
@@ -1513,7 +1513,8 @@ static int ring_wait_for_space(struct intel_ring_buffer *ring, int n)
                        return 0;
                }
 
-               if (dev->primary->master) {
+               if (!drm_core_check_feature(dev, DRIVER_MODESET) &&
+                   dev->primary->master) {
                        struct drm_i915_master_private *master_priv = dev->primary->master->driver_priv;
                        if (master_priv->sarea_priv)
                                master_priv->sarea_priv->perf_boxes |= I915_BOX_WAIT;