From: Francisco Jerez <currojerez-sGOZH3hwPm2sTnJN9+BGXg@public.gmane.org>
To: skeggsb-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH] nouveau: avoid running out of relocs
Date: Sat, 05 Dec 2009 17:07:38 +0100 [thread overview]
Message-ID: <87ocmdpfp1.fsf@riseup.net> (raw)
In-Reply-To: <1259969574.2897.1.camel@nisroch> (Ben Skeggs's message of "Sat, 05 Dec 2009 09:32:54 +1000")
[-- Attachment #1.1.1: Type: text/plain, Size: 2542 bytes --]
Ben Skeggs <skeggsb-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
> 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.
>
It shouldn't, at least for nv50. If a mid-frame flush happens
nv50_state_flush_notify() will re-emit anything that's needed to go on
with the state emission, so Maarten's proposal looks fine to me as long
as he or someone else fixes the nv[34]0 pipe drivers to use flush
notifiers. :)
Software fallbacks could still be handled this way: if a BO cannot be
relocated you just rewind the pushbuf up to the last marker and then you
kick it off to clean up any references to the buffers software rendering
is going to be performed on.
> Ben.
>
> On Fri, 2009-12-04 at 22:59 +0100, Maarten Maathuis wrote:
>> Signed-off-by: Maarten Maathuis <madman2003-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>> ---
>> 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++) {
>
>
> _______________________________________________
> Nouveau mailing list
> Nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
> http://lists.freedesktop.org/mailman/listinfo/nouveau
[-- Attachment #1.2: Type: application/pgp-signature, Size: 196 bytes --]
[-- Attachment #2: Type: text/plain, Size: 181 bytes --]
_______________________________________________
Nouveau mailing list
Nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
http://lists.freedesktop.org/mailman/listinfo/nouveau
next prev parent reply other threads:[~2009-12-05 16:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-04 21:59 [PATCH] nouveau: avoid running out of relocs Maarten Maathuis
[not found] ` <1259963980-6698-1-git-send-email-madman2003-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2009-12-04 23:32 ` Ben Skeggs
2009-12-04 23:35 ` Maarten Maathuis
[not found] ` <6d4bc9fc0912041535j44a0792bvb13395d683537466-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-12-04 23:50 ` Ben Skeggs
2009-12-05 16:07 ` Francisco Jerez [this message]
-- strict thread matches above, loose matches on Subject: below --
2009-12-04 22:23 Maarten Maathuis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ocmdpfp1.fsf@riseup.net \
--to=currojerez-sgozh3hwpm2stnjn9+bgxg@public.gmane.org \
--cc=nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=skeggsb-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.