forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/gpu/drm/ttm/ttm_page_alloc.c
....@@ -1028,7 +1028,7 @@
10281028 static void
10291029 ttm_pool_unpopulate_helper(struct ttm_tt *ttm, unsigned mem_count_update)
10301030 {
1031
- struct ttm_mem_global *mem_glob = ttm->bdev->glob->mem_glob;
1031
+ struct ttm_mem_global *mem_glob = &ttm_mem_glob;
10321032 unsigned i;
10331033
10341034 if (mem_count_update == 0)
....@@ -1044,16 +1044,16 @@
10441044 put_pages:
10451045 ttm_put_pages(ttm->pages, ttm->num_pages, ttm->page_flags,
10461046 ttm->caching_state);
1047
- ttm->state = tt_unpopulated;
1047
+ ttm_tt_set_unpopulated(ttm);
10481048 }
10491049
10501050 int ttm_pool_populate(struct ttm_tt *ttm, struct ttm_operation_ctx *ctx)
10511051 {
1052
- struct ttm_mem_global *mem_glob = ttm->bdev->glob->mem_glob;
1052
+ struct ttm_mem_global *mem_glob = &ttm_mem_glob;
10531053 unsigned i;
10541054 int ret;
10551055
1056
- if (ttm->state != tt_unpopulated)
1056
+ if (ttm_tt_is_populated(ttm))
10571057 return 0;
10581058
10591059 if (ttm_check_under_lowerlimit(mem_glob, ttm->num_pages, ctx))
....@@ -1083,7 +1083,7 @@
10831083 }
10841084 }
10851085
1086
- ttm->state = tt_unbound;
1086
+ ttm_tt_set_populated(ttm);
10871087 return 0;
10881088 }
10891089 EXPORT_SYMBOL(ttm_pool_populate);