All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: "Mohan Marimuthu, Yogesh" <Yogesh.Mohanmarimuthu@amd.com>,
	"amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>
Subject: Re: [PATCH] drm/amdgpu: fix radv vulkan fps drop after s3 resume
Date: Wed, 18 Aug 2021 10:58:46 +0200	[thread overview]
Message-ID: <0a58b123-67bb-a066-2a36-fde0116a92c3@gmail.com> (raw)
In-Reply-To: <DM4PR12MB52454BBA711B61BA2BD03033FFFE9@DM4PR12MB5245.namprd12.prod.outlook.com>

[-- Attachment #1: Type: text/plain, Size: 2419 bytes --]

Am 17.08.21 um 20:26 schrieb Mohan Marimuthu, Yogesh:
>
> [Public]
>
>
> [Why]
>
> After s3, In radv there is huge fps drop in games. This is because
>
> when memory is allocated using radv_amdgpu_winsys_bo_create()
>
> with both AMDGPU_GEM_DOMAIN_VRAM and AMDGPU_GEM_DOMAIN_GTT domains
>
> set, the kernel memory management after resume fails to move the data
>
> back to VRAM. In kernel memory management, ttm_bo_mem_compat()
>
> function returns true and hence data is not moved back to VRAM.
>
> [How]
>
> Implement the idea suggested by Christian Koenig. During suspend
>
> move the data to system RAM instead of GTT. Due to this 
> ttm_bo_mem_compat()
>
> will return false and data will be moved back to VRAM.
>
> Signed-off-by: Christian König christian.koenig@amd.com 
> <mailto:christian.koenig@amd.com>
>

Suggested-by: would be better here since I wasn't involved in the coding.

> Signed-off-by: Yogesh mohan marimuthu yogesh.mohanmarimuthu@amd.com 
> <mailto:yogesh.mohanmarimuthu@amd.com>
>

Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
>
> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 8 +++++++-
>
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>
> index 446943e32..44ec59998 100644
>
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>
> @@ -136,7 +136,13 @@ static void amdgpu_evict_flags(struct 
> ttm_buffer_object *bo,
>
>                             return;
>
>                case TTM_PL_VRAM:
>
> -                            if (!adev->mman.buffer_funcs_enabled) {
>
> +                           /* Move data to system memory for S3 so 
> that while resume
>
> +                           * ttm_bo_mem_compat() will return false 
> and data will be
>
> +                           * moved back to VRAM also in case of bo 
> with both
>
> +                           * AMDGPU_GEM_DOMAIN_GTT and 
> AMDGPU_GEM_DOMAIN_VRAM domain
>
> +                           * set in bo->preferred_domains.
>
> +                           */
>
> +                           if (!adev->mman.buffer_funcs_enabled || 
> adev->in_s3) {
>
> /* Move to system memory */
>
> amdgpu_bo_placement_from_domain(abo, AMDGPU_GEM_DOMAIN_CPU);
>
>                             } else if 
> (!amdgpu_gmc_vram_full_visible(&adev->gmc) &&
>
> -- 
>
> 2.25.1
>


[-- Attachment #2: Type: text/html, Size: 6605 bytes --]

  reply	other threads:[~2021-08-18  8:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-17 18:26 [PATCH] drm/amdgpu: fix radv vulkan fps drop after s3 resume Mohan Marimuthu, Yogesh
2021-08-18  8:58 ` Christian König [this message]
2021-08-18  9:54   ` Mohan Marimuthu, Yogesh

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=0a58b123-67bb-a066-2a36-fde0116a92c3@gmail.com \
    --to=ckoenig.leichtzumerken@gmail.com \
    --cc=Yogesh.Mohanmarimuthu@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.