dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Lang Yu <Lang.Yu@amd.com>
To: <amd-gfx@lists.freedesktop.org>, <dri-devel@lists.freedesktop.org>
Cc: "Marek Olsak" <Marek.Olsak@amd.com>,
	"Christian Koenig" <Christian.Koenig@amd.com>,
	"Huang Rui" <ray.huang@amd.com>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Lang Yu" <Lang.Yu@amd.com>,
	"Thomas Hellströ" <thomas_os@shipmail.org>
Subject: [PATCH 2/3] drm/ttm: check with temporary GTT memory in BO validation
Date: Mon, 31 May 2021 16:22:40 +0800	[thread overview]
Message-ID: <20210531082241.4254-2-Lang.Yu@amd.com> (raw)
In-Reply-To: <20210531082241.4254-1-Lang.Yu@amd.com>

If a BO's backing store is temporary GTT memory, we should
move it in BO validation.

Signed-off-by: Lang Yu <Lang.Yu@amd.com>
---
 drivers/gpu/drm/ttm/ttm_bo.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index c32a37d0a460..80c8cb2c3f31 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -944,6 +944,8 @@ static bool ttm_bo_places_compat(const struct ttm_place *places,
 		if ((mem->start < heap->fpfn ||
 		     (heap->lpfn != 0 && (mem->start + mem->num_pages) > heap->lpfn)))
 			continue;
+		if (mem->placement & TTM_PL_FLAG_TEMPORARY)
+			continue;
 
 		*new_flags = heap->flags;
 		if ((mem->mem_type == heap->mem_type) &&
-- 
2.25.1


  reply	other threads:[~2021-05-31  8:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-31  8:22 [PATCH v2 1/3] drm/ttm: cleanup and add TTM_PL_FLAG_TEMPORARY flag Lang Yu
2021-05-31  8:22 ` Lang Yu [this message]
2021-05-31  9:04   ` [PATCH 2/3] drm/ttm: check with temporary GTT memory in BO validation Christian König
2021-05-31  8:22 ` [PATCH v2 3/3] drm/amdgpu: allow temporary GTT allocation under memory pressure Lang Yu
2021-05-31 12:48   ` Christian König
2021-05-31 12:59     ` Yu, Lang

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=20210531082241.4254-2-Lang.Yu@amd.com \
    --to=lang.yu@amd.com \
    --cc=Christian.Koenig@amd.com \
    --cc=Marek.Olsak@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=ray.huang@amd.com \
    --cc=thomas_os@shipmail.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