summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h
diff options
context:
space:
mode:
authorNirmoy Das <nirmoy.das@amd.com>2021-03-19 19:54:31 +0100
committerAlex Deucher <alexander.deucher@amd.com>2021-04-09 16:38:47 -0400
commit15e16daa35ba15424969cccb1b0aad2b8810e761 (patch)
tree6eebdf138e4bee8fd5097d666a73b850b38140a0 /drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h
parenteec64a5e5d07e6e66a0c7255b4324183ed57df1a (diff)
drm/amdgpu: fix amdgpu_res_first()
Fix size comparison in the resource cursor. Signed-off-by: Nirmoy Das <nirmoy.das@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h
index b49a61d07d60..40f2adf305bc 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h
@@ -64,7 +64,7 @@ static inline void amdgpu_res_first(struct ttm_resource *res,
BUG_ON(start + size > res->num_pages << PAGE_SHIFT);
node = res->mm_node;
- while (start > node->size << PAGE_SHIFT)
+ while (start >= node->size << PAGE_SHIFT)
start -= node++->size << PAGE_SHIFT;
cur->start = (node->start << PAGE_SHIFT) + start;