xref: /linux/drivers/gpu/drm/i915/gt/intel_migrate.h (revision be239684b18e1cdcafcf8c7face4a2f562c745ad)
1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright © 2020 Intel Corporation
4  */
5 
6 #ifndef __INTEL_MIGRATE__
7 #define __INTEL_MIGRATE__
8 
9 #include <linux/types.h>
10 
11 #include "intel_migrate_types.h"
12 
13 struct dma_fence;
14 struct i915_deps;
15 struct i915_request;
16 struct i915_gem_ww_ctx;
17 struct intel_gt;
18 struct scatterlist;
19 
20 int intel_migrate_init(struct intel_migrate *m, struct intel_gt *gt);
21 
22 struct intel_context *intel_migrate_create_context(struct intel_migrate *m);
23 
24 int intel_migrate_copy(struct intel_migrate *m,
25 		       struct i915_gem_ww_ctx *ww,
26 		       const struct i915_deps *deps,
27 		       struct scatterlist *src,
28 		       unsigned int src_pat_index,
29 		       bool src_is_lmem,
30 		       struct scatterlist *dst,
31 		       unsigned int dst_pat_index,
32 		       bool dst_is_lmem,
33 		       struct i915_request **out);
34 
35 int intel_context_migrate_copy(struct intel_context *ce,
36 			       const struct i915_deps *deps,
37 			       struct scatterlist *src,
38 			       unsigned int src_pat_index,
39 			       bool src_is_lmem,
40 			       struct scatterlist *dst,
41 			       unsigned int dst_pat_index,
42 			       bool dst_is_lmem,
43 			       struct i915_request **out);
44 
45 int
46 intel_migrate_clear(struct intel_migrate *m,
47 		    struct i915_gem_ww_ctx *ww,
48 		    const struct i915_deps *deps,
49 		    struct scatterlist *sg,
50 		    unsigned int pat_index,
51 		    bool is_lmem,
52 		    u32 value,
53 		    struct i915_request **out);
54 int
55 intel_context_migrate_clear(struct intel_context *ce,
56 			    const struct i915_deps *deps,
57 			    struct scatterlist *sg,
58 			    unsigned int pat_index,
59 			    bool is_lmem,
60 			    u32 value,
61 			    struct i915_request **out);
62 
63 void intel_migrate_fini(struct intel_migrate *m);
64 
65 #endif /* __INTEL_MIGRATE__ */
66