1 /* SPDX-License-Identifier: MIT */
2 #ifndef __NVKM_DISP_H__
3 #define __NVKM_DISP_H__
4 #define nvkm_disp(p) container_of((p), struct nvkm_disp, engine)
5 #include <core/engine.h>
6 #include <core/object.h>
7 #include <core/event.h>
8 
9 struct nvkm_disp {
10 	const struct nvkm_disp_func *func;
11 	struct nvkm_engine engine;
12 
13 	struct list_head heads;
14 	struct list_head iors;
15 	struct list_head outps;
16 	struct list_head conns;
17 
18 	struct nvkm_event hpd;
19 #define NVKM_DISP_HEAD_EVENT_VBLANK BIT(0)
20 	struct nvkm_event vblank;
21 
22 	struct {
23 		struct workqueue_struct *wq;
24 		struct work_struct work;
25 		u32 pending;
26 		struct mutex mutex;
27 	} super;
28 
29 #define NVKM_DISP_EVENT_CHAN_AWAKEN BIT(0)
30 	struct nvkm_event uevent;
31 
32 	struct {
33 		unsigned long mask;
34 		int nr;
35 	} wndw, head, dac, sor;
36 
37 	struct {
38 		unsigned long mask;
39 		int nr;
40 		u8 type[3];
41 	} pior;
42 
43 	struct nvkm_gpuobj *inst;
44 	struct nvkm_ramht *ramht;
45 
46 	struct nvkm_disp_chan *chan[81];
47 
48 	struct {
49 		spinlock_t lock;
50 		struct nvkm_object object;
51 	} client;
52 };
53 
54 int nv04_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
55 int nv50_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
56 int g84_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
57 int gt200_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
58 int g94_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
59 int mcp77_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
60 int gt215_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
61 int mcp89_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
62 int gf119_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
63 int gk104_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
64 int gk110_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
65 int gm107_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
66 int gm200_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
67 int gp100_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
68 int gp102_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
69 int gv100_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
70 int tu102_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
71 int ga102_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
72 #endif
73