drm/i915: use gem_set_seqno() on hardware init
authorMika Kuoppala <mika.kuoppala@linux.intel.com>
Tue, 22 Jan 2013 12:12:17 +0000 (14:12 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 22 Jan 2013 12:52:26 +0000 (13:52 +0100)
When machine was rebooted or module was reloaded,
gem_hw_init() set last_seqno to be identical to next_seqno.
This lead to situation that waits for first ever request
always passed immediately regardless if it was actually
executed.

Use gem_set_seqno() to be consistent how hw is
initialized on init, wrap and on resume.

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
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 5226ebcac33afa53b1daea5a1e9ee791de2cfb18..801f77ece72e5586e842b176a8d0daaec4e7440c 100644 (file)
@@ -3941,8 +3941,6 @@ i915_gem_init_hw(struct drm_device *dev)
 
        i915_gem_init_swizzling(dev);
 
-       dev_priv->next_seqno = dev_priv->last_seqno = (u32)~0 - 0x1000;
-
        ret = intel_init_render_ring_buffer(dev);
        if (ret)
                return ret;
@@ -3959,6 +3957,10 @@ i915_gem_init_hw(struct drm_device *dev)
                        goto cleanup_bsd_ring;
        }
 
+       ret = i915_gem_set_seqno(dev, ((u32)~0 - 0x1000));
+       if (ret)
+               return ret;
+
        /*
         * XXX: There was some w/a described somewhere suggesting loading
         * contexts before PPGTT.
index 9438bcd506786c04963bce03b8ea86002275d244..dc6ae2fa1ceedc8aa413cb6d13f6a670a78c8015 100644 (file)
@@ -1223,8 +1223,6 @@ static int intel_init_ring_buffer(struct drm_device *dev,
        if (IS_I830(ring->dev) || IS_845G(ring->dev))
                ring->effective_size -= 128;
 
-       intel_ring_init_seqno(ring, dev_priv->last_seqno);
-
        return 0;
 
 err_unmap: