2017-11-01 03:56:19 +10:00
|
|
|
#ifndef __NOUVEAU_MEM_H__
|
|
|
|
#define __NOUVEAU_MEM_H__
|
2022-05-09 21:13:35 +02:00
|
|
|
#include <drm/ttm/ttm_bo.h>
|
2020-10-21 14:06:49 +02:00
|
|
|
struct ttm_tt;
|
2017-11-01 03:56:19 +10:00
|
|
|
|
2017-11-01 03:56:20 +10:00
|
|
|
#include <nvif/mem.h>
|
|
|
|
#include <nvif/vmm.h>
|
|
|
|
|
2017-11-01 03:56:19 +10:00
|
|
|
struct nouveau_mem {
|
2021-04-26 15:48:36 +02:00
|
|
|
struct ttm_resource base;
|
2024-07-26 14:38:20 +10:00
|
|
|
struct nouveau_drm *drm;
|
2017-11-01 03:56:19 +10:00
|
|
|
u8 kind;
|
|
|
|
u8 comp;
|
2017-11-01 03:56:20 +10:00
|
|
|
struct nvif_mem mem;
|
|
|
|
struct nvif_vma vma[2];
|
2017-11-01 03:56:19 +10:00
|
|
|
};
|
|
|
|
|
2021-04-30 09:48:27 +02:00
|
|
|
static inline struct nouveau_mem *
|
|
|
|
nouveau_mem(struct ttm_resource *reg)
|
|
|
|
{
|
|
|
|
return container_of(reg, struct nouveau_mem, base);
|
|
|
|
}
|
|
|
|
|
2024-07-26 14:38:20 +10:00
|
|
|
int nouveau_mem_new(struct nouveau_drm *, u8 kind, u8 comp,
|
2021-04-30 09:48:27 +02:00
|
|
|
struct ttm_resource **);
|
2021-07-09 15:18:39 +02:00
|
|
|
void nouveau_mem_del(struct ttm_resource_manager *man,
|
|
|
|
struct ttm_resource *);
|
2022-08-20 00:33:03 -07:00
|
|
|
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);
|
2020-08-04 12:56:32 +10:00
|
|
|
int nouveau_mem_vram(struct ttm_resource *, bool contig, u8 page);
|
2020-10-21 14:06:49 +02:00
|
|
|
int nouveau_mem_host(struct ttm_resource *, struct ttm_tt *);
|
2017-11-01 03:56:19 +10:00
|
|
|
void nouveau_mem_fini(struct nouveau_mem *);
|
2017-11-01 03:56:20 +10:00
|
|
|
int nouveau_mem_map(struct nouveau_mem *, struct nvif_vmm *, struct nvif_vma *);
|
2023-08-04 20:23:51 +02:00
|
|
|
int
|
|
|
|
nouveau_mem_map_fixed(struct nouveau_mem *mem,
|
|
|
|
struct nvif_vmm *vmm,
|
|
|
|
u8 kind, u64 addr,
|
|
|
|
u64 offset, u64 range);
|
2017-11-01 03:56:19 +10:00
|
|
|
#endif
|