<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
</head>
<body>
Am 17.08.21 um 20:26 schrieb Mohan Marimuthu, Yogesh:<br>
<blockquote type="cite"
cite="mid:DM4PR12MB52454BBA711B61BA2BD03033FFFE9@DM4PR12MB5245.namprd12.prod.outlook.com">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style>@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;}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;}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]-->
<p class="msipheaderc10f11a2" style="margin:0" align="Left"><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"
moz-do-not-send="true">
christian.koenig@amd.com</a></p>
</div>
</blockquote>
<br>
Suggested-by: would be better here since I wasn't involved in the
coding.<br>
<br>
<blockquote type="cite"
cite="mid:DM4PR12MB52454BBA711B61BA2BD03033FFFE9@DM4PR12MB5245.namprd12.prod.outlook.com">
<div class="WordSection1">
<p class="MsoNormal"><o:p></o:p></p>
<p class="MsoNormal">Signed-off-by: Yogesh mohan marimuthu <a
href="mailto:yogesh.mohanmarimuthu@amd.com"
moz-do-not-send="true">
yogesh.mohanmarimuthu@amd.com</a></p>
</div>
</blockquote>
<br>
Reviewed-by: Christian König <a class="moz-txt-link-rfc2396E" href="mailto:christian.koenig@amd.com"><christian.koenig@amd.com></a><br>
<br>
<blockquote type="cite"
cite="mid:DM4PR12MB52454BBA711B61BA2BD03033FFFE9@DM4PR12MB5245.namprd12.prod.outlook.com">
<div class="WordSection1">
<p class="MsoNormal"><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>
</blockquote>
<br>
</body>
</html>