summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau/nvkm/subdev/fault/priv.h
blob: 8ca8b2876dadf30b1b6eb16c2b1acdff8b091624 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef __NVKM_FAULT_PRIV_H__
#define __NVKM_FAULT_PRIV_H__
#define nvkm_fault_buffer(p) container_of((p), struct nvkm_fault_buffer, object)
#define nvkm_fault(p) container_of((p), struct nvkm_fault, subdev)
#include <subdev/fault.h>

#include <core/event.h>
#include <core/object.h>

struct nvkm_fault_buffer {
	struct nvkm_object object;
	struct nvkm_fault *fault;
	int id;
	int entries;
	u32 get;
	u32 put;
	struct nvkm_memory *mem;
	u64 addr;
};

int nvkm_fault_new_(const struct nvkm_fault_func *, struct nvkm_device *,
		    int index, struct nvkm_fault **);

struct nvkm_fault_func {
	int (*oneinit)(struct nvkm_fault *);
	void (*init)(struct nvkm_fault *);
	void (*fini)(struct nvkm_fault *);
	void (*intr)(struct nvkm_fault *);
	struct {
		int nr;
		u32 entry_size;
		void (*info)(struct nvkm_fault_buffer *);
		void (*init)(struct nvkm_fault_buffer *);
		void (*fini)(struct nvkm_fault_buffer *);
		void (*intr)(struct nvkm_fault_buffer *, bool enable);
	} buffer;
};

int gv100_fault_oneinit(struct nvkm_fault *);
#endif