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 
26 int i915_gem_obj_copy_ttm(struct drm_i915_gem_object *dst,
27 			  struct drm_i915_gem_object *src,
28 			  bool allow_accel, bool intr);
29 
30 /* Internal I915 TTM declarations and definitions below. */
31 
32 int i915_ttm_move(struct ttm_buffer_object *bo, bool evict,
33 		  struct ttm_operation_ctx *ctx,
34 		  struct ttm_resource *dst_mem,
35 		  struct ttm_place *hop);
36 
37 void i915_ttm_adjust_domains_after_move(struct drm_i915_gem_object *obj);
38 
39 void i915_ttm_adjust_gem_after_move(struct drm_i915_gem_object *obj);
40 
41 #endif
42