Loading...
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
12struct ttm_buffer_object;
13struct ttm_operation_ctx;
14struct ttm_place;
15struct ttm_resource;
16struct ttm_tt;
17
18struct drm_i915_gem_object;
19struct i915_refct_sgt;
20
21int i915_ttm_move_notify(struct ttm_buffer_object *bo);
22
23I915_SELFTEST_DECLARE(void i915_ttm_migrate_set_failure_modes(bool gpu_migration,
24 bool work_allocation));
25I915_SELFTEST_DECLARE(void i915_ttm_migrate_set_ban_memcpy(bool ban));
26
27int 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
33int 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
38void i915_ttm_adjust_domains_after_move(struct drm_i915_gem_object *obj);
39
40void i915_ttm_adjust_gem_after_move(struct drm_i915_gem_object *obj);
41
42#endif