GNU Linux-libre 4.14.328-gnu1
[releases.git] / drivers / gpu / drm / nouveau / include / nvkm / core / ramht.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __NVKM_RAMHT_H__
3 #define __NVKM_RAMHT_H__
4 #include <core/gpuobj.h>
5
6 struct nvkm_ramht_data {
7         struct nvkm_gpuobj *inst;
8         int chid;
9         u32 handle;
10 };
11
12 struct nvkm_ramht {
13         struct nvkm_device *device;
14         struct nvkm_gpuobj *parent;
15         struct nvkm_gpuobj *gpuobj;
16         int size;
17         int bits;
18         struct nvkm_ramht_data data[];
19 };
20
21 int  nvkm_ramht_new(struct nvkm_device *, u32 size, u32 align,
22                     struct nvkm_gpuobj *, struct nvkm_ramht **);
23 void nvkm_ramht_del(struct nvkm_ramht **);
24 int  nvkm_ramht_insert(struct nvkm_ramht *, struct nvkm_object *,
25                        int chid, int addr, u32 handle, u32 context);
26 void nvkm_ramht_remove(struct nvkm_ramht *, int cookie);
27 struct nvkm_gpuobj *
28 nvkm_ramht_search(struct nvkm_ramht *, int chid, u32 handle);
29 #endif