#include <linux/dma-mapping.h>
#include <drm/ttm/ttm_tt.h>
#include "nouveau_drv.h"
#include "nouveau_chan.h"
#include "nouveau_fence.h"
#include "nouveau_bo.h"
#include "nouveau_ttm.h"
#include "nouveau_gem.h"
#include "nouveau_mem.h"
#include "nouveau_vmm.h"
#include <nvif/class.h>
#include <nvif/if500b.h>
#include <nvif/if900b.h>
static int nouveau_ttm_tt_bind(struct ttm_device *bdev, struct ttm_tt *ttm,
struct ttm_resource *reg);
static void nouveau_ttm_tt_unbind(struct ttm_device *bdev, struct ttm_tt *ttm);
static void
nv10_bo_update_tile_region(struct drm_device *dev, struct nouveau_drm_tile *reg,
u32 addr, u32 size, u32 pitch, u32 flags)
{ … }
static struct nouveau_drm_tile *
nv10_bo_get_tile_region(struct drm_device *dev, int i)
{ … }
static void
nv10_bo_put_tile_region(struct drm_device *dev, struct nouveau_drm_tile *tile,
struct dma_fence *fence)
{ … }
static struct nouveau_drm_tile *
nv10_bo_set_tiling(struct drm_device *dev, u32 addr,
u32 size, u32 pitch, u32 zeta)
{ … }
static void
nouveau_bo_del_ttm(struct ttm_buffer_object *bo)
{ … }
static inline u64
roundup_64(u64 x, u32 y)
{ … }
static void
nouveau_bo_fixup_align(struct nouveau_bo *nvbo, int *align, u64 *size)
{ … }
struct nouveau_bo *
nouveau_bo_alloc(struct nouveau_cli *cli, u64 *size, int *align, u32 domain,
u32 tile_mode, u32 tile_flags, bool internal)
{ … }
int
nouveau_bo_init(struct nouveau_bo *nvbo, u64 size, int align, u32 domain,
struct sg_table *sg, struct dma_resv *robj)
{ … }
int
nouveau_bo_new(struct nouveau_cli *cli, u64 size, int align,
uint32_t domain, uint32_t tile_mode, uint32_t tile_flags,
struct sg_table *sg, struct dma_resv *robj,
struct nouveau_bo **pnvbo)
{ … }
static void
set_placement_range(struct nouveau_bo *nvbo, uint32_t domain)
{ … }
void
nouveau_bo_placement_set(struct nouveau_bo *nvbo, uint32_t domain,
uint32_t busy)
{ … }
int nouveau_bo_pin_locked(struct nouveau_bo *nvbo, uint32_t domain, bool contig)
{ … }
void nouveau_bo_unpin_locked(struct nouveau_bo *nvbo)
{ … }
int nouveau_bo_pin(struct nouveau_bo *nvbo, uint32_t domain, bool contig)
{ … }
int nouveau_bo_unpin(struct nouveau_bo *nvbo)
{ … }
int
nouveau_bo_map(struct nouveau_bo *nvbo)
{ … }
void
nouveau_bo_unmap(struct nouveau_bo *nvbo)
{ … }
void
nouveau_bo_sync_for_device(struct nouveau_bo *nvbo)
{ … }
void
nouveau_bo_sync_for_cpu(struct nouveau_bo *nvbo)
{ … }
void nouveau_bo_add_io_reserve_lru(struct ttm_buffer_object *bo)
{ … }
void nouveau_bo_del_io_reserve_lru(struct ttm_buffer_object *bo)
{ … }
int
nouveau_bo_validate(struct nouveau_bo *nvbo, bool interruptible,
bool no_wait_gpu)
{ … }
void
nouveau_bo_wr16(struct nouveau_bo *nvbo, unsigned index, u16 val)
{ … }
u32
nouveau_bo_rd32(struct nouveau_bo *nvbo, unsigned index)
{ … }
void
nouveau_bo_wr32(struct nouveau_bo *nvbo, unsigned index, u32 val)
{ … }
static struct ttm_tt *
nouveau_ttm_tt_create(struct ttm_buffer_object *bo, uint32_t page_flags)
{ … }
static int
nouveau_ttm_tt_bind(struct ttm_device *bdev, struct ttm_tt *ttm,
struct ttm_resource *reg)
{ … }
static void
nouveau_ttm_tt_unbind(struct ttm_device *bdev, struct ttm_tt *ttm)
{ … }
static void
nouveau_bo_evict_flags(struct ttm_buffer_object *bo, struct ttm_placement *pl)
{ … }
static int
nouveau_bo_move_prep(struct nouveau_drm *drm, struct ttm_buffer_object *bo,
struct ttm_resource *reg)
{ … }
static int
nouveau_bo_move_m2mf(struct ttm_buffer_object *bo, int evict,
struct ttm_operation_ctx *ctx,
struct ttm_resource *new_reg)
{ … }
void
nouveau_bo_move_init(struct nouveau_drm *drm)
{ … }
static void nouveau_bo_move_ntfy(struct ttm_buffer_object *bo,
struct ttm_resource *new_reg)
{ … }
static int
nouveau_bo_vm_bind(struct ttm_buffer_object *bo, struct ttm_resource *new_reg,
struct nouveau_drm_tile **new_tile)
{ … }
static void
nouveau_bo_vm_cleanup(struct ttm_buffer_object *bo,
struct nouveau_drm_tile *new_tile,
struct nouveau_drm_tile **old_tile)
{ … }
static int
nouveau_bo_move(struct ttm_buffer_object *bo, bool evict,
struct ttm_operation_ctx *ctx,
struct ttm_resource *new_reg,
struct ttm_place *hop)
{ … }
static void
nouveau_ttm_io_mem_free_locked(struct nouveau_drm *drm,
struct ttm_resource *reg)
{ … }
static int
nouveau_ttm_io_mem_reserve(struct ttm_device *bdev, struct ttm_resource *reg)
{ … }
static void
nouveau_ttm_io_mem_free(struct ttm_device *bdev, struct ttm_resource *reg)
{ … }
vm_fault_t nouveau_ttm_fault_reserve_notify(struct ttm_buffer_object *bo)
{ … }
static int
nouveau_ttm_tt_populate(struct ttm_device *bdev,
struct ttm_tt *ttm, struct ttm_operation_ctx *ctx)
{ … }
static void
nouveau_ttm_tt_unpopulate(struct ttm_device *bdev,
struct ttm_tt *ttm)
{ … }
static void
nouveau_ttm_tt_destroy(struct ttm_device *bdev,
struct ttm_tt *ttm)
{ … }
void
nouveau_bo_fence(struct nouveau_bo *nvbo, struct nouveau_fence *fence, bool exclusive)
{ … }
static void
nouveau_bo_delete_mem_notify(struct ttm_buffer_object *bo)
{ … }
struct ttm_device_funcs nouveau_bo_driver = …;