2021-06-02 16:38:08 +08:00
|
|
|
/* SPDX-License-Identifier: MIT */
|
|
|
|
/*
|
|
|
|
* Copyright © 2021 Intel Corporation
|
|
|
|
*/
|
|
|
|
#ifndef _INTEL_REGION_TTM_H_
|
|
|
|
#define _INTEL_REGION_TTM_H_
|
|
|
|
|
|
|
|
#include <linux/types.h>
|
|
|
|
|
|
|
|
#include "i915_selftest.h"
|
|
|
|
|
|
|
|
struct drm_i915_private;
|
|
|
|
struct intel_memory_region;
|
2021-06-11 11:34:42 +08:00
|
|
|
struct ttm_resource;
|
2021-06-10 15:01:49 +08:00
|
|
|
struct ttm_device_funcs;
|
2021-06-02 16:38:08 +08:00
|
|
|
|
|
|
|
int intel_region_ttm_device_init(struct drm_i915_private *dev_priv);
|
|
|
|
|
|
|
|
void intel_region_ttm_device_fini(struct drm_i915_private *dev_priv);
|
|
|
|
|
|
|
|
int intel_region_ttm_init(struct intel_memory_region *mem);
|
|
|
|
|
|
|
|
void intel_region_ttm_fini(struct intel_memory_region *mem);
|
|
|
|
|
|
|
|
struct sg_table *intel_region_ttm_node_to_st(struct intel_memory_region *mem,
|
2021-06-11 11:34:42 +08:00
|
|
|
struct ttm_resource *res);
|
2021-06-02 16:38:08 +08:00
|
|
|
|
2021-06-10 15:01:49 +08:00
|
|
|
void intel_region_ttm_node_free(struct intel_memory_region *mem,
|
|
|
|
struct ttm_resource *node);
|
|
|
|
|
2021-06-16 23:24:57 +08:00
|
|
|
int intel_region_to_ttm_type(const struct intel_memory_region *mem);
|
|
|
|
|
2021-06-10 15:01:49 +08:00
|
|
|
struct ttm_device_funcs *i915_ttm_driver(void);
|
|
|
|
|
|
|
|
#ifdef CONFIG_DRM_I915_SELFTEST
|
2021-06-11 11:34:42 +08:00
|
|
|
struct ttm_resource *
|
|
|
|
intel_region_ttm_node_alloc(struct intel_memory_region *mem,
|
|
|
|
resource_size_t size,
|
|
|
|
unsigned int flags);
|
2021-06-10 15:01:49 +08:00
|
|
|
#endif
|
2021-06-02 16:38:08 +08:00
|
|
|
#endif /* _INTEL_REGION_TTM_H_ */
|