Commit | Line | Data |
---|---|---|
d1487389 TH |
1 | /* SPDX-License-Identifier: MIT */ |
2 | /* | |
3 | * Copyright © 2021 Intel Corporation | |
4 | */ | |
5 | #ifndef _INTEL_REGION_TTM_H_ | |
6 | #define _INTEL_REGION_TTM_H_ | |
7 | ||
8 | #include <linux/types.h> | |
9 | ||
10 | #include "i915_selftest.h" | |
11 | ||
12 | struct drm_i915_private; | |
13 | struct intel_memory_region; | |
2a7005c8 | 14 | struct ttm_resource; |
213d5092 | 15 | struct ttm_device_funcs; |
d1487389 TH |
16 | |
17 | int intel_region_ttm_device_init(struct drm_i915_private *dev_priv); | |
18 | ||
19 | void intel_region_ttm_device_fini(struct drm_i915_private *dev_priv); | |
20 | ||
21 | int intel_region_ttm_init(struct intel_memory_region *mem); | |
22 | ||
8b1f7f92 | 23 | int intel_region_ttm_fini(struct intel_memory_region *mem); |
d1487389 | 24 | |
cad7109a TH |
25 | struct i915_refct_sgt * |
26 | intel_region_ttm_resource_to_rsgt(struct intel_memory_region *mem, | |
aff1e0b0 | 27 | struct ttm_resource *res, |
ced7866d | 28 | u32 page_alignment); |
d1487389 | 29 | |
687c7d0f MA |
30 | void intel_region_ttm_resource_free(struct intel_memory_region *mem, |
31 | struct ttm_resource *res); | |
213d5092 | 32 | |
38f28c06 TH |
33 | int intel_region_to_ttm_type(const struct intel_memory_region *mem); |
34 | ||
213d5092 TH |
35 | struct ttm_device_funcs *i915_ttm_driver(void); |
36 | ||
37 | #ifdef CONFIG_DRM_I915_SELFTEST | |
2a7005c8 | 38 | struct ttm_resource * |
687c7d0f | 39 | intel_region_ttm_resource_alloc(struct intel_memory_region *mem, |
ecbf2060 | 40 | resource_size_t offset, |
687c7d0f MA |
41 | resource_size_t size, |
42 | unsigned int flags); | |
213d5092 | 43 | #endif |
d1487389 | 44 | #endif /* _INTEL_REGION_TTM_H_ */ |