[Nouveau] [PATCH] drm/nouveau: rewrite nouveau_dma_wait()

Maarten Maathuis madman2003 at gmail.com
Sat Aug 22 05:27:05 PDT 2009


On Sat, Aug 22, 2009 at 2:20 PM, Pekka Paalanen<pq at iki.fi> wrote:
> On Sat, 22 Aug 2009 12:30:03 +0200
> Maarten Maathuis <madman2003 at gmail.com> wrote:
>
>> dma.max is adjusted to always have space for the jump.
>
> Ah, then that should be documented somewhere.
>
> But if that is the case, why:
>>>> chan->dma.free = get - chan->dma.cur - 1;
>
> The extra space is not needed in this branch, since the available space
> is limited by GET. If it is not locked up, GET will move forward and give
> space. Otherwise, we would be in the get <= dma.cur branch.
>
> Assuming the jump command is at index dma.max, isn't dma.max the maximum
> possible value for GET inside the ring? Therefore
>>>> chan->dma.free = get - chan->dma.cur - 1;
> should become equivalent to
>>>> chan->dma.free = chan->dma.max - chan->dma.cur;
> but there is the -1.
>
> Or do we observe GET == dma.max + 1 just before it actually jumps?

I guess it's just a safety, i do not think our get is ever read as
dma.max + 1, because we read get before jumping.

>
> Or do we simply not know how it behaves and want to be safe?
>
> --
> Pekka Paalanen
> http://www.iki.fi/pq/
>


More information about the Nouveau mailing list