intel_region_ttm.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. #include <linux/types.h>
  8. #include "i915_selftest.h"
  9. struct drm_i915_private;
  10. struct intel_memory_region;
  11. struct ttm_resource;
  12. struct ttm_device_funcs;
  13. int intel_region_ttm_device_init(struct drm_i915_private *dev_priv);
  14. void intel_region_ttm_device_fini(struct drm_i915_private *dev_priv);
  15. int intel_region_ttm_init(struct intel_memory_region *mem);
  16. int intel_region_ttm_fini(struct intel_memory_region *mem);
  17. struct i915_refct_sgt *
  18. intel_region_ttm_resource_to_rsgt(struct intel_memory_region *mem,
  19. struct ttm_resource *res,
  20. u32 page_alignment);
  21. void intel_region_ttm_resource_free(struct intel_memory_region *mem,
  22. struct ttm_resource *res);
  23. int intel_region_to_ttm_type(const struct intel_memory_region *mem);
  24. struct ttm_device_funcs *i915_ttm_driver(void);
  25. #ifdef CONFIG_DRM_I915_SELFTEST
  26. struct ttm_resource *
  27. intel_region_ttm_resource_alloc(struct intel_memory_region *mem,
  28. resource_size_t offset,
  29. resource_size_t size,
  30. unsigned int flags);
  31. #endif
  32. #endif /* _INTEL_REGION_TTM_H_ */