#include <linux/debugfs.h>
#include <linux/dma-mapping.h>
#include <linux/pagemap.h>
#include <linux/pci.h>
#include <linux/seq_file.h>
#include <linux/slab.h>
#include <linux/swap.h>
#include <drm/drm_device.h>
#include <drm/drm_file.h>
#include <drm/drm_prime.h>
#include <drm/radeon_drm.h>
#include <drm/ttm/ttm_bo.h>
#include <drm/ttm/ttm_placement.h>
#include <drm/ttm/ttm_range_manager.h>
#include <drm/ttm/ttm_tt.h>
#include "radeon_reg.h"
#include "radeon.h"
#include "radeon_ttm.h"
static void radeon_ttm_debugfs_init(struct radeon_device *rdev);
static int radeon_ttm_tt_bind(struct ttm_device *bdev, struct ttm_tt *ttm,
struct ttm_resource *bo_mem);
static void radeon_ttm_tt_unbind(struct ttm_device *bdev, struct ttm_tt *ttm);
struct radeon_device *radeon_get_rdev(struct ttm_device *bdev)
{ … }
static int radeon_ttm_init_vram(struct radeon_device *rdev)
{ … }
static int radeon_ttm_init_gtt(struct radeon_device *rdev)
{ … }
static void radeon_evict_flags(struct ttm_buffer_object *bo,
struct ttm_placement *placement)
{ … }
static int radeon_move_blit(struct ttm_buffer_object *bo,
bool evict,
struct ttm_resource *new_mem,
struct ttm_resource *old_mem)
{ … }
static int radeon_bo_move(struct ttm_buffer_object *bo, bool evict,
struct ttm_operation_ctx *ctx,
struct ttm_resource *new_mem,
struct ttm_place *hop)
{ … }
static int radeon_ttm_io_mem_reserve(struct ttm_device *bdev, struct ttm_resource *mem)
{ … }
struct radeon_ttm_tt { … };
static int radeon_ttm_tt_pin_userptr(struct ttm_device *bdev, struct ttm_tt *ttm)
{ … }
static void radeon_ttm_tt_unpin_userptr(struct ttm_device *bdev, struct ttm_tt *ttm)
{ … }
static bool radeon_ttm_backend_is_bound(struct ttm_tt *ttm)
{ … }
static int radeon_ttm_backend_bind(struct ttm_device *bdev,
struct ttm_tt *ttm,
struct ttm_resource *bo_mem)
{ … }
static void radeon_ttm_backend_unbind(struct ttm_device *bdev, struct ttm_tt *ttm)
{ … }
static void radeon_ttm_backend_destroy(struct ttm_device *bdev, struct ttm_tt *ttm)
{ … }
static struct ttm_tt *radeon_ttm_tt_create(struct ttm_buffer_object *bo,
uint32_t page_flags)
{ … }
static struct radeon_ttm_tt *radeon_ttm_tt_to_gtt(struct radeon_device *rdev,
struct ttm_tt *ttm)
{ … }
static int radeon_ttm_tt_populate(struct ttm_device *bdev,
struct ttm_tt *ttm,
struct ttm_operation_ctx *ctx)
{ … }
static void radeon_ttm_tt_unpopulate(struct ttm_device *bdev, struct ttm_tt *ttm)
{ … }
int radeon_ttm_tt_set_userptr(struct radeon_device *rdev,
struct ttm_tt *ttm, uint64_t addr,
uint32_t flags)
{ … }
bool radeon_ttm_tt_is_bound(struct ttm_device *bdev,
struct ttm_tt *ttm)
{ … }
static int radeon_ttm_tt_bind(struct ttm_device *bdev,
struct ttm_tt *ttm,
struct ttm_resource *bo_mem)
{ … }
static void radeon_ttm_tt_unbind(struct ttm_device *bdev,
struct ttm_tt *ttm)
{ … }
static void radeon_ttm_tt_destroy(struct ttm_device *bdev,
struct ttm_tt *ttm)
{ … }
bool radeon_ttm_tt_has_userptr(struct radeon_device *rdev,
struct ttm_tt *ttm)
{ … }
bool radeon_ttm_tt_is_readonly(struct radeon_device *rdev,
struct ttm_tt *ttm)
{ … }
static struct ttm_device_funcs radeon_bo_driver = …;
int radeon_ttm_init(struct radeon_device *rdev)
{ … }
void radeon_ttm_fini(struct radeon_device *rdev)
{ … }
void radeon_ttm_set_active_vram_size(struct radeon_device *rdev, u64 size)
{ … }
#if defined(CONFIG_DEBUG_FS)
static int radeon_ttm_page_pool_show(struct seq_file *m, void *data)
{ … }
DEFINE_SHOW_ATTRIBUTE(…);
static int radeon_ttm_vram_open(struct inode *inode, struct file *filep)
{ … }
static ssize_t radeon_ttm_vram_read(struct file *f, char __user *buf,
size_t size, loff_t *pos)
{ … }
static const struct file_operations radeon_ttm_vram_fops = …;
static int radeon_ttm_gtt_open(struct inode *inode, struct file *filep)
{ … }
static ssize_t radeon_ttm_gtt_read(struct file *f, char __user *buf,
size_t size, loff_t *pos)
{ … }
static const struct file_operations radeon_ttm_gtt_fops = …;
#endif
static void radeon_ttm_debugfs_init(struct radeon_device *rdev)
{ … }