[Nouveau] [PATCH] nouveau: avoid running out of relocs
Maarten Maathuis
madman2003 at gmail.com
Fri Dec 4 15:35:28 PST 2009
So the so_emit flush that was there was busted to begin with?
On Sat, Dec 5, 2009 at 12:32 AM, Ben Skeggs <skeggsb at gmail.com> wrote:
> NACK. You'll want to do this once, at the start of nv50_state_emit(),
> if we run out *during* state_emit() something's gone very wrong, and
> we'd need to fallback to software as the DDX does.
>
> Having the flush occur mid-frame will cause other issues.
>
> Ben.
>
> On Fri, 2009-12-04 at 22:59 +0100, Maarten Maathuis wrote:
>> Signed-off-by: Maarten Maathuis <madman2003 at gmail.com>
>> ---
>> src/gallium/drivers/nouveau/nouveau_stateobj.h | 12 ++++++++----
>> 1 files changed, 8 insertions(+), 4 deletions(-)
>>
>> diff --git a/src/gallium/drivers/nouveau/nouveau_stateobj.h b/src/gallium/drivers/nouveau/nouveau_stateobj.h
>> index b595405..28f483f 100644
>> --- a/src/gallium/drivers/nouveau/nouveau_stateobj.h
>> +++ b/src/gallium/drivers/nouveau/nouveau_stateobj.h
>> @@ -113,8 +113,10 @@ so_emit(struct nouveau_channel *chan, struct nouveau_stateobj *so)
>> unsigned nr, i;
>>
>> nr = so->cur - so->push;
>> - if (pb->remaining < nr)
>> - nouveau_pushbuf_flush(chan, nr);
>> + /* This will flush if we need space.
>> + * We don't actually need the marker.
>> + */
>> + nouveau_pushbuf_marker_emit(chan, nr, so->cur_reloc);
>> pb->remaining -= nr;
>>
>> memcpy(pb->cur, so->push, nr * 4);
>> @@ -138,8 +140,10 @@ so_emit_reloc_markers(struct nouveau_channel *chan, struct nouveau_stateobj *so)
>> return;
>>
>> i = so->cur_reloc << 1;
>> - if (pb->remaining < i)
>> - nouveau_pushbuf_flush(chan, i);
>> + /* This will flush if we need space.
>> + * We don't actually need the marker.
>> + */
>> + nouveau_pushbuf_marker_emit(chan, i, i);
>> pb->remaining -= i;
>>
>> for (i = 0; i < so->cur_reloc; i++) {
>
>
>
More information about the Nouveau
mailing list