<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div dir="auto">
<div><br>
<div class="gmail_extra"><br>
<div class="gmail_quote">Am 09.09.2020 07:29 schrieb Huacai Chen <chenhc@lemote.com>:<br type="attribution">
<blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><font size="2"><span style="font-size:11pt">
<div>Though RADEON_GEM_GTT_WC is initially used for GTT, but this flag is<br>
bound to drm_arch_can_wc_memory(), and if arch doesn't support WC, then<br>
VRAM should not use WC.<br>
</div>
</span></font></div>
</blockquote>
</div>
</div>
</div>
<div dir="auto"><br>
</div>
<div dir="auto">NAK, If System memory supports WC is completely independent from the VRAM BAR.</div>
<div dir="auto"><br>
</div>
<div dir="auto">Christian.</div>
<div dir="auto"><br>
</div>
<div dir="auto">
<div class="gmail_extra">
<div class="gmail_quote">
<blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><font size="2"><span style="font-size:11pt">
<div><br>
Signed-off-by: Huacai Chen <chenhc@lemote.com><br>
---<br>
 drivers/gpu/drm/radeon/radeon_object.c | 14 ++++++++++----<br>
 1 file changed, 10 insertions(+), 4 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/radeon/radeon_object.c b/drivers/gpu/drm/radeon/radeon_object.c<br>
index f3dee01..07b82d9 100644<br>
--- a/drivers/gpu/drm/radeon/radeon_object.c<br>
+++ b/drivers/gpu/drm/radeon/radeon_object.c<br>
@@ -117,10 +117,16 @@ void radeon_ttm_placement_from_domain(struct radeon_bo *rbo, u32 domain)<br>
                                                      TTM_PL_FLAG_VRAM;<br>
                 }<br>
 <br>
-               rbo->placements[c].fpfn = 0;<br>
-               rbo->placements[c++].flags = TTM_PL_FLAG_WC |<br>
-                                            TTM_PL_FLAG_UNCACHED |<br>
-                                            TTM_PL_FLAG_VRAM;<br>
+               if (rbo->flags & RADEON_GEM_GTT_WC) {<!-- --><br>
+                       rbo->placements[c].fpfn = 0;<br>
+                       rbo->placements[c++].flags = TTM_PL_FLAG_WC |<br>
+                                                    TTM_PL_FLAG_UNCACHED |<br>
+                                                    TTM_PL_FLAG_VRAM;<br>
+               } else {<!-- --><br>
+                       rbo->placements[c].fpfn = 0;<br>
+                       rbo->placements[c++].flags = TTM_PL_FLAG_UNCACHED |<br>
+                                                    TTM_PL_FLAG_VRAM;<br>
+               }<br>
         }<br>
 <br>
         if (domain & RADEON_GEM_DOMAIN_GTT) {<!-- --><br>
-- <br>
2.7.0<br>
<br>
</div>
</span></font></div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</body>
</html>