<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, "EmojiFont", "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;" dir="ltr">
<div style="color: rgb(0, 0, 0);">
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Andrey Grodzovsky <andrey.grodzovsky@amd.com><br>
<b>Sent:</b> Friday, December 15, 2017 2:09 PM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org<br>
<b>Cc:</b> He, Roger; Daenzer, Michel; Koenig, Christian; Grodzovsky, Andrey<br>
<b>Subject:</b> [PATCH] Revert "drm/amd/amdgpu: set gtt size according to system memory size only"</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:10pt;">
<div class="PlainText">This reverts commit ba851eed895c76be0eb4260bdbeb7e26f9ccfaa2.<br>
With that change piglit max size tests (running with -t max.*size) are causing<br>
OOM and hard hang on my CZ with 1GB RAM.<br>
<br>
Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com></div>
<div class="PlainText"><br>
</div>
<div class="PlainText">Acked-by: Alex Deucher <alexander.deucher@amd.com><br>
</div>
<div class="PlainText"><br>
---<br>
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 8 +++++---<br>
1 file changed, 5 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c<br>
index c307a7d..814a9c1 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c<br>
@@ -1329,9 +1329,11 @@ int amdgpu_ttm_init(struct amdgpu_device *adev)<br>
struct sysinfo si;<br>
<br>
si_meminfo(&si);<br>
- gtt_size = max(AMDGPU_DEFAULT_GTT_SIZE_MB << 20,<br>
- (uint64_t)si.totalram * si.mem_unit * 3/4);<br>
- } else<br>
+ gtt_size = min(max((AMDGPU_DEFAULT_GTT_SIZE_MB << 20),<br>
+ adev->mc.mc_vram_size),<br>
+ ((uint64_t)si.totalram * si.mem_unit * 3/4));<br>
+ }<br>
+ else<br>
gtt_size = (uint64_t)amdgpu_gtt_size << 20;<br>
r = ttm_bo_init_mm(&adev->mman.bdev, TTM_PL_TT, gtt_size >> PAGE_SHIFT);<br>
if (r) {<br>
-- <br>
2.7.4<br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx" id="LPlnk710875" previewremoved="true">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
</div>
</span></font></div>
</div>
</div>
</body>
</html>