All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] drm/amdgpu: Movie the amdgpu_gtt_mgr start and size from pages to bytes
@ 2023-01-25 10:00 ` Somalapuram Amaranath
  0 siblings, 0 replies; 18+ messages in thread
From: Somalapuram Amaranath @ 2023-01-25 10:00 UTC (permalink / raw)
  To: dri-devel, amd-gfx, intel-gfx, nouveau
  Cc: shashank.sharma, arunpravin.paneerselvam, Somalapuram Amaranath,
	arvind.yadav, alexander.deucher, christian.koenig

To support GTT manager amdgpu_res_first, amdgpu_res_next
from pages to bytes and clean up PAGE_SHIFT operation.

Signed-off-by: Somalapuram Amaranath <Amaranath.Somalapuram@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h
index 5c4f93ee0c57..5c78f0b09351 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h
@@ -94,8 +94,8 @@ static inline void amdgpu_res_first(struct ttm_resource *res,
 		while (start >= node->size << PAGE_SHIFT)
 			start -= node++->size << PAGE_SHIFT;
 
-		cur->start = (node->start << PAGE_SHIFT) + start;
-		cur->size = min((node->size << PAGE_SHIFT) - start, size);
+		cur->start = node->start + start;
+		cur->size = min(node->size - start, size);
 		cur->remaining = size;
 		cur->node = node;
 		break;
@@ -155,8 +155,8 @@ static inline void amdgpu_res_next(struct amdgpu_res_cursor *cur, uint64_t size)
 		node = cur->node;
 
 		cur->node = ++node;
-		cur->start = node->start << PAGE_SHIFT;
-		cur->size = min(node->size << PAGE_SHIFT, cur->remaining);
+		cur->start = node->start;
+		cur->size = min(node->size, cur->remaining);
 		break;
 	default:
 		return;
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2023-05-04 12:33 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-25 10:00 [PATCH 1/4] drm/amdgpu: Movie the amdgpu_gtt_mgr start and size from pages to bytes Somalapuram Amaranath
2023-01-25 10:00 ` [Nouveau] " Somalapuram Amaranath
2023-01-25 10:00 ` [Intel-gfx] " Somalapuram Amaranath
2023-01-25 10:00 ` [PATCH 2/4] drm/amdgpu: Support allocate of amdgpu_gtt_mgr " Somalapuram Amaranath
2023-01-25 10:00   ` [Nouveau] " Somalapuram Amaranath
2023-01-25 10:00   ` [Intel-gfx] " Somalapuram Amaranath
2023-01-25 10:00 ` [PATCH 3/4] drm/amdgpu: Use cursor start instead of ttm resource start Somalapuram Amaranath
2023-01-25 10:00   ` [Nouveau] " Somalapuram Amaranath
2023-01-25 10:00   ` [Intel-gfx] " Somalapuram Amaranath
2023-01-25 10:00 ` [PATCH 4/4] drm/amdkfd: " Somalapuram Amaranath
2023-01-25 10:00   ` [Nouveau] " Somalapuram Amaranath
2023-01-25 10:00   ` [Intel-gfx] " Somalapuram Amaranath
2023-01-25 10:04 ` [Nouveau] [PATCH 1/4] drm/amdgpu: Movie the amdgpu_gtt_mgr start and size from pages to bytes Christian König
2023-01-25 10:04   ` [Intel-gfx] " Christian König
2023-01-25 10:04   ` Christian König
2023-01-25 19:48 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for series starting with [1/4] " Patchwork
2023-01-25 20:10 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-01-26  6:30 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork

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.