Re: [PATCH] drm/i915: Make mmio flip wait for seqno in the work function

Chris Wilson
2014-11-05T11:24:11Z

On Wed, Nov 05, 2014 at 01:03:00PM +0200, Ander Conselvan de Oliveira wrote:
> This simplifies the code quite a bit compared to iterating over all
> rings during the ring interrupt.
>
> Also, it allows us to drop the mmio_flip spinlock, since the mmio_flip
> struct is only accessed in two places. The first is when the flip is
> queued and the other when the mmio writes are done. Since a flip cannot
> be queued while there is a pending flip, the two paths shouldn't ever
> run in parallel. We might need to revisit that if support for replacing
> flips is implemented though.
>
> Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
> ---
>
> I'm not sure if locking dev->struct_mutex in the work function might
> have any ill effects, so I'd appreciate if someone could enlighten me.

Good news is you can wait on the seqno without holding any locks. You
need to use the lower level entry point __wait_seqno() though.

Overall it looked good.
-Chris

--
Chris Wilson, Intel Open Source Technology Centre