44 lines
1.2 KiB
C
Raw Normal View History

2026-01-21 18:59:54 +08:00
#ifndef __NOUVEAU_MEM_H__
#define __NOUVEAU_MEM_H__
2026-01-29 22:25:33 +08:00
#include <drm/ttm/ttm_bo.h>
struct ttm_tt;
2026-01-21 18:59:54 +08:00
#include <nvif/mem.h>
#include <nvif/vmm.h>
struct nouveau_mem {
2026-01-29 22:25:33 +08:00
struct ttm_resource base;
2026-01-21 18:59:54 +08:00
struct nouveau_cli *cli;
u8 kind;
u8 comp;
struct nvif_mem mem;
struct nvif_vma vma[2];
};
2026-01-29 22:25:33 +08:00
static inline struct nouveau_mem *
nouveau_mem(struct ttm_resource *reg)
{
return container_of(reg, struct nouveau_mem, base);
}
2026-01-21 18:59:54 +08:00
int nouveau_mem_new(struct nouveau_cli *, u8 kind, u8 comp,
2026-01-29 22:25:33 +08:00
struct ttm_resource **);
void nouveau_mem_del(struct ttm_resource_manager *man,
struct ttm_resource *);
bool nouveau_mem_intersects(struct ttm_resource *res,
const struct ttm_place *place,
size_t size);
bool nouveau_mem_compatible(struct ttm_resource *res,
const struct ttm_place *place,
size_t size);
2026-01-21 18:59:54 +08:00
int nouveau_mem_vram(struct ttm_resource *, bool contig, u8 page);
2026-01-29 22:25:33 +08:00
int nouveau_mem_host(struct ttm_resource *, struct ttm_tt *);
2026-01-21 18:59:54 +08:00
void nouveau_mem_fini(struct nouveau_mem *);
int nouveau_mem_map(struct nouveau_mem *, struct nvif_vmm *, struct nvif_vma *);
2026-01-29 22:25:33 +08:00
int
nouveau_mem_map_fixed(struct nouveau_mem *mem,
struct nvif_vmm *vmm,
u8 kind, u64 addr,
u64 offset, u64 range);
2026-01-21 18:59:54 +08:00
#endif