summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/intel_region_ttm.h
diff options
context:
space:
mode:
authorThomas Hellström <thomas.hellstrom@linux.intel.com>2021-06-02 11:38:08 +0300
committerMatthew Auld <matthew.auld@intel.com>2021-06-02 15:21:24 +0300
commitd148738923fdb5077089e48ec15555e6008100d0 (patch)
tree953dfd00a68894481fbb6784545632620ea2751d /drivers/gpu/drm/i915/intel_region_ttm.h
parent0e4fe0c9f2f981f26e01b73f3c465ca314c4f9c0 (diff)
downloadlinux-d148738923fdb5077089e48ec15555e6008100d0.tar.xz
drm/i915/ttm Initialize the ttm device and memory managers
Temporarily remove the buddy allocator and related selftests and hook up the TTM range manager for i915 regions. Also modify the mock region selftests somewhat to account for a fragmenting manager. Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com> Signed-off-by: Matthew Auld <matthew.auld@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210602083818.241793-2-thomas.hellstrom@linux.intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/intel_region_ttm.h')
-rw-r--r--drivers/gpu/drm/i915/intel_region_ttm.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_region_ttm.h b/drivers/gpu/drm/i915/intel_region_ttm.h
new file mode 100644
index 000000000000..1c82c6c3429d
--- /dev/null
+++ b/drivers/gpu/drm/i915/intel_region_ttm.h
@@ -0,0 +1,32 @@
+/* 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;
+
+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,
+ void *node);
+
+void *intel_region_ttm_node_alloc(struct intel_memory_region *mem,
+ resource_size_t size,
+ unsigned int flags);
+
+void intel_region_ttm_node_free(struct intel_memory_region *mem,
+ void *node);
+#endif /* _INTEL_REGION_TTM_H_ */