diff options
| author | Somalapuram Amaranath <[email protected]> | 2022-10-27 09:12:37 +0000 |
|---|---|---|
| committer | Christian König <[email protected]> | 2022-10-27 09:42:58 +0000 |
| commit | e3c92eb4a84fb0f00442e6b5cabf4f11b0eaaf41 (patch) | |
| tree | a7854ee9b2f0c55a69b5d71e01ffad1296b1d909 /drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h | |
| parent | drm/edid: convert to device specific logging (diff) | |
| download | kernel-e3c92eb4a84fb0f00442e6b5cabf4f11b0eaaf41.tar.gz kernel-e3c92eb4a84fb0f00442e6b5cabf4f11b0eaaf41.zip | |
drm/ttm: rework on ttm_resource to use size_t type
Change ttm_resource structure from num_pages to size_t size in bytes.
v1 -> v2: change PFN_UP(dst_mem->size) to ttm->num_pages
v1 -> v2: change bo->resource->size to bo->base.size at some places
v1 -> v2: remove the local variable
v1 -> v2: cleanup cmp_size_smaller_first()
v2 -> v3: adding missing PFN_UP in ttm_bo_vm_fault_reserved
Signed-off-by: Somalapuram Amaranath <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Christian König <[email protected]>
Signed-off-by: Christian König <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h index 6546552e596c..5c4f93ee0c57 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h @@ -62,7 +62,7 @@ static inline void amdgpu_res_first(struct ttm_resource *res, if (!res) goto fallback; - BUG_ON(start + size > res->num_pages << PAGE_SHIFT); + BUG_ON(start + size > res->size); cur->mem_type = res->mem_type; @@ -110,7 +110,7 @@ fallback: cur->size = size; cur->remaining = size; cur->node = NULL; - WARN_ON(res && start + size > res->num_pages << PAGE_SHIFT); + WARN_ON(res && start + size > res->size); return; } |
