Re: [Intel-gfx] [PATCH 2/2] drm/i915: Use atomic waits for short non-atomic ones

2016-06-28 Thread Imre Deak
On Tue, 2016-06-28 at 15:38 +0100, Tvrtko Ursulin wrote: > On 28/06/16 14:53, Imre Deak wrote: > > On ti, 2016-06-28 at 14:29 +0100, Tvrtko Ursulin wrote: > > > On 28/06/16 13:19, Imre Deak wrote: > > > > On ti, 2016-06-28 at 12:51 +0100, Tvrtko Ursulin wrote: > > > > > From: Tvrtko Ursulin > > >

Re: [Intel-gfx] [PATCH 2/2] drm/i915: Use atomic waits for short non-atomic ones

2016-06-28 Thread Chris Wilson
On Tue, Jun 28, 2016 at 03:40:24PM +0100, Tvrtko Ursulin wrote: > > On 28/06/16 15:14, Chris Wilson wrote: > >On Tue, Jun 28, 2016 at 02:55:28PM +0100, Chris Wilson wrote: > >>On Tue, Jun 28, 2016 at 02:29:33PM +0100, Tvrtko Ursulin wrote: > >>>How would you implement it with cpu_clock? What would

Re: [Intel-gfx] [PATCH 2/2] drm/i915: Use atomic waits for short non-atomic ones

2016-06-28 Thread Tvrtko Ursulin
On 28/06/16 14:53, Imre Deak wrote: On ti, 2016-06-28 at 14:29 +0100, Tvrtko Ursulin wrote: On 28/06/16 13:19, Imre Deak wrote: On ti, 2016-06-28 at 12:51 +0100, Tvrtko Ursulin wrote: From: Tvrtko Ursulin usleep_range is not recommended for waits shorten than 10us. Make the wait_for_us use

Re: [Intel-gfx] [PATCH 2/2] drm/i915: Use atomic waits for short non-atomic ones

2016-06-28 Thread Tvrtko Ursulin
On 28/06/16 15:14, Chris Wilson wrote: On Tue, Jun 28, 2016 at 02:55:28PM +0100, Chris Wilson wrote: On Tue, Jun 28, 2016 at 02:29:33PM +0100, Tvrtko Ursulin wrote: How would you implement it with cpu_clock? What would you do when re-scheduled? unsigned long base; int cpu; int ret; preempt_

Re: [Intel-gfx] [PATCH 2/2] drm/i915: Use atomic waits for short non-atomic ones

2016-06-28 Thread Chris Wilson
On Tue, Jun 28, 2016 at 02:55:28PM +0100, Chris Wilson wrote: > On Tue, Jun 28, 2016 at 02:29:33PM +0100, Tvrtko Ursulin wrote: > > How would you implement it with cpu_clock? What would you do when > > re-scheduled? > > unsigned long base; > int cpu; > int ret; > > preempt_disable(); > cpu = smp_

Re: [Intel-gfx] [PATCH 2/2] drm/i915: Use atomic waits for short non-atomic ones

2016-06-28 Thread Chris Wilson
On Tue, Jun 28, 2016 at 02:29:33PM +0100, Tvrtko Ursulin wrote: > How would you implement it with cpu_clock? What would you do when > re-scheduled? unsigned long base; int cpu; int ret; preempt_disable(); cpu = smp_processor_id(); base = local_clock() >> 10; for (;;) { u64 now = local_clo

Re: [Intel-gfx] [PATCH 2/2] drm/i915: Use atomic waits for short non-atomic ones

2016-06-28 Thread Imre Deak
On ti, 2016-06-28 at 14:29 +0100, Tvrtko Ursulin wrote: > On 28/06/16 13:19, Imre Deak wrote: > > On ti, 2016-06-28 at 12:51 +0100, Tvrtko Ursulin wrote: > > > From: Tvrtko Ursulin > > > > > > usleep_range is not recommended for waits shorten than 10us. > > > > > > Make the wait_for_us use the a

Re: [Intel-gfx] [PATCH 2/2] drm/i915: Use atomic waits for short non-atomic ones

2016-06-28 Thread Tvrtko Ursulin
On 28/06/16 13:19, Imre Deak wrote: On ti, 2016-06-28 at 12:51 +0100, Tvrtko Ursulin wrote: From: Tvrtko Ursulin usleep_range is not recommended for waits shorten than 10us. Make the wait_for_us use the atomic variant for such waits. To do so we need to disable the !in_atomic warning for su

Re: [Intel-gfx] [PATCH 2/2] drm/i915: Use atomic waits for short non-atomic ones

2016-06-28 Thread Chris Wilson
On Tue, Jun 28, 2016 at 12:51:50PM +0100, Tvrtko Ursulin wrote: > From: Tvrtko Ursulin > > usleep_range is not recommended for waits shorten than 10us. > > Make the wait_for_us use the atomic variant for such waits. > > To do so we need to disable the !in_atomic warning for such uses > and also

Re: [Intel-gfx] [PATCH 2/2] drm/i915: Use atomic waits for short non-atomic ones

2016-06-28 Thread Imre Deak
On ti, 2016-06-28 at 12:51 +0100, Tvrtko Ursulin wrote: > From: Tvrtko Ursulin > > usleep_range is not recommended for waits shorten than 10us. > > Make the wait_for_us use the atomic variant for such waits. > > To do so we need to disable the !in_atomic warning for such uses > and also disable

[Intel-gfx] [PATCH 2/2] drm/i915: Use atomic waits for short non-atomic ones

2016-06-28 Thread Tvrtko Ursulin
From: Tvrtko Ursulin usleep_range is not recommended for waits shorten than 10us. Make the wait_for_us use the atomic variant for such waits. To do so we need to disable the !in_atomic warning for such uses and also disable preemption since the macro is written in a way to only be safe to be us