All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] drm/i915: use gem_set_seqno() on hardware init
@ 2013-01-22 12:12 Mika Kuoppala
  2013-01-22 12:28 ` Chris Wilson
  0 siblings, 1 reply; 3+ messages in thread
From: Mika Kuoppala @ 2013-01-22 12:12 UTC (permalink / raw)
  To: intel-gfx

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>
---
 drivers/gpu/drm/i915/i915_gem.c         |    6 ++++--
 drivers/gpu/drm/i915/intel_ringbuffer.c |    2 --
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index d90d2f9..1a61d99 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -3979,8 +3979,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;
@@ -3997,6 +3995,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.
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index 2bd074a..1bb2ec5 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -1184,8 +1184,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:
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] drm/i915: use gem_set_seqno() on hardware init
  2013-01-22 12:12 [PATCH 1/1] drm/i915: use gem_set_seqno() on hardware init Mika Kuoppala
@ 2013-01-22 12:28 ` Chris Wilson
  2013-01-22 12:56   ` Daniel Vetter
  0 siblings, 1 reply; 3+ messages in thread
From: Chris Wilson @ 2013-01-22 12:28 UTC (permalink / raw)
  To: Mika Kuoppala; +Cc: intel-gfx

On Tue, Jan 22, 2013 at 02:12:17PM +0200, Mika Kuoppala wrote:
> 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.

Nice catch, and you caught the only other side-effect I could spot of
moving the seqno init, so

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] drm/i915: use gem_set_seqno() on hardware init
  2013-01-22 12:28 ` Chris Wilson
@ 2013-01-22 12:56   ` Daniel Vetter
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Vetter @ 2013-01-22 12:56 UTC (permalink / raw)
  To: Chris Wilson, Mika Kuoppala, intel-gfx

On Tue, Jan 22, 2013 at 12:28:16PM +0000, Chris Wilson wrote:
> On Tue, Jan 22, 2013 at 02:12:17PM +0200, Mika Kuoppala wrote:
> > 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.
> 
> Nice catch, and you caught the only other side-effect I could spot of
> moving the seqno init, so
> 
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>

Queued for -next, thanks for the patch.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-01-22 12:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-22 12:12 [PATCH 1/1] drm/i915: use gem_set_seqno() on hardware init Mika Kuoppala
2013-01-22 12:28 ` Chris Wilson
2013-01-22 12:56   ` Daniel Vetter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.