All of
 help / color / mirror / Atom feed
From: "Christian König" <>
Subject: [PATCH] drm/amdgpu: make sure to only process the remaining VM range
Date: Mon, 15 Mar 2021 13:58:21 +0100	[thread overview]
Message-ID: <> (raw)

We should only map the remaining size here and not the whole segment.

Signed-off-by: Christian König <>
Fixes: 3af0a018a728 ("drm/amdgpu: new resource cursor")
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index 318eeea577b5..ad1698bd6b24 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -1646,7 +1646,8 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
 	while (cursor.remaining) {
 		uint64_t tmp, num_entries, addr;
-		num_entries = cursor.size >> AMDGPU_GPU_PAGE_SHIFT;
+		num_entries = min(cursor.size, cursor.remaining)
 		if (pages_addr) {
 			bool contiguous = true;

amd-gfx mailing list

                 reply	other threads:[~2021-03-15 12:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \

* 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.