From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
thomas.hellstrom@linux.intel.com, nouveau@lists.freedesktop.org,
jani.nikula@linux.intel.com, kherbst@redhat.com,
lyude@redhat.com, zackr@vmware.com, michel.daenzer@mailbox.org
Subject: [PATCH 5/5] drm/amdgpu: use GTT only as fallback for VRAM|GTT
Date: Fri, 12 Jan 2024 13:51:58 +0100 [thread overview]
Message-ID: <20240112125158.2748-6-christian.koenig@amd.com> (raw)
In-Reply-To: <20240112125158.2748-1-christian.koenig@amd.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.34.1
next prev parent reply other threads:[~2024-01-12 12:52 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-12 12:51 Rework TTMs busy handling Christian König
2024-01-12 12:51 ` [PATCH 1/5] drm/vmwgfx: remove vmw_vram_gmr_placement Christian König
2024-01-12 12:51 ` [PATCH 2/5] drm/ttm: return ENOSPC from ttm_bo_mem_space Christian König
2024-01-17 10:18 ` Thomas Hellström
2024-01-12 12:51 ` [PATCH 3/5] drm/ttm: replace busy placement with flags v6 Christian König
2024-01-17 8:01 ` Thomas Zimmermann
2024-01-17 10:47 ` Thomas Hellström
2024-01-17 12:27 ` Thomas Hellström
2024-01-18 16:38 ` Thomas Hellström
2024-01-26 22:16 ` Lucas De Marchi
2024-01-26 22:22 ` Lucas De Marchi
2024-01-27 15:43 ` Zeng, Oak
2024-01-29 11:00 ` Thomas Hellström
2024-01-12 12:51 ` [PATCH 4/5] drm/ttm: improve idle/busy handling v3 Christian König
2024-01-18 14:24 ` Thomas Hellström
2024-01-18 16:48 ` Thomas Hellström
2024-01-12 12:51 ` Christian König [this message]
2024-01-12 14:04 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/5] drm/vmwgfx: remove vmw_vram_gmr_placement Patchwork
2024-01-12 14:04 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-01-12 14:22 ` ✗ Fi.CI.BAT: failure " Patchwork
2024-01-16 9:57 ` Rework TTMs busy handling Christian König
2024-01-17 3:13 ` Zack Rusin
-- strict thread matches above, loose matches on Subject: below --
2024-01-09 7:47 Christian König
2024-01-09 7:47 ` [PATCH 5/5] drm/amdgpu: use GTT only as fallback for VRAM|GTT Christian König
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=20240112125158.2748-6-christian.koenig@amd.com \
--to=ckoenig.leichtzumerken@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=kherbst@redhat.com \
--cc=lyude@redhat.com \
--cc=michel.daenzer@mailbox.org \
--cc=nouveau@lists.freedesktop.org \
--cc=thomas.hellstrom@linux.intel.com \
--cc=zackr@vmware.com \
/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