aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h
diff options
context:
space:
mode:
authorTony Lindgren <[email protected]>2021-07-27 11:25:08 +0300
committerTony Lindgren <[email protected]>2021-07-27 11:25:08 +0300
commit353b7a55dcaf5fb8758e09ebe2ddf5f3adbac7c5 (patch)
tree081200957b3d8925cbe913020d45a4e3ba61a7a3 /drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h
parent3ff340e24c9dd5cff9fc07d67914c5adf67f80d6 (diff)
parentc68ef4ad180e09805fa46965d15e1dfadf09ffa5 (diff)
Merge branch 'fixes-v5.14' into fixes
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h5
1 files changed, 3 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 40f2adf305bc..59e0fefb15aa 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h
@@ -28,6 +28,7 @@
#include <drm/drm_mm.h>
#include <drm/ttm/ttm_resource.h>
+#include <drm/ttm/ttm_range_manager.h>
/* state back for walking over vram_mgr and gtt_mgr allocations */
struct amdgpu_res_cursor {
@@ -53,7 +54,7 @@ static inline void amdgpu_res_first(struct ttm_resource *res,
{
struct drm_mm_node *node;
- if (!res || !res->mm_node) {
+ if (!res) {
cur->start = start;
cur->size = size;
cur->remaining = size;
@@ -63,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;
+ node = to_ttm_range_mgr_node(res)->mm_nodes;
while (start >= node->size << PAGE_SHIFT)
start -= node++->size << PAGE_SHIFT;