public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH 1/2] drm/ttm: Clean up page shift operation
@ 2022-11-16  8:50 Somalapuram Amaranath
  2022-11-16  8:50 ` [Intel-gfx] [PATCH 2/2] drm/gem: Remove BUG_ON in drm_gem_private_object_init Somalapuram Amaranath
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Somalapuram Amaranath @ 2022-11-16  8:50 UTC (permalink / raw)
  To: dri-devel, amd-gfx, intel-gfx
  Cc: alexander.deucher, Somalapuram Amaranath, arunpravin.paneerselvam,
	christian.koenig

remove page shift operations as ttm_resource moved
from num_pages to size_t size in bytes.

Signed-off-by: Somalapuram Amaranath <Amaranath.Somalapuram@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 4 +---
 drivers/gpu/drm/ttm/ttm_range_manager.c    | 2 +-
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
index 974e85d8b6cc..19ad365dc159 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
@@ -541,12 +541,10 @@ int amdgpu_bo_create(struct amdgpu_device *adev,
 	if (bp->domain & (AMDGPU_GEM_DOMAIN_GWS | AMDGPU_GEM_DOMAIN_OA)) {
 		/* GWS and OA don't need any alignment. */
 		page_align = bp->byte_align;
-		size <<= PAGE_SHIFT;
-
 	} else if (bp->domain & AMDGPU_GEM_DOMAIN_GDS) {
 		/* Both size and alignment must be a multiple of 4. */
 		page_align = ALIGN(bp->byte_align, 4);
-		size = ALIGN(size, 4) << PAGE_SHIFT;
+		size = ALIGN(size, 4);
 	} else {
 		/* Memory should be aligned at least to a page size. */
 		page_align = ALIGN(bp->byte_align, PAGE_SIZE) >> PAGE_SHIFT;
diff --git a/drivers/gpu/drm/ttm/ttm_range_manager.c b/drivers/gpu/drm/ttm/ttm_range_manager.c
index 0a8bc0b7f380..4c7cba4ffdbf 100644
--- a/drivers/gpu/drm/ttm/ttm_range_manager.c
+++ b/drivers/gpu/drm/ttm/ttm_range_manager.c
@@ -83,7 +83,7 @@ static int ttm_range_man_alloc(struct ttm_resource_manager *man,
 
 	spin_lock(&rman->lock);
 	ret = drm_mm_insert_node_in_range(mm, &node->mm_nodes[0],
-					  PFN_UP(node->base.size),
+					  node->base.size,
 					  bo->page_alignment, 0,
 					  place->fpfn, lpfn, mode);
 	spin_unlock(&rman->lock);
-- 
2.32.0


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

end of thread, other threads:[~2022-11-22 18:23 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-16  8:50 [Intel-gfx] [PATCH 1/2] drm/ttm: Clean up page shift operation Somalapuram Amaranath
2022-11-16  8:50 ` [Intel-gfx] [PATCH 2/2] drm/gem: Remove BUG_ON in drm_gem_private_object_init Somalapuram Amaranath
2022-11-16  9:20   ` Arunpravin Paneer Selvam
2022-11-16 10:26     ` Christian König
2022-11-22  5:18     ` Somalapuram, Amaranath
2022-11-22  6:23       ` Arunpravin Paneer Selvam
2022-11-16 12:25 ` [Intel-gfx] [PATCH 1/2] drm/ttm: Clean up page shift operation Christian König
2022-11-16 18:38 ` [Intel-gfx] ✓ Fi.CI.BAT: success for series starting with [1/2] " Patchwork
2022-11-17  1:08 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2022-11-18  2:45 ` [Intel-gfx] [PATCH 1/2] " kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox