summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/gt/intel_migrate.h
blob: 11fc09a00c4bea326a76a95638ff989b616f5205 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/* SPDX-License-Identifier: MIT */
/*
 * Copyright © 2020 Intel Corporation
 */

#ifndef __INTEL_MIGRATE__
#define __INTEL_MIGRATE__

#include <linux/types.h>

#include "intel_migrate_types.h"

struct dma_fence;
struct i915_deps;
struct i915_request;
struct i915_gem_ww_ctx;
struct intel_gt;
struct scatterlist;

int intel_migrate_init(struct intel_migrate *m, struct intel_gt *gt);

struct intel_context *intel_migrate_create_context(struct intel_migrate *m);

int intel_migrate_copy(struct intel_migrate *m,
		       struct i915_gem_ww_ctx *ww,
		       const struct i915_deps *deps,
		       struct scatterlist *src,
		       unsigned int src_pat_index,
		       bool src_is_lmem,
		       struct scatterlist *dst,
		       unsigned int dst_pat_index,
		       bool dst_is_lmem,
		       struct i915_request **out);

int intel_context_migrate_copy(struct intel_context *ce,
			       const struct i915_deps *deps,
			       struct scatterlist *src,
			       unsigned int src_pat_index,
			       bool src_is_lmem,
			       struct scatterlist *dst,
			       unsigned int dst_pat_index,
			       bool dst_is_lmem,
			       struct i915_request **out);

int
intel_migrate_clear(struct intel_migrate *m,
		    struct i915_gem_ww_ctx *ww,
		    const struct i915_deps *deps,
		    struct scatterlist *sg,
		    unsigned int pat_index,
		    bool is_lmem,
		    u32 value,
		    struct i915_request **out);
int
intel_context_migrate_clear(struct intel_context *ce,
			    const struct i915_deps *deps,
			    struct scatterlist *sg,
			    unsigned int pat_index,
			    bool is_lmem,
			    u32 value,
			    struct i915_request **out);

void intel_migrate_fini(struct intel_migrate *m);

#endif /* __INTEL_MIGRATE__ */