From: Matthew Auld <matthew.auld@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
dri-devel@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH 4/4] drm/i915/ttm: ensure we unmap when shrinking
Date: Wed, 5 Jan 2022 14:58:35 +0000 [thread overview]
Message-ID: <20220105145835.142950-4-matthew.auld@intel.com> (raw)
In-Reply-To: <20220105145835.142950-1-matthew.auld@intel.com>
Assuming we don't purge the pages, but instead swap them out then we
need to ensure we also unmap the object.
Fixes: 7ae034590cea ("drm/i915/ttm: add tt shmem backend")
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
---
drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
index f148e7e48f86..adbbd57bb9bf 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
@@ -462,6 +462,8 @@ static int i915_ttm_shrinker_release_pages(struct drm_i915_gem_object *obj,
if (bo->ttm->page_flags & TTM_TT_FLAG_SWAPPED)
return 0;
+ ttm_bo_unmap_virtual(bo);
+
bo->ttm->page_flags |= TTM_TT_FLAG_SWAPPED;
ret = ttm_bo_validate(bo, &place, &ctx);
if (ret) {
--
2.31.1
next prev parent reply other threads:[~2022-01-05 15:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-05 14:58 [Intel-gfx] [PATCH 1/4] drm/i915: don't call free_mmap_offset when purging Matthew Auld
2022-01-05 14:58 ` [Intel-gfx] [PATCH 2/4] drm/i915/ttm: only fault WILLNEED objects Matthew Auld
2022-01-05 15:09 ` Thomas Hellström
2022-01-05 14:58 ` [Intel-gfx] [PATCH 3/4] drm/i915/ttm: ensure we unmap when purging Matthew Auld
2022-01-05 15:28 ` Thomas Hellström
2022-01-05 14:58 ` Matthew Auld [this message]
2022-01-05 15:46 ` [Intel-gfx] [PATCH 1/4] drm/i915: don't call free_mmap_offset " Thomas Hellström
2022-01-05 16:03 ` Matthew Auld
2022-01-05 16:06 ` Thomas Hellström
2022-01-05 16:13 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/4] " Patchwork
2022-01-05 16:43 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-01-05 18:27 ` [Intel-gfx] ✗ Fi.CI.IGT: 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=20220105145835.142950-4-matthew.auld@intel.com \
--to=matthew.auld@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=thomas.hellstrom@linux.intel.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