^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /**************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * Copyright (c) 2006-2009 Vmware, Inc., Palo Alto, CA., USA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * All Rights Reserved.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * Permission is hereby granted, free of charge, to any person obtaining a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) * copy of this software and associated documentation files (the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) * "Software"), to deal in the Software without restriction, including
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) * without limitation the rights to use, copy, modify, merge, publish,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) * distribute, sub license, and/or sell copies of the Software, and to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) * permit persons to whom the Software is furnished to do so, subject to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) * the following conditions:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) * The above copyright notice and this permission notice (including the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) * next paragraph) shall be included in all copies or substantial portions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) * of the Software.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) * USE OR OTHER DEALINGS IN THE SOFTWARE.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) **************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) #ifndef _TTM_TT_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) #define _TTM_TT_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) #include <linux/types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) struct ttm_tt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) struct ttm_resource;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) struct ttm_buffer_object;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) struct ttm_operation_ctx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) #define TTM_PAGE_FLAG_WRITE (1 << 3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) #define TTM_PAGE_FLAG_SWAPPED (1 << 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) #define TTM_PAGE_FLAG_PERSISTENT_SWAP (1 << 5)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) #define TTM_PAGE_FLAG_ZERO_ALLOC (1 << 6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) #define TTM_PAGE_FLAG_DMA32 (1 << 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) #define TTM_PAGE_FLAG_SG (1 << 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) #define TTM_PAGE_FLAG_NO_RETRY (1 << 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) #define TTM_PAGE_FLAG_PRIV_POPULATED (1 << 31)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) enum ttm_caching_state {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) tt_uncached,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) tt_wc,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) tt_cached
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) * struct ttm_tt
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) * @pages: Array of pages backing the data.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) * @num_pages: Number of pages in the page array.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) * @bdev: Pointer to the current struct ttm_bo_device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) * @be: Pointer to the ttm backend.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) * @swap_storage: Pointer to shmem struct file for swap storage.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) * @caching_state: The current caching state of the pages.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) * @state: The current binding state of the pages.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) * This is a structure holding the pages, caching- and aperture binding
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) * status for a buffer object that isn't backed by fixed (VRAM / AGP)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) * memory.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) struct ttm_tt {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) struct page **pages;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) uint32_t page_flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) unsigned long num_pages;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) struct sg_table *sg; /* for SG objects via dma-buf */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) struct file *swap_storage;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) enum ttm_caching_state caching_state;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) static inline bool ttm_tt_is_populated(struct ttm_tt *tt)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) return tt->page_flags & TTM_PAGE_FLAG_PRIV_POPULATED;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) static inline void ttm_tt_set_unpopulated(struct ttm_tt *tt)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) tt->page_flags &= ~TTM_PAGE_FLAG_PRIV_POPULATED;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) static inline void ttm_tt_set_populated(struct ttm_tt *tt)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) tt->page_flags |= TTM_PAGE_FLAG_PRIV_POPULATED;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) * struct ttm_dma_tt
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) * @ttm: Base ttm_tt struct.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) * @dma_address: The DMA (bus) addresses of the pages
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) * @pages_list: used by some page allocation backend
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) * This is a structure holding the pages, caching- and aperture binding
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) * status for a buffer object that isn't backed by fixed (VRAM / AGP)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) * memory.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) struct ttm_dma_tt {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) struct ttm_tt ttm;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) dma_addr_t *dma_address;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) struct list_head pages_list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) * ttm_tt_create
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) * @bo: pointer to a struct ttm_buffer_object
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) * @zero_alloc: true if allocated pages needs to be zeroed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) * Make sure we have a TTM structure allocated for the given BO.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) * No pages are actually allocated.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) int ttm_tt_create(struct ttm_buffer_object *bo, bool zero_alloc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) * ttm_tt_init
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) * @ttm: The struct ttm_tt.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) * @bo: The buffer object we create the ttm for.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) * @page_flags: Page flags as identified by TTM_PAGE_FLAG_XX flags.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) * Create a struct ttm_tt to back data with system memory pages.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) * No pages are actually allocated.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) * Returns:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) * NULL: Out of memory.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) int ttm_tt_init(struct ttm_tt *ttm, struct ttm_buffer_object *bo,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) uint32_t page_flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) int ttm_dma_tt_init(struct ttm_dma_tt *ttm_dma, struct ttm_buffer_object *bo,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) uint32_t page_flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) int ttm_sg_tt_init(struct ttm_dma_tt *ttm_dma, struct ttm_buffer_object *bo,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) uint32_t page_flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) * ttm_tt_fini
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) * @ttm: the ttm_tt structure.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) * Free memory of ttm_tt structure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) void ttm_tt_fini(struct ttm_tt *ttm);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) void ttm_dma_tt_fini(struct ttm_dma_tt *ttm_dma);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) * ttm_ttm_destroy:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) * @ttm: The struct ttm_tt.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) * Unbind, unpopulate and destroy common struct ttm_tt.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) void ttm_tt_destroy(struct ttm_bo_device *bdev, struct ttm_tt *ttm);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) * ttm_tt_destroy_common:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) * Called from driver to destroy common path.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) void ttm_tt_destroy_common(struct ttm_bo_device *bdev, struct ttm_tt *ttm);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) * ttm_tt_swapin:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) * @ttm: The struct ttm_tt.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) * Swap in a previously swap out ttm_tt.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) int ttm_tt_swapin(struct ttm_tt *ttm);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) * ttm_tt_set_placement_caching:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) * @ttm A struct ttm_tt the backing pages of which will change caching policy.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) * @placement: Flag indicating the desired caching policy.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) * This function will change caching policy of any default kernel mappings of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) * the pages backing @ttm. If changing from cached to uncached or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) * write-combined,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) * all CPU caches will first be flushed to make sure the data of the pages
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) * hit RAM. This function may be very costly as it involves global TLB
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) * and cache flushes and potential page splitting / combining.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) int ttm_tt_set_placement_caching(struct ttm_tt *ttm, uint32_t placement);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) int ttm_tt_swapout(struct ttm_bo_device *bdev, struct ttm_tt *ttm, struct file *persistent_swap_storage);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) * ttm_tt_populate - allocate pages for a ttm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) * @ttm: Pointer to the ttm_tt structure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) * Calls the driver method to allocate pages for a ttm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) int ttm_tt_populate(struct ttm_bo_device *bdev, struct ttm_tt *ttm, struct ttm_operation_ctx *ctx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) * ttm_tt_unpopulate - free pages from a ttm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) * @ttm: Pointer to the ttm_tt structure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) * Calls the driver method to free all pages from a ttm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) void ttm_tt_unpopulate(struct ttm_bo_device *bdev, struct ttm_tt *ttm);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) #if IS_ENABLED(CONFIG_AGP)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) #include <linux/agp_backend.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) * ttm_agp_tt_create
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) * @bo: Buffer object we allocate the ttm for.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) * @bridge: The agp bridge this device is sitting on.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) * @page_flags: Page flags as identified by TTM_PAGE_FLAG_XX flags.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) * Create a TTM backend that uses the indicated AGP bridge as an aperture
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) * for TT memory. This function uses the linux agpgart interface to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) * bind and unbind memory backing a ttm_tt.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) struct ttm_tt *ttm_agp_tt_create(struct ttm_buffer_object *bo,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) struct agp_bridge_data *bridge,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) uint32_t page_flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) int ttm_agp_bind(struct ttm_tt *ttm, struct ttm_resource *bo_mem);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) void ttm_agp_unbind(struct ttm_tt *ttm);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) void ttm_agp_destroy(struct ttm_tt *ttm);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) bool ttm_agp_is_bound(struct ttm_tt *ttm);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) #endif