From: Emil Velikov <emil.l.velikov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Ilia Mirkin <imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>,
mesa-dev-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: "10.2 10.3"
<mesa-stable-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
emil.l.velikov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Subject: Re: [Mesa-stable] [PATCH 2/2] nv50: zero out unbound samplers
Date: Sun, 31 Aug 2014 00:30:39 +0100 [thread overview]
Message-ID: <54025E9F.507@gmail.com> (raw)
In-Reply-To: <1409436150-5979-2-git-send-email-imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
On 30/08/14 23:02, Ilia Mirkin wrote:
> Samplers are only defined up to num_samplers, so set all samplers above
> nr to NULL so that we don't try to read them again later.
>
Would it be worth doing a similar thing with the unlocked samplers below the
nr mark ? It seems to me that we might be leaking nv50->samplers[s][i], or
perhaps I'm missing something ?
-Emil
> Tested-by: Christian Ruppert <idl0r-iOiTmaF8HRY@public.gmane.org>
> Signed-off-by: Ilia Mirkin <imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
> Cc: "10.2 10.3" <mesa-stable-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
> ---
> src/gallium/drivers/nouveau/nv50/nv50_state.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/src/gallium/drivers/nouveau/nv50/nv50_state.c b/src/gallium/drivers/nouveau/nv50/nv50_state.c
> index 48bc079..cf84f88 100644
> --- a/src/gallium/drivers/nouveau/nv50/nv50_state.c
> +++ b/src/gallium/drivers/nouveau/nv50/nv50_state.c
> @@ -585,9 +585,12 @@ nv50_stage_sampler_states_bind(struct nv50_context *nv50, int s,
> nv50_screen_tsc_unlock(nv50->screen, old);
> }
> assert(nv50->num_samplers[s] <= PIPE_MAX_SAMPLERS);
> - for (; i < nv50->num_samplers[s]; ++i)
> - if (nv50->samplers[s][i])
> + for (; i < nv50->num_samplers[s]; ++i) {
> + if (nv50->samplers[s][i]) {
> nv50_screen_tsc_unlock(nv50->screen, nv50->samplers[s][i]);
> + nv50->samplers[s][i] = NULL;
> + }
> + }
>
> nv50->num_samplers[s] = nr;
>
>
next prev parent reply other threads:[~2014-08-30 23:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-30 22:02 [PATCH 1/2] nvc0/ir: avoid infinite recursion when finding first uses of tex Ilia Mirkin
[not found] ` <1409436150-5979-1-git-send-email-imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
2014-08-30 22:02 ` [PATCH 2/2] nv50: zero out unbound samplers Ilia Mirkin
[not found] ` <1409436150-5979-2-git-send-email-imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
2014-08-30 23:30 ` Emil Velikov [this message]
[not found] ` <54025E9F.507-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-08-30 23:34 ` [Mesa-stable] " Ilia Mirkin
[not found] ` <CAKb7Uvj33_6ztqaHiW6ip5J9B93kCUGRw8-gdDzgSdvmc5JYcA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-08-31 0:09 ` Emil Velikov
[not found] ` <540267BB.8000309-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-08-31 0:13 ` Ilia Mirkin
2014-08-31 18:11 ` Emil Velikov
2014-08-31 0:09 ` Emil Velikov
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=54025E9F.507@gmail.com \
--to=emil.l.velikov-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org \
--cc=mesa-dev-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=mesa-stable-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@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.