// SPDX-License-Identifier: MIT /* * Copyright © 2022 Intel Corporation */ #include "xe_bo_evict.h" #include "xe_bo.h" #include "xe_device.h" #include "xe_ggtt.h" #include "xe_tile.h" /** * xe_bo_evict_all - evict all BOs from VRAM * * @xe: xe device * * Evict non-pinned user BOs first (via GPU), evict pinned external BOs next * (via GPU), wait for evictions, and finally evict pinned kernel BOs via CPU. * All eviction magic done via TTM calls. * * Evict == move VRAM BOs to temporary (typically system) memory. * * This function should be called before the device goes into a suspend state * where the VRAM loses power. */ int xe_bo_evict_all(struct xe_device *xe) { … } /** * xe_bo_restore_kernel - restore kernel BOs to VRAM * * @xe: xe device * * Move kernel BOs from temporary (typically system) memory to VRAM via CPU. All * moves done via TTM calls. * * This function should be called early, before trying to init the GT, on device * resume. */ int xe_bo_restore_kernel(struct xe_device *xe) { … } /** * xe_bo_restore_user - restore pinned user BOs to VRAM * * @xe: xe device * * Move pinned user BOs from temporary (typically system) memory to VRAM via * CPU. All moves done via TTM calls. * * This function should be called late, after GT init, on device resume. */ int xe_bo_restore_user(struct xe_device *xe) { … }