Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
To: intel-xe@lists.freedesktop.org
Subject: [CI 5/5] drm/amdgpu: use GTT only as fallback for VRAM|GTT
Date: Wed, 17 Jan 2024 11:52:36 +0100	[thread overview]
Message-ID: <20240117105236.121836-6-thomas.hellstrom@linux.intel.com> (raw)
In-Reply-To: <20240117105236.121836-1-thomas.hellstrom@linux.intel.com>

From: Christian König <ckoenig.leichtzumerken@gmail.com>

Try to fill up VRAM as well by setting the busy flag on GTT allocations.

This fixes the issue that when VRAM was evacuated for suspend it's never
filled up again unless the application is restarted.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
index 06fb3fc47eaa..2752f2a67a44 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
@@ -173,6 +173,12 @@ void amdgpu_bo_placement_from_domain(struct amdgpu_bo *abo, u32 domain)
 			abo->flags & AMDGPU_GEM_CREATE_PREEMPTIBLE ?
 			AMDGPU_PL_PREEMPT : TTM_PL_TT;
 		places[c].flags = 0;
+		/*
+		 * When GTT is just an alternative to VRAM make sure that we
+		 * only use it as fallback and still try to fill up VRAM first.
+		 */
+		if (domain & abo->preferred_domains & AMDGPU_GEM_DOMAIN_VRAM)
+			places[c].flags |= TTM_PL_FLAG_FALLBACK;
 		c++;
 	}
 
-- 
2.43.0


  parent reply	other threads:[~2024-01-17 10:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-17 10:52 [CI 0/5] TTM placement changes Thomas Hellström
2024-01-17 10:52 ` [CI 1/5] drm/vmwgfx: remove vmw_vram_gmr_placement Thomas Hellström
2024-01-17 10:52 ` [CI 2/5] drm/ttm: return ENOSPC from ttm_bo_mem_space Thomas Hellström
2024-01-17 10:52 ` [CI 3/5] drm/ttm: replace busy placement with flags v6 Thomas Hellström
2024-01-17 10:52 ` [CI 4/5] drm/ttm: improve idle/busy handling v3 Thomas Hellström
2024-01-17 10:52 ` Thomas Hellström [this message]
2024-01-17 11:12 ` ✓ CI.Patch_applied: success for TTM placement changes Patchwork
2024-01-17 11:12 ` ✗ CI.checkpatch: warning " Patchwork
2024-01-17 11:13 ` ✓ CI.KUnit: success " Patchwork
2024-01-17 11:20 ` ✓ CI.Build: " Patchwork
2024-01-17 11:21 ` ✓ CI.Hooks: " Patchwork
2024-01-17 11:22 ` ✗ CI.checksparse: warning " Patchwork
2024-01-17 11:47 ` ✗ CI.BAT: failure " Patchwork

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=20240117105236.121836-6-thomas.hellstrom@linux.intel.com \
    --to=thomas.hellstrom@linux.intel.com \
    --cc=intel-xe@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox