1 /* SPDX-License-Identifier: MIT */
3 * Copyright © 2021 Intel Corporation
5 #ifndef _I915_GEM_TTM_MOVE_H_
6 #define _I915_GEM_TTM_MOVE_H_
8 #include <linux/types.h>
10 #include "i915_selftest.h"
12 struct ttm_buffer_object;
13 struct ttm_operation_ctx;
18 struct drm_i915_gem_object;
19 struct i915_refct_sgt;
21 int i915_ttm_move_notify(struct ttm_buffer_object *bo);
23 I915_SELFTEST_DECLARE(void i915_ttm_migrate_set_failure_modes(bool gpu_migration,
24 bool work_allocation));
25 I915_SELFTEST_DECLARE(void i915_ttm_migrate_set_ban_memcpy(bool ban));
27 int i915_gem_obj_copy_ttm(struct drm_i915_gem_object *dst,
28 struct drm_i915_gem_object *src,
29 bool allow_accel, bool intr);
31 /* Internal I915 TTM declarations and definitions below. */
33 int i915_ttm_move(struct ttm_buffer_object *bo, bool evict,
34 struct ttm_operation_ctx *ctx,
35 struct ttm_resource *dst_mem,
36 struct ttm_place *hop);
38 void i915_ttm_adjust_domains_after_move(struct drm_i915_gem_object *obj);
40 void i915_ttm_adjust_gem_after_move(struct drm_i915_gem_object *obj);