[Nouveau] [PATCH] nouveau: avoid running out of relocs (attempt 5)
Christoph Bumiller
e0425955 at student.tuwien.ac.at
Mon Dec 14 08:51:28 PST 2009
On 13.12.2009 16:07, Maarten Maathuis wrote:
> - Added flush notify functions for NV30 and NV40.
> - NV30 and NV40 need testing (check for regressions).
> ---
>
> @@ -112,19 +112,29 @@ so_emit(struct nouveau_channel *chan, struct nouveau_stateobj *so)
> {
> struct nouveau_pushbuf *pb = chan->pushbuf;
> unsigned nr, i;
> + int ret = 0;
>
> 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.
> + */
> + if ((ret = nouveau_pushbuf_marker_emit(chan, nr, so->cur_reloc))) {
> + debug_printf("so_emit failed marker emit with error %d\n", ret);
> + return;
> + }
> pb->remaining -= nr;
>
>
I'm not sure why flushing mid-frame would be bad as Ben said.
After all, if there's lots of stuff done during a frame, we will
inevitably flush at some point ...
> - nouveau_pushbuf_emit_reloc(chan, pb->cur++, r->bo, r->data, 0,
> + NOUVEAU_BO_DUMMY, 0, 0))) {
> + debug_printf("so_emit_reloc_markers failed reloc \
> + with error %d\n", ret);
>
Now these debug_printf "will probably give you unwanted"
"extra space the way they are"
As for the interesting part, the too many relocs I got
in vegastrike (and which would need a LOT of NOPs)
are gone and nothing else seems to be broken.
At some point we'll probably want to know if buffer relocation
succeeded or not I guess, and fallback to software on failure.
But that still doesn't have a high priority for me personally.
Christoph
More information about the Nouveau
mailing list