Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: MIT */
0002 /*
0003  * Copyright © 2021 Intel Corporation
0004  */
0005 #ifndef _INTEL_REGION_TTM_H_
0006 #define _INTEL_REGION_TTM_H_
0007 
0008 #include <linux/types.h>
0009 
0010 #include "i915_selftest.h"
0011 
0012 struct drm_i915_private;
0013 struct intel_memory_region;
0014 struct ttm_resource;
0015 struct ttm_device_funcs;
0016 
0017 int intel_region_ttm_device_init(struct drm_i915_private *dev_priv);
0018 
0019 void intel_region_ttm_device_fini(struct drm_i915_private *dev_priv);
0020 
0021 int intel_region_ttm_init(struct intel_memory_region *mem);
0022 
0023 int intel_region_ttm_fini(struct intel_memory_region *mem);
0024 
0025 struct i915_refct_sgt *
0026 intel_region_ttm_resource_to_rsgt(struct intel_memory_region *mem,
0027                   struct ttm_resource *res,
0028                   u32 page_alignment);
0029 
0030 void intel_region_ttm_resource_free(struct intel_memory_region *mem,
0031                     struct ttm_resource *res);
0032 
0033 int intel_region_to_ttm_type(const struct intel_memory_region *mem);
0034 
0035 struct ttm_device_funcs *i915_ttm_driver(void);
0036 
0037 #ifdef CONFIG_DRM_I915_SELFTEST
0038 struct ttm_resource *
0039 intel_region_ttm_resource_alloc(struct intel_memory_region *mem,
0040                 resource_size_t offset,
0041                 resource_size_t size,
0042                 unsigned int flags);
0043 #endif
0044 #endif /* _INTEL_REGION_TTM_H_ */