Squashed backup commit (no shallow-clone history issues) of xiaomi-mt6833-dev/kernel_xiaomi_mt6833 (lineage-23.2 branch, upstream commit 9eece662e) plus all fixes applied to get everpal_defconfig building clean against a modern (GCC 15.2.0) toolchain -- see the previous commit message on the lineage-23.2 branch (also in this repo history is not available here since this is a squashed snapshot; full incremental history lives in the local DL380 checkout and the upstream GitHub remote). Upstream: https://github.com/xiaomi-mt6833-dev/kernel_xiaomi_mt6833 (lineage-23.2)
41 lines
1.3 KiB
C
41 lines
1.3 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef __NVKM_MMU_PRIV_H__
|
|
#define __NVKM_MMU_PRIV_H__
|
|
#define nvkm_mmu(p) container_of((p), struct nvkm_mmu, subdev)
|
|
#include <subdev/mmu.h>
|
|
|
|
void nvkm_mmu_ctor(const struct nvkm_mmu_func *, struct nvkm_device *,
|
|
int index, struct nvkm_mmu *);
|
|
int nvkm_mmu_new_(const struct nvkm_mmu_func *, struct nvkm_device *,
|
|
int index, struct nvkm_mmu **);
|
|
|
|
struct nvkm_mmu_func {
|
|
void *(*dtor)(struct nvkm_mmu *);
|
|
int (*oneinit)(struct nvkm_mmu *);
|
|
void (*init)(struct nvkm_mmu *);
|
|
|
|
u64 limit;
|
|
u8 dma_bits;
|
|
u32 pgt_bits;
|
|
u8 spg_shift;
|
|
u8 lpg_shift;
|
|
|
|
int (*create)(struct nvkm_mmu *, u64 offset, u64 length, u64 mm_offset,
|
|
struct lock_class_key *, struct nvkm_vm **);
|
|
|
|
void (*map_pgt)(struct nvkm_gpuobj *pgd, u32 pde,
|
|
struct nvkm_memory *pgt[2]);
|
|
void (*map)(struct nvkm_vma *, struct nvkm_memory *,
|
|
struct nvkm_mem *, u32 pte, u32 cnt,
|
|
u64 phys, u64 delta);
|
|
void (*map_sg)(struct nvkm_vma *, struct nvkm_memory *,
|
|
struct nvkm_mem *, u32 pte, u32 cnt, dma_addr_t *);
|
|
void (*unmap)(struct nvkm_vma *, struct nvkm_memory *pgt,
|
|
u32 pte, u32 cnt);
|
|
void (*flush)(struct nvkm_vm *);
|
|
};
|
|
|
|
int nvkm_vm_create(struct nvkm_mmu *, u64, u64, u64, u32,
|
|
struct lock_class_key *, struct nvkm_vm **);
|
|
#endif
|