xref: /linux/drivers/gpu/drm/i915/gt/intel_migrate.h (revision a4eb44a6435d6d8f9e642407a4a06f65eb90ca04)
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 enum i915_cache_level;
20 
21 int intel_migrate_init(struct intel_migrate *m, struct intel_gt *gt);
22 
23 struct intel_context *intel_migrate_create_context(struct intel_migrate *m);
24 
25 int intel_migrate_copy(struct intel_migrate *m,
26 		       struct i915_gem_ww_ctx *ww,
27 		       const struct i915_deps *deps,
28 		       struct scatterlist *src,
29 		       enum i915_cache_level src_cache_level,
30 		       bool src_is_lmem,
31 		       struct scatterlist *dst,
32 		       enum i915_cache_level dst_cache_level,
33 		       bool dst_is_lmem,
34 		       struct i915_request **out);
35 
36 int intel_context_migrate_copy(struct intel_context *ce,
37 			       const struct i915_deps *deps,
38 			       struct scatterlist *src,
39 			       enum i915_cache_level src_cache_level,
40 			       bool src_is_lmem,
41 			       struct scatterlist *dst,
42 			       enum i915_cache_level dst_cache_level,
43 			       bool dst_is_lmem,
44 			       struct i915_request **out);
45 
46 int
47 intel_migrate_clear(struct intel_migrate *m,
48 		    struct i915_gem_ww_ctx *ww,
49 		    const struct i915_deps *deps,
50 		    struct scatterlist *sg,
51 		    enum i915_cache_level cache_level,
52 		    bool is_lmem,
53 		    u32 value,
54 		    struct i915_request **out);
55 int
56 intel_context_migrate_clear(struct intel_context *ce,
57 			    const struct i915_deps *deps,
58 			    struct scatterlist *sg,
59 			    enum i915_cache_level cache_level,
60 			    bool is_lmem,
61 			    u32 value,
62 			    struct i915_request **out);
63 
64 void intel_migrate_fini(struct intel_migrate *m);
65 
66 #endif /* __INTEL_MIGRATE__ */
67