All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: No busy-loop wait_for in the ring init code
@ 2014-08-07 14:07 Daniel Vetter
  2014-08-07 14:12 ` Chris Wilson
  2014-08-07 14:15 ` Chris Wilson
  0 siblings, 2 replies; 4+ messages in thread
From: Daniel Vetter @ 2014-08-07 14:07 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter, Naresh Kumar Kachhi

Doing a 1s wait (tops) with the cpu is a bit excessive. Tune it down
like everything else in that code.

Cc: Naresh Kumar Kachhi <naresh.kumar.kachhi@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/intel_ringbuffer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index 05969f03c0c1..966d8f72da45 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -476,7 +476,7 @@ static bool stop_ring(struct intel_engine_cs *ring)
 
 	if (!IS_GEN2(ring->dev)) {
 		I915_WRITE_MODE(ring, _MASKED_BIT_ENABLE(STOP_RING));
-		if (wait_for_atomic((I915_READ_MODE(ring) & MODE_IDLE) != 0, 1000)) {
+		if (wait_for((I915_READ_MODE(ring) & MODE_IDLE) != 0, 1000)) {
 			DRM_ERROR("%s :timed out trying to stop ring\n", ring->name);
 			return false;
 		}
-- 
2.0.1

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

* Re: [PATCH] drm/i915: No busy-loop wait_for in the ring init code
  2014-08-07 14:07 [PATCH] drm/i915: No busy-loop wait_for in the ring init code Daniel Vetter
@ 2014-08-07 14:12 ` Chris Wilson
  2014-08-07 14:15 ` Chris Wilson
  1 sibling, 0 replies; 4+ messages in thread
From: Chris Wilson @ 2014-08-07 14:12 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Intel Graphics Development, Naresh Kumar Kachhi

On Thu, Aug 07, 2014 at 04:07:59PM +0200, Daniel Vetter wrote:
> Doing a 1s wait (tops) with the cpu is a bit excessive. Tune it down
> like everything else in that code.

1s? Didn't wait_for_atomic() take a timeout in microseconds?
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

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

* Re: [PATCH] drm/i915: No busy-loop wait_for in the ring init code
  2014-08-07 14:07 [PATCH] drm/i915: No busy-loop wait_for in the ring init code Daniel Vetter
  2014-08-07 14:12 ` Chris Wilson
@ 2014-08-07 14:15 ` Chris Wilson
  2014-08-08 15:43   ` Daniel Vetter
  1 sibling, 1 reply; 4+ messages in thread
From: Chris Wilson @ 2014-08-07 14:15 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Intel Graphics Development, Naresh Kumar Kachhi

On Thu, Aug 07, 2014 at 04:07:59PM +0200, Daniel Vetter wrote:
> Doing a 1s wait (tops) with the cpu is a bit excessive. Tune it down
> like everything else in that code.
> 
> Cc: Naresh Kumar Kachhi <naresh.kumar.kachhi@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
>  drivers/gpu/drm/i915/intel_ringbuffer.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
> index 05969f03c0c1..966d8f72da45 100644
> --- a/drivers/gpu/drm/i915/intel_ringbuffer.c
> +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
> @@ -476,7 +476,7 @@ static bool stop_ring(struct intel_engine_cs *ring)
>  
>  	if (!IS_GEN2(ring->dev)) {
>  		I915_WRITE_MODE(ring, _MASKED_BIT_ENABLE(STOP_RING));
> -		if (wait_for_atomic((I915_READ_MODE(ring) & MODE_IDLE) != 0, 1000)) {
> +		if (wait_for((I915_READ_MODE(ring) & MODE_IDLE) != 0, 1000)) {
>  			DRM_ERROR("%s :timed out trying to stop ring\n", ring->name);

Please fix the "%s :timed" here as well.

Ok, it seems like I only thought that wait_for_atomic was microseconds,
but wait_for_atomic_us() was a whole seperate interface.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

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

* Re: [PATCH] drm/i915: No busy-loop wait_for in the ring init code
  2014-08-07 14:15 ` Chris Wilson
@ 2014-08-08 15:43   ` Daniel Vetter
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Vetter @ 2014-08-08 15:43 UTC (permalink / raw)
  To: Chris Wilson, Daniel Vetter, Intel Graphics Development,
	Naresh Kumar Kachhi

On Thu, Aug 07, 2014 at 03:15:32PM +0100, Chris Wilson wrote:
> On Thu, Aug 07, 2014 at 04:07:59PM +0200, Daniel Vetter wrote:
> > Doing a 1s wait (tops) with the cpu is a bit excessive. Tune it down
> > like everything else in that code.
> > 
> > Cc: Naresh Kumar Kachhi <naresh.kumar.kachhi@intel.com>
> > Cc: Chris Wilson <chris@chris-wilson.co.uk>
> > Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> > ---
> >  drivers/gpu/drm/i915/intel_ringbuffer.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
> > index 05969f03c0c1..966d8f72da45 100644
> > --- a/drivers/gpu/drm/i915/intel_ringbuffer.c
> > +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
> > @@ -476,7 +476,7 @@ static bool stop_ring(struct intel_engine_cs *ring)
> >  
> >  	if (!IS_GEN2(ring->dev)) {
> >  		I915_WRITE_MODE(ring, _MASKED_BIT_ENABLE(STOP_RING));
> > -		if (wait_for_atomic((I915_READ_MODE(ring) & MODE_IDLE) != 0, 1000)) {
> > +		if (wait_for((I915_READ_MODE(ring) & MODE_IDLE) != 0, 1000)) {
> >  			DRM_ERROR("%s :timed out trying to stop ring\n", ring->name);
> 
> Please fix the "%s :timed" here as well.

Fixed.
> 
> Ok, it seems like I only thought that wait_for_atomic was microseconds,
> but wait_for_atomic_us() was a whole seperate interface.

And assumed that counts for an ack.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

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

end of thread, other threads:[~2014-08-08 15:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-07 14:07 [PATCH] drm/i915: No busy-loop wait_for in the ring init code Daniel Vetter
2014-08-07 14:12 ` Chris Wilson
2014-08-07 14:15 ` Chris Wilson
2014-08-08 15:43   ` 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.