From: Sergei Shtylyov <sergei.shtylyov@gmail.com>
To: Huacai Chen <chenhc@lemote.com>,
Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
Thomas Gleixner <tglx@linutronix.de>,
Jason Cooper <jason@lakedaemon.net>,
Marc Zyngier <maz@kernel.org>
Cc: linux-mips@vger.kernel.org, Fuxin Zhang <zhangfx@lemote.com>,
Huacai Chen <chenhuacai@gmail.com>,
Jiaxun Yang <jiaxun.yang@flygoat.com>
Subject: Re: [PATCH 1/2] drm/radeon: Don't use WC for VRAM if !RADEON_GEM_GTT_WC
Date: Wed, 9 Sep 2020 11:05:28 +0300 [thread overview]
Message-ID: <2f27413d-9b01-b865-4e47-79a0cf12ec84@gmail.com> (raw)
In-Reply-To: <1599625320-17637-1-git-send-email-chenhc@lemote.com>
Hello!
On 09.09.2020 7:21, Huacai Chen wrote:
> Though RADEON_GEM_GTT_WC is initially used for GTT, but this flag is
> bound to drm_arch_can_wc_memory(), and if arch doesn't support WC, then
> VRAM should not use WC.
>
> Signed-off-by: Huacai Chen <chenhc@lemote.com>
> ---
> drivers/gpu/drm/radeon/radeon_object.c | 14 ++++++++++----
> 1 file changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_object.c b/drivers/gpu/drm/radeon/radeon_object.c
> index f3dee01..07b82d9 100644
> --- a/drivers/gpu/drm/radeon/radeon_object.c
> +++ b/drivers/gpu/drm/radeon/radeon_object.c
> @@ -117,10 +117,16 @@ void radeon_ttm_placement_from_domain(struct radeon_bo *rbo, u32 domain)
> TTM_PL_FLAG_VRAM;
> }
>
> - rbo->placements[c].fpfn = 0;
> - rbo->placements[c++].flags = TTM_PL_FLAG_WC |
> - TTM_PL_FLAG_UNCACHED |
> - TTM_PL_FLAG_VRAM;
> + if (rbo->flags & RADEON_GEM_GTT_WC) {
> + rbo->placements[c].fpfn = 0;
Shouldn't this statement be placed outside *if* as before?
> + rbo->placements[c++].flags = TTM_PL_FLAG_WC |
> + TTM_PL_FLAG_UNCACHED |
> + TTM_PL_FLAG_VRAM;
> + } else {
> + rbo->placements[c].fpfn = 0;
> + rbo->placements[c++].flags = TTM_PL_FLAG_UNCACHED |
> + TTM_PL_FLAG_VRAM;
> + }
> }
>
> if (domain & RADEON_GEM_DOMAIN_GTT) {
MBR, Sergei
next prev parent reply other threads:[~2020-09-09 8:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-09 4:21 [PATCH 1/2] drm/radeon: Don't use WC for VRAM if !RADEON_GEM_GTT_WC Huacai Chen
2020-09-09 4:22 ` [PATCH 2/2] drm/amdgpu: Don't use WC for VRAM if !AMDGPU_GEM_CREATE_CPU_GTT_USWC Huacai Chen
2020-09-09 8:05 ` Sergei Shtylyov [this message]
2020-09-09 9:39 ` [PATCH 1/2] drm/radeon: Don't use WC for VRAM if !RADEON_GEM_GTT_WC Tiezhu Yang
2020-09-09 11:00 ` Christian König
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=2f27413d-9b01-b865-4e47-79a0cf12ec84@gmail.com \
--to=sergei.shtylyov@gmail.com \
--cc=chenhc@lemote.com \
--cc=chenhuacai@gmail.com \
--cc=jason@lakedaemon.net \
--cc=jiaxun.yang@flygoat.com \
--cc=linux-mips@vger.kernel.org \
--cc=maz@kernel.org \
--cc=tglx@linutronix.de \
--cc=tsbogend@alpha.franken.de \
--cc=zhangfx@lemote.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).