<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<p class="msipheaderc10f11a2" align="Left" style="margin:0"><span style="font-size:10.0pt;font-family:Arial;color:#008000">[Public]</span></p>
<br>
<div class="WordSection1">
<p class="MsoNormal">[Why]<o:p></o:p></p>
<p class="MsoNormal">After s3, In radv there is huge fps drop in games. This is because<o:p></o:p></p>
<p class="MsoNormal">when memory is allocated using radv_amdgpu_winsys_bo_create()<o:p></o:p></p>
<p class="MsoNormal">with both AMDGPU_GEM_DOMAIN_VRAM and AMDGPU_GEM_DOMAIN_GTT domains<o:p></o:p></p>
<p class="MsoNormal">set, the kernel memory management after resume fails to move the data<o:p></o:p></p>
<p class="MsoNormal">back to VRAM. In kernel memory management, ttm_bo_mem_compat()<o:p></o:p></p>
<p class="MsoNormal">function returns true and hence data is not moved back to VRAM.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">[How]<o:p></o:p></p>
<p class="MsoNormal">Implement the idea suggested by Christian Koenig. During suspend<o:p></o:p></p>
<p class="MsoNormal">move the data to system RAM instead of GTT. Due to this ttm_bo_mem_compat()<o:p></o:p></p>
<p class="MsoNormal">will return false and data will be moved back to VRAM.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Signed-off-by: Christian König <a href="mailto:christian.koenig@amd.com">
christian.koenig@amd.com</a><o:p></o:p></p>
<p class="MsoNormal">Signed-off-by: Yogesh mohan marimuthu <a href="mailto:yogesh.mohanmarimuthu@amd.com">
yogesh.mohanmarimuthu@amd.com</a><o:p></o:p></p>
<p class="MsoNormal">---<o:p></o:p></p>
<p class="MsoNormal">drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 8 +++++++-<o:p></o:p></p>
<p class="MsoNormal">1 file changed, 7 insertions(+), 1 deletion(-)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c<o:p></o:p></p>
<p class="MsoNormal">index 446943e32..44ec59998 100644<o:p></o:p></p>
<p class="MsoNormal">--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c<o:p></o:p></p>
<p class="MsoNormal">+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c<o:p></o:p></p>
<p class="MsoNormal">@@ -136,7 +136,13 @@ static void amdgpu_evict_flags(struct ttm_buffer_object *bo,<o:p></o:p></p>
<p class="MsoNormal"> return;<o:p></o:p></p>
<p class="MsoNormal"><o:p></o:p></p>
<p class="MsoNormal"> case TTM_PL_VRAM:<o:p></o:p></p>
<p class="MsoNormal">- if (!adev->mman.buffer_funcs_enabled) {<o:p></o:p></p>
<p class="MsoNormal">+ /* Move data to system memory for S3 so that while resume<o:p></o:p></p>
<p class="MsoNormal">+ * ttm_bo_mem_compat() will return false and data will be<o:p></o:p></p>
<p class="MsoNormal">+ * moved back to VRAM also in case of bo with both<o:p></o:p></p>
<p class="MsoNormal">+ * AMDGPU_GEM_DOMAIN_GTT and AMDGPU_GEM_DOMAIN_VRAM domain<o:p></o:p></p>
<p class="MsoNormal">+ * set in bo->preferred_domains.<o:p></o:p></p>
<p class="MsoNormal">+ */<o:p></o:p></p>
<p class="MsoNormal">+ if (!adev->mman.buffer_funcs_enabled || adev->in_s3) {<o:p></o:p></p>
<p class="MsoNormal"> /* Move to system memory */<o:p></o:p></p>
<p class="MsoNormal"> amdgpu_bo_placement_from_domain(abo, AMDGPU_GEM_DOMAIN_CPU);<o:p></o:p></p>
<p class="MsoNormal"> } else if (!amdgpu_gmc_vram_full_visible(&adev->gmc) &&<o:p></o:p></p>
<p class="MsoNormal">-- <o:p></o:p></p>
<p class="MsoNormal">2.25.1<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>