]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - drivers/gpu/drm/nouveau/nouveau_mem.h
drm/nouveau: directly handle comptag allocation
[mirror_ubuntu-bionic-kernel.git] / drivers / gpu / drm / nouveau / nouveau_mem.h
CommitLineData
9ce523cc
BS
1#ifndef __NOUVEAU_MEM_H__
2#define __NOUVEAU_MEM_H__
3#include <subdev/fb.h>
4
5#include <drm/ttm/ttm_bo_api.h>
6struct ttm_dma_tt;
7
8static inline struct nouveau_mem *
9nouveau_mem(struct ttm_mem_reg *reg)
10{
11 return reg->mm_node;
12}
13
14struct nouveau_mem {
15 struct nouveau_cli *cli;
16 u8 kind;
17 u8 comp;
18 struct {
19 u8 page;
20 } mem;
21 struct nvkm_vma vma[2];
22
23 struct nvkm_mem __mem;
24 struct nvkm_mem *_mem;
25 struct nvkm_vma bar_vma;
bd275f1d
BS
26
27 struct nvkm_memory memory;
7b865663 28 struct nvkm_tags *tags;
bd275f1d
BS
29};
30
31enum nvif_vmm_get {
32 PTES,
33 LAZY,
9ce523cc
BS
34};
35
36int nouveau_mem_new(struct nouveau_cli *, u8 kind, u8 comp,
37 struct ttm_mem_reg *);
38void nouveau_mem_del(struct ttm_mem_reg *);
39int nouveau_mem_vram(struct ttm_mem_reg *, bool contig, u8 page);
40int nouveau_mem_host(struct ttm_mem_reg *, struct ttm_dma_tt *);
41void nouveau_mem_fini(struct nouveau_mem *);
42int nouveau_mem_map(struct nouveau_mem *, struct nvkm_vmm *, struct nvkm_vma *);
43#endif