xref: /openbsd-src/sys/dev/pci/drm/i915/gt/intel_migrate.h (revision f005ef32267c16bdb134f0e9fa4477dbe07c263a)
15ca02815Sjsg /* SPDX-License-Identifier: MIT */
25ca02815Sjsg /*
35ca02815Sjsg  * Copyright © 2020 Intel Corporation
45ca02815Sjsg  */
55ca02815Sjsg 
65ca02815Sjsg #ifndef __INTEL_MIGRATE__
75ca02815Sjsg #define __INTEL_MIGRATE__
85ca02815Sjsg 
95ca02815Sjsg #include <linux/types.h>
105ca02815Sjsg 
115ca02815Sjsg #include "intel_migrate_types.h"
125ca02815Sjsg 
135ca02815Sjsg struct dma_fence;
141bb76ff1Sjsg struct i915_deps;
155ca02815Sjsg struct i915_request;
165ca02815Sjsg struct i915_gem_ww_ctx;
175ca02815Sjsg struct intel_gt;
185ca02815Sjsg struct scatterlist;
195ca02815Sjsg 
205ca02815Sjsg int intel_migrate_init(struct intel_migrate *m, struct intel_gt *gt);
215ca02815Sjsg 
225ca02815Sjsg struct intel_context *intel_migrate_create_context(struct intel_migrate *m);
235ca02815Sjsg 
245ca02815Sjsg int intel_migrate_copy(struct intel_migrate *m,
255ca02815Sjsg 		       struct i915_gem_ww_ctx *ww,
261bb76ff1Sjsg 		       const struct i915_deps *deps,
275ca02815Sjsg 		       struct scatterlist *src,
28*f005ef32Sjsg 		       unsigned int src_pat_index,
295ca02815Sjsg 		       bool src_is_lmem,
305ca02815Sjsg 		       struct scatterlist *dst,
31*f005ef32Sjsg 		       unsigned int dst_pat_index,
325ca02815Sjsg 		       bool dst_is_lmem,
335ca02815Sjsg 		       struct i915_request **out);
345ca02815Sjsg 
355ca02815Sjsg int intel_context_migrate_copy(struct intel_context *ce,
361bb76ff1Sjsg 			       const struct i915_deps *deps,
375ca02815Sjsg 			       struct scatterlist *src,
38*f005ef32Sjsg 			       unsigned int src_pat_index,
395ca02815Sjsg 			       bool src_is_lmem,
405ca02815Sjsg 			       struct scatterlist *dst,
41*f005ef32Sjsg 			       unsigned int dst_pat_index,
425ca02815Sjsg 			       bool dst_is_lmem,
435ca02815Sjsg 			       struct i915_request **out);
445ca02815Sjsg 
455ca02815Sjsg int
465ca02815Sjsg intel_migrate_clear(struct intel_migrate *m,
475ca02815Sjsg 		    struct i915_gem_ww_ctx *ww,
481bb76ff1Sjsg 		    const struct i915_deps *deps,
495ca02815Sjsg 		    struct scatterlist *sg,
50*f005ef32Sjsg 		    unsigned int pat_index,
515ca02815Sjsg 		    bool is_lmem,
525ca02815Sjsg 		    u32 value,
535ca02815Sjsg 		    struct i915_request **out);
545ca02815Sjsg int
555ca02815Sjsg intel_context_migrate_clear(struct intel_context *ce,
561bb76ff1Sjsg 			    const struct i915_deps *deps,
575ca02815Sjsg 			    struct scatterlist *sg,
58*f005ef32Sjsg 			    unsigned int pat_index,
595ca02815Sjsg 			    bool is_lmem,
605ca02815Sjsg 			    u32 value,
615ca02815Sjsg 			    struct i915_request **out);
625ca02815Sjsg 
635ca02815Sjsg void intel_migrate_fini(struct intel_migrate *m);
645ca02815Sjsg 
655ca02815Sjsg #endif /* __INTEL_MIGRATE__ */
66