From: Alexandre Courbot <acourbot@nvidia.com>
To: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>,
"nouveau@lists.freedesktop.org" <nouveau@lists.freedesktop.org>,
Alexandre Courbot <gnurou@gmail.com>,
"mesa-dev@lists.freedesktop.org" <mesa-dev@lists.freedesktop.org>
Subject: Re: [PATCH v2 2/3] nvc0: use NV_VRAM_DOMAIN() macro
Date: Wed, 19 Nov 2014 14:59:42 +0900 [thread overview]
Message-ID: <546C31CE.1030106@nvidia.com> (raw)
In-Reply-To: <CAKb7Uvhm5AzYXpPft_ZCjCJDKfk7myLg3ywhuA+HugeEN0fRxw@mail.gmail.com>
On 11/19/2014 02:49 PM, Ilia Mirkin wrote:
> On Wed, Nov 19, 2014 at 12:41 AM, Alexandre Courbot <acourbot@nvidia.com> wrote:
>> Use the newly-introduced NV_VRAM_DOMAIN() macro to support alternative
>> VRAM domains for chips that do not use dedicated video memory.
>>
>> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
>> ---
>> src/gallium/drivers/nouveau/nouveau_buffer.c | 6 ++----
>> src/gallium/drivers/nouveau/nv50/nv50_miptree.c | 4 ++--
>> src/gallium/drivers/nouveau/nvc0/nvc0_compute.c | 2 +-
>> src/gallium/drivers/nouveau/nvc0/nvc0_context.c | 4 ++--
>> src/gallium/drivers/nouveau/nvc0/nvc0_miptree.c | 2 +-
>> src/gallium/drivers/nouveau/nvc0/nvc0_program.c | 8 ++++----
>> src/gallium/drivers/nouveau/nvc0/nvc0_screen.c | 12 ++++++------
>> src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c | 2 +-
>> src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c | 2 +-
>> src/gallium/drivers/nouveau/nvc0/nvc0_tex.c | 2 +-
>> src/gallium/drivers/nouveau/nvc0/nve4_compute.c | 2 +-
>> 11 files changed, 22 insertions(+), 24 deletions(-)
>>
>> diff --git a/src/gallium/drivers/nouveau/nouveau_buffer.c b/src/gallium/drivers/nouveau/nouveau_buffer.c
>> index 49ff100c4ece..4c21691ee671 100644
>> --- a/src/gallium/drivers/nouveau/nouveau_buffer.c
>> +++ b/src/gallium/drivers/nouveau/nouveau_buffer.c
>> @@ -658,13 +658,11 @@ nouveau_buffer_create(struct pipe_screen *pscreen,
>> switch (buffer->base.usage) {
>> case PIPE_USAGE_DEFAULT:
>> case PIPE_USAGE_IMMUTABLE:
>> - buffer->domain = NOUVEAU_BO_VRAM;
>> - break;
>> case PIPE_USAGE_DYNAMIC:
>> /* For most apps, we'd have to do staging transfers to avoid sync
>> * with this usage, and GART -> GART copies would be suboptimal.
>> */
>> - buffer->domain = NOUVEAU_BO_VRAM;
>> + buffer->domain = NV_VRAM_DOMAIN(screen);
>> break;
>> case PIPE_USAGE_STAGING:
>> case PIPE_USAGE_STREAM:
>> @@ -676,7 +674,7 @@ nouveau_buffer_create(struct pipe_screen *pscreen,
>> }
>> } else {
>> if (buffer->base.bind & screen->vidmem_bindings)
>> - buffer->domain = NOUVEAU_BO_VRAM;
>> + buffer->domain = NV_VRAM_DOMAIN(screen);
>> else
>> if (buffer->base.bind & screen->sysmem_bindings)
>> buffer->domain = NOUVEAU_BO_GART;
>
> Both of these changes should be unnecessary if vidmem_bindings is
> cleared out, right?
For our particular case (vram_domain == NOUVEAU_BO_GART), that's
correct. However NV_VRAM_DOMAIN could be a any combination of
NOUVEAU_BO_*, so we can imagine a future scenario where
(buffer->base.bind & screen->vidmem_bindings) == 1 but NV_VRAM_DOMAIN()
will return something different from NOUVEAU_BO_VRAM. For this reason it
seems consistent to use this macro here as well.
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev
next prev parent reply other threads:[~2014-11-19 5:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-19 5:41 [PATCH v2 0/3] nouveau: support for custom VRAM domains Alexandre Courbot
[not found] ` <1416375705-14068-1-git-send-email-acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2014-11-19 5:41 ` [PATCH v2 1/3] " Alexandre Courbot
2014-11-19 5:41 ` [PATCH v2 2/3] nvc0: use NV_VRAM_DOMAIN() macro Alexandre Courbot
[not found] ` <1416375705-14068-3-git-send-email-acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2014-11-19 5:49 ` Ilia Mirkin
2014-11-19 5:59 ` Alexandre Courbot [this message]
2014-11-19 9:55 ` Roy Spliet
[not found] ` <546C68F8.90502-FA6nBp6kBxZzu6KWmfFNGwC/G2K4zDHf@public.gmane.org>
2014-11-20 8:54 ` Alexandre Courbot
2014-11-19 5:41 ` [PATCH v2 3/3] gk20a: use NOUVEAU_BO_GART as VRAM domain Alexandre Courbot
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=546C31CE.1030106@nvidia.com \
--to=acourbot@nvidia.com \
--cc=gnurou@gmail.com \
--cc=imirkin@alum.mit.edu \
--cc=linux-tegra@vger.kernel.org \
--cc=mesa-dev@lists.freedesktop.org \
--cc=nouveau@lists.freedesktop.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.