Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: MIT */
0002 /*
0003  * Copyright © 2021 Intel Corporation
0004  */
0005 
0006 #ifndef _I915_DEPS_H_
0007 #define _I915_DEPS_H_
0008 
0009 #include <linux/types.h>
0010 
0011 struct ttm_operation_ctx;
0012 struct dma_fence;
0013 struct dma_resv;
0014 
0015 /**
0016  * struct i915_deps - Collect dependencies into a single dma-fence
0017  * @single: Storage for pointer if the collection is a single fence.
0018  * @fences: Allocated array of fence pointers if more than a single fence;
0019  * otherwise points to the address of @single.
0020  * @num_deps: Current number of dependency fences.
0021  * @fences_size: Size of the @fences array in number of pointers.
0022  * @gfp: Allocation mode.
0023  */
0024 struct i915_deps {
0025     struct dma_fence *single;
0026     struct dma_fence **fences;
0027     unsigned int num_deps;
0028     unsigned int fences_size;
0029     gfp_t gfp;
0030 };
0031 
0032 void i915_deps_init(struct i915_deps *deps, gfp_t gfp);
0033 
0034 void i915_deps_fini(struct i915_deps *deps);
0035 
0036 int i915_deps_add_dependency(struct i915_deps *deps,
0037                  struct dma_fence *fence,
0038                  const struct ttm_operation_ctx *ctx);
0039 
0040 int i915_deps_add_resv(struct i915_deps *deps, struct dma_resv *resv,
0041                const struct ttm_operation_ctx *ctx);
0042 
0043 int i915_deps_sync(const struct i915_deps *deps,
0044            const struct ttm_operation_ctx *ctx);
0045 #endif