#define pr_fmt(fmt) …
#include <linux/cc_platform.h>
#include <linux/debugfs.h>
#include <linux/file.h>
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/shmem_fs.h>
#include <drm/drm_cache.h>
#include <drm/drm_device.h>
#include <drm/drm_util.h>
#include <drm/ttm/ttm_bo.h>
#include <drm/ttm/ttm_tt.h>
#include "ttm_module.h"
static unsigned long ttm_pages_limit;
MODULE_PARM_DESC(…) …;
module_param_named(pages_limit, ttm_pages_limit, ulong, 0644);
static unsigned long ttm_dma32_pages_limit;
MODULE_PARM_DESC(…) …;
module_param_named(dma32_pages_limit, ttm_dma32_pages_limit, ulong, 0644);
static atomic_long_t ttm_pages_allocated;
static atomic_long_t ttm_dma32_pages_allocated;
int ttm_tt_create(struct ttm_buffer_object *bo, bool zero_alloc)
{ … }
EXPORT_SYMBOL_FOR_TESTS_ONLY(…);
static int ttm_tt_alloc_page_directory(struct ttm_tt *ttm)
{ … }
static int ttm_dma_tt_alloc_page_directory(struct ttm_tt *ttm)
{ … }
static int ttm_sg_tt_alloc_page_directory(struct ttm_tt *ttm)
{ … }
void ttm_tt_destroy(struct ttm_device *bdev, struct ttm_tt *ttm)
{ … }
EXPORT_SYMBOL_FOR_TESTS_ONLY(…);
static void ttm_tt_init_fields(struct ttm_tt *ttm,
struct ttm_buffer_object *bo,
uint32_t page_flags,
enum ttm_caching caching,
unsigned long extra_pages)
{ … }
int ttm_tt_init(struct ttm_tt *ttm, struct ttm_buffer_object *bo,
uint32_t page_flags, enum ttm_caching caching,
unsigned long extra_pages)
{ … }
EXPORT_SYMBOL(…);
void ttm_tt_fini(struct ttm_tt *ttm)
{ … }
EXPORT_SYMBOL(…);
int ttm_sg_tt_init(struct ttm_tt *ttm, struct ttm_buffer_object *bo,
uint32_t page_flags, enum ttm_caching caching)
{ … }
EXPORT_SYMBOL(…);
int ttm_tt_swapin(struct ttm_tt *ttm)
{ … }
EXPORT_SYMBOL_FOR_TESTS_ONLY(…);
int ttm_tt_swapout(struct ttm_device *bdev, struct ttm_tt *ttm,
gfp_t gfp_flags)
{ … }
EXPORT_SYMBOL_FOR_TESTS_ONLY(…);
int ttm_tt_populate(struct ttm_device *bdev,
struct ttm_tt *ttm, struct ttm_operation_ctx *ctx)
{ … }
EXPORT_SYMBOL(…);
void ttm_tt_unpopulate(struct ttm_device *bdev, struct ttm_tt *ttm)
{ … }
EXPORT_SYMBOL_FOR_TESTS_ONLY(…);
#ifdef CONFIG_DEBUG_FS
static int ttm_tt_debugfs_shrink_show(struct seq_file *m, void *data)
{ … }
DEFINE_SHOW_ATTRIBUTE(…);
#endif
void ttm_tt_mgr_init(unsigned long num_pages, unsigned long num_dma32_pages)
{ … }
static void ttm_kmap_iter_tt_map_local(struct ttm_kmap_iter *iter,
struct iosys_map *dmap,
pgoff_t i)
{ … }
static void ttm_kmap_iter_tt_unmap_local(struct ttm_kmap_iter *iter,
struct iosys_map *map)
{ … }
static const struct ttm_kmap_iter_ops ttm_kmap_iter_tt_ops = …;
struct ttm_kmap_iter *
ttm_kmap_iter_tt_init(struct ttm_kmap_iter_tt *iter_tt,
struct ttm_tt *tt)
{ … }
EXPORT_SYMBOL(…);
unsigned long ttm_tt_pages_limit(void)
{ … }
EXPORT_SYMBOL(…);