From: Tobias Klausmann <tobias.johannes.klausmann-AqjdNwhu20eELgA04lAiVw@public.gmane.org>
To: Ilia Mirkin <imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH] nvc0: switch mechanism for shader eviction to be a while loop
Date: Sun, 10 May 2015 15:47:46 +0200 [thread overview]
Message-ID: <554F6182.3070506@mni.thm.de> (raw)
In-Reply-To: <1431237476-912-1-git-send-email-imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
On 10.05.2015 07:57, Ilia Mirkin wrote:
> This aligns it to work similarly to nv50. However there's no library
> code there, so the whole thing can be freed. Here we end up with an
> allocated node that's not attached to a specific program.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86792
> Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
> Cc: mesa-stable@lists.freedesktop.org
> ---
> src/gallium/drivers/nouveau/nvc0/nvc0_program.c | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_program.c b/src/gallium/drivers/nouveau/nvc0/nvc0_program.c
> index c156e91..5589695 100644
> --- a/src/gallium/drivers/nouveau/nvc0/nvc0_program.c
> +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_program.c
> @@ -683,11 +683,12 @@ nvc0_program_upload_code(struct nvc0_context *nvc0, struct nvc0_program *prog)
> ret = nouveau_heap_alloc(screen->text_heap, size, prog, &prog->mem);
> if (ret) {
> struct nouveau_heap *heap = screen->text_heap;
> - struct nouveau_heap *iter;
> - for (iter = heap; iter && iter->next != heap; iter = iter->next) {
> - struct nvc0_program *evict = iter->priv;
> - if (evict)
> - nouveau_heap_free(&evict->mem);
> + /* Note that the code library, which is allocated before anything else,
> + * does not have a priv pointer. We can stop once we hit it.
> + */
> + while (heap->next && heap->next->priv) {
> + struct nvc0_program *evict = heap->next->priv;
> + nouveau_heap_free(&evict->mem);
> }
> debug_printf("WARNING: out of code space, evicting all shaders.\n");
> ret = nouveau_heap_alloc(heap, size, prog, &prog->mem);
The new comment is a bit upside down, but thats not really a problem
R-b here as well
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau
prev parent reply other threads:[~2015-05-10 13:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-10 5:57 [PATCH] nvc0: switch mechanism for shader eviction to be a while loop Ilia Mirkin
[not found] ` <1431237476-912-1-git-send-email-imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
2015-05-10 13:47 ` Tobias Klausmann [this message]
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=554F6182.3070506@mni.thm.de \
--to=tobias.johannes.klausmann-aqjdnwhu20eelga04laivw@public.gmane.org \
--cc=imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org \
--cc=nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@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.