1 /* SPDX-License-Identifier: MIT */
2 #ifndef __NVKM_MMU_PRIV_H__
3 #define __NVKM_MMU_PRIV_H__
4 #define nvkm_mmu(p) container_of((p), struct nvkm_mmu, subdev)
5 #include <subdev/mmu.h>
7 void nvkm_mmu_ctor(const struct nvkm_mmu_func
*, struct nvkm_device
*,
8 int index
, struct nvkm_mmu
*);
9 int nvkm_mmu_new_(const struct nvkm_mmu_func
*, struct nvkm_device
*,
10 int index
, struct nvkm_mmu
**);
12 struct nvkm_mmu_func
{
13 void (*init
)(struct nvkm_mmu
*);
18 struct nvkm_sclass user
;
22 struct nvkm_sclass user
;
23 int (*vram
)(struct nvkm_mmu
*, int type
, u8 page
, u64 size
,
24 void *argv
, u32 argc
, struct nvkm_memory
**);
25 int (*umap
)(struct nvkm_mmu
*, struct nvkm_memory
*, void *argv
,
26 u32 argc
, u64
*addr
, u64
*size
, struct nvkm_vma
**);
30 struct nvkm_sclass user
;
31 int (*ctor
)(struct nvkm_mmu
*, bool managed
, u64 addr
, u64 size
,
32 void *argv
, u32 argc
, struct lock_class_key
*,
33 const char *name
, struct nvkm_vmm
**);
38 const u8
*(*kind
)(struct nvkm_mmu
*, int *count
, u8
*invalid
);
42 extern const struct nvkm_mmu_func nv04_mmu
;
44 const u8
*nv50_mmu_kind(struct nvkm_mmu
*, int *count
, u8
*invalid
);
46 const u8
*gf100_mmu_kind(struct nvkm_mmu
*, int *count
, u8
*invalid
);
48 const u8
*gm200_mmu_kind(struct nvkm_mmu
*, int *, u8
*);
52 struct nvkm_mmu_ptc
*ptc
;
53 struct nvkm_mmu_ptp
*ptp
;
55 struct nvkm_memory
*memory
;
59 struct list_head head
;
62 void nvkm_mmu_ptc_dump(struct nvkm_mmu
*);
64 nvkm_mmu_ptc_get(struct nvkm_mmu
*, u32 size
, u32 align
, bool zero
);
65 void nvkm_mmu_ptc_put(struct nvkm_mmu
*, bool force
, struct nvkm_mmu_pt
**);