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

Signed-off-by: Somalapuram Amaranath <amaranath.somalapu...@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c     |  4 +---
 drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h | 12 ++++++------
 2 files changed, 7 insertions(+), 9 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/amd/amdgpu/amdgpu_res_cursor.h 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h
index 5c4f93ee0c57..f92b61350efe 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h
@@ -91,11 +91,11 @@ static inline void amdgpu_res_first(struct ttm_resource 
*res,
                break;
        case TTM_PL_TT:
                node = to_ttm_range_mgr_node(res)->mm_nodes;
-               while (start >= node->size << PAGE_SHIFT)
-                       start -= node++->size << PAGE_SHIFT;
+               while (start >= node->size)
+                       start -= node++->size;
 
-               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

Reply via email to