All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: Ramesh.Errabolu@amd.com, amd-gfx@lists.freedesktop.org
Cc: Arunpravin.PaneerSelvam@amd.com
Subject: [PATCH 4/8] drm/amdgpu: use new cursor in amdgpu_ttm_io_mem_pfn
Date: Wed, 17 Feb 2021 20:00:24 +0100	[thread overview]
Message-ID: <20210217190028.16409-4-christian.koenig@amd.com> (raw)
In-Reply-To: <20210217190028.16409-1-christian.koenig@amd.com>

Separate the drm_mm_node walking from the actual handling.

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

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index 59b491998049..d6688a2e525a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -727,12 +727,10 @@ static int amdgpu_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_reso
 static unsigned long amdgpu_ttm_io_mem_pfn(struct ttm_buffer_object *bo,
 					   unsigned long page_offset)
 {
-	uint64_t offset = (page_offset << PAGE_SHIFT);
-	struct drm_mm_node *mm;
+	struct amdgpu_res_cursor cursor;
 
-	mm = amdgpu_find_mm_node(&bo->mem, &offset);
-	return (bo->mem.bus.base >> PAGE_SHIFT) + mm->start +
-		(offset >> PAGE_SHIFT);
+	amdgpu_res_first(&bo->mem, (u64)page_offset << PAGE_SHIFT, 0, &cursor);
+	return (bo->mem.bus.base + cursor.start) >> PAGE_SHIFT;
 }
 
 /**
-- 
2.25.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2021-02-17 19:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-17 19:00 [PATCH 1/8] drm/amdgpu: new resource cursor Christian König
2021-02-17 19:00 ` [PATCH 2/8] drm/amdgpu: use the new cursor in amdgpu_ttm_copy_mem_to_mem Christian König
2021-02-17 19:00 ` [PATCH 3/8] drm/amdgpu: use the new cursor in amdgpu_fill_buffer Christian König
2021-02-17 19:00 ` Christian König [this message]
2021-02-17 19:00 ` [PATCH 5/8] drm/amdgpu: use the new cursor in amdgpu_ttm_access_memory Christian König
2021-02-17 19:00 ` [PATCH 6/8] drm/amdgpu: use new cursor in amdgpu_mem_visible Christian König
2021-02-17 19:00 ` [PATCH 7/8] drm/amdgpu: use the new cursor in amdgpu_ttm_bo_eviction_valuable Christian König
2021-02-17 19:00 ` [PATCH 8/8] drm/amdgpu: use the new cursor in the VM code Christian König
2021-02-17 21:18 ` [PATCH 1/8] drm/amdgpu: new resource cursor Zeng, Oak
2021-02-18 10:11 ` Nirmoy
2021-03-08 13:40 Christian König
2021-03-08 13:40 ` [PATCH 4/8] drm/amdgpu: use new cursor in amdgpu_ttm_io_mem_pfn 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=20210217190028.16409-4-christian.koenig@amd.com \
    --to=ckoenig.leichtzumerken@gmail.com \
    --cc=Arunpravin.PaneerSelvam@amd.com \
    --cc=Ramesh.Errabolu@amd.com \
    --cc=amd-gfx@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 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.