xref: /netbsd-src/sys/external/bsd/drm2/dist/drm/nouveau/include/nvkm/core/ramht.h (revision 41ec02673d281bbb3d38e6c78504ce6e30c228c1)
1 /*	$NetBSD: ramht.h,v 1.3 2021/12/18 23:45:33 riastradh Exp $	*/
2 
3 /* SPDX-License-Identifier: MIT */
4 #ifndef __NVKM_RAMHT_H__
5 #define __NVKM_RAMHT_H__
6 #include <core/gpuobj.h>
7 struct nvkm_object;
8 
9 struct nvkm_ramht_data {
10 	struct nvkm_gpuobj *inst;
11 	int chid;
12 	u32 handle;
13 };
14 
15 struct nvkm_ramht {
16 	struct nvkm_device *device;
17 	struct nvkm_gpuobj *parent;
18 	struct nvkm_gpuobj *gpuobj;
19 	int size;
20 	int bits;
21 	struct nvkm_ramht_data data[];
22 };
23 
24 int  nvkm_ramht_new(struct nvkm_device *, u32 size, u32 align,
25 		    struct nvkm_gpuobj *, struct nvkm_ramht **);
26 void nvkm_ramht_del(struct nvkm_ramht **);
27 int  nvkm_ramht_insert(struct nvkm_ramht *, struct nvkm_object *,
28 		       int chid, int addr, u32 handle, u32 context);
29 void nvkm_ramht_remove(struct nvkm_ramht *, int cookie);
30 struct nvkm_gpuobj *
31 nvkm_ramht_search(struct nvkm_ramht *, int chid, u32 handle);
32 #endif
33