1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright © 2021 Intel Corporation
4  */
5 #ifndef _I915_GEM_TTM_MOVE_H_
6 #define _I915_GEM_TTM_MOVE_H_
7 
8 #include <linux/types.h>
9 
10 #include "i915_selftest.h"
11 
12 struct ttm_buffer_object;
13 struct ttm_operation_ctx;
14 struct ttm_place;
15 struct ttm_resource;
16 struct ttm_tt;
17 
18 struct drm_i915_gem_object;
19 struct i915_refct_sgt;
20 
21 int i915_ttm_move_notify(struct ttm_buffer_object *bo);
22 
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));
26 
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);
30 
31 /* Internal I915 TTM declarations and definitions below. */
32 
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);
37 
38 void i915_ttm_adjust_domains_after_move(struct drm_i915_gem_object *obj);
39 
40 void i915_ttm_adjust_gem_after_move(struct drm_i915_gem_object *obj);
41 
42 #endif
43