^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) * Copyright 2020 Advanced Micro Devices, Inc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * Permission is hereby granted, free of charge, to any person obtaining a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * copy of this software and associated documentation files (the "Software"),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * to deal in the Software without restriction, including without limitation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) * the rights to use, copy, modify, merge, publish, distribute, sublicense,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) * and/or sell copies of the Software, and to permit persons to whom the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) * Software is furnished to do so, subject to the following conditions:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) * The above copyright notice and this permission notice shall be included in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) * all copies or substantial portions of the Software.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) * OTHER DEALINGS IN THE SOFTWARE.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) * Authors: Christian König
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) #ifndef _TTM_RESOURCE_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) #define _TTM_RESOURCE_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) #include <linux/types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) #include <linux/mutex.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) #include <linux/dma-fence.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) #include <drm/drm_print.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) #define TTM_MAX_BO_PRIORITY 4U
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) struct ttm_bo_device;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) struct ttm_resource_manager;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) struct ttm_resource;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) struct ttm_place;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) struct ttm_buffer_object;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) struct ttm_resource_manager_func {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) * struct ttm_resource_manager_func member alloc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) * @man: Pointer to a memory type manager.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) * @bo: Pointer to the buffer object we're allocating space for.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) * @placement: Placement details.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) * @flags: Additional placement flags.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) * @mem: Pointer to a struct ttm_resource to be filled in.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) * This function should allocate space in the memory type managed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) * by @man. Placement details if
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) * applicable are given by @placement. If successful,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) * @mem::mm_node should be set to a non-null value, and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) * @mem::start should be set to a value identifying the beginning
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) * of the range allocated, and the function should return zero.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) * If the memory region accommodate the buffer object, @mem::mm_node
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) * should be set to NULL, and the function should return 0.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) * If a system error occurred, preventing the request to be fulfilled,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) * the function should return a negative error code.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) * Note that @mem::mm_node will only be dereferenced by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) * struct ttm_resource_manager functions and optionally by the driver,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) * which has knowledge of the underlying type.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) * This function may not be called from within atomic context, so
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) * an implementation can and must use either a mutex or a spinlock to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) * protect any data structures managing the space.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) int (*alloc)(struct ttm_resource_manager *man,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) struct ttm_buffer_object *bo,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) const struct ttm_place *place,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) struct ttm_resource *mem);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) * struct ttm_resource_manager_func member free
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) * @man: Pointer to a memory type manager.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) * @mem: Pointer to a struct ttm_resource to be filled in.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) * This function frees memory type resources previously allocated
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) * and that are identified by @mem::mm_node and @mem::start. May not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) * be called from within atomic context.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) void (*free)(struct ttm_resource_manager *man,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) struct ttm_resource *mem);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) * struct ttm_resource_manager_func member debug
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) * @man: Pointer to a memory type manager.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) * @printer: Prefix to be used in printout to identify the caller.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) * This function is called to print out the state of the memory
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) * type manager to aid debugging of out-of-memory conditions.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) * It may not be called from within atomic context.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) void (*debug)(struct ttm_resource_manager *man,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) struct drm_printer *printer);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) * struct ttm_resource_manager
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) * @use_type: The memory type is enabled.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) * @flags: TTM_MEMTYPE_XX flags identifying the traits of the memory
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) * managed by this memory type.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) * @gpu_offset: If used, the GPU offset of the first managed page of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) * fixed memory or the first managed location in an aperture.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) * @size: Size of the managed region.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) * @func: structure pointer implementing the range manager. See above
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) * @move_lock: lock for move fence
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) * static information. bdev::driver::io_mem_free is never used.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) * @lru: The lru list for this memory type.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) * @move: The fence of the last pipelined move operation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) * This structure is used to identify and manage memory types for a device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) struct ttm_resource_manager {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) * No protection. Constant from start.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) bool use_type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) bool use_tt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) uint64_t size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) const struct ttm_resource_manager_func *func;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) spinlock_t move_lock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) * Protected by the global->lru_lock.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) struct list_head lru[TTM_MAX_BO_PRIORITY];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) * Protected by @move_lock.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) struct dma_fence *move;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) * struct ttm_bus_placement
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) * @addr: mapped virtual address
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) * @offset: physical addr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) * @is_iomem: is this io memory ?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) * Structure indicating the bus placement of an object.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) struct ttm_bus_placement {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) void *addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) phys_addr_t offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) bool is_iomem;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) * struct ttm_resource
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) * @mm_node: Memory manager node.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) * @size: Requested size of memory region.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) * @num_pages: Actual size of memory region in pages.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) * @page_alignment: Page alignment.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) * @placement: Placement flags.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) * @bus: Placement on io bus accessible to the CPU
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) * Structure indicating the placement and space resources used by a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) * buffer object.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) struct ttm_resource {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) void *mm_node;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) unsigned long start;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) unsigned long size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) unsigned long num_pages;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) uint32_t page_alignment;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) uint32_t mem_type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) uint32_t placement;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) struct ttm_bus_placement bus;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) * ttm_resource_manager_set_used
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) * @man: A memory manager object.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) * @used: usage state to set.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) * Set the manager in use flag. If disabled the manager is no longer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) * used for object placement.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) static inline void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) ttm_resource_manager_set_used(struct ttm_resource_manager *man, bool used)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) man->use_type = used;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) * ttm_resource_manager_used
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) * @man: Manager to get used state for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) * Get the in use flag for a manager.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) * Returns:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) * true is used, false if not.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) static inline bool ttm_resource_manager_used(struct ttm_resource_manager *man)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) return man->use_type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) * ttm_resource_manager_cleanup
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) * @man: A memory manager object.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) * Cleanup the move fences from the memory manager object.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) static inline void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) ttm_resource_manager_cleanup(struct ttm_resource_manager *man)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) dma_fence_put(man->move);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) man->move = NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) int ttm_resource_alloc(struct ttm_buffer_object *bo,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) const struct ttm_place *place,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) struct ttm_resource *res);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) void ttm_resource_free(struct ttm_buffer_object *bo, struct ttm_resource *res);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) void ttm_resource_manager_init(struct ttm_resource_manager *man,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) unsigned long p_size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) int ttm_resource_manager_force_list_clean(struct ttm_bo_device *bdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) struct ttm_resource_manager *man);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) void ttm_resource_manager_debug(struct ttm_resource_manager *man,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) struct drm_printer *p);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) #endif