xref: /linux/drivers/gpu/drm/nouveau/include/nvkm/engine/disp.h (revision c532de5a67a70f8533d495f8f2aaa9a0491c3ad0)
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 #include <subdev/gsp.h>
9 
10 struct nvkm_disp {
11 	const struct nvkm_disp_func *func;
12 	struct nvkm_engine engine;
13 
14 	struct {
15 		struct nvkm_gsp_client client;
16 		struct nvkm_gsp_device device;
17 
18 		struct nvkm_gsp_object objcom;
19 		struct nvkm_gsp_object object;
20 
21 #define NVKM_DPYID_PLUG   BIT(0)
22 #define NVKM_DPYID_UNPLUG BIT(1)
23 #define NVKM_DPYID_IRQ    BIT(2)
24 		struct nvkm_event event;
25 		struct nvkm_gsp_event hpd;
26 		struct nvkm_gsp_event irq;
27 
28 		u32 assigned_sors;
29 	} rm;
30 
31 	struct list_head heads;
32 	struct list_head iors;
33 	struct list_head outps;
34 	struct list_head conns;
35 
36 	struct nvkm_event hpd;
37 #define NVKM_DISP_HEAD_EVENT_VBLANK BIT(0)
38 	struct nvkm_event vblank;
39 
40 	struct {
41 		struct workqueue_struct *wq;
42 		struct work_struct work;
43 		u32 pending;
44 		struct mutex mutex;
45 	} super;
46 
47 #define NVKM_DISP_EVENT_CHAN_AWAKEN BIT(0)
48 	struct nvkm_event uevent;
49 
50 	struct {
51 		unsigned long mask;
52 		int nr;
53 	} wndw, head, dac, sor;
54 
55 	struct {
56 		unsigned long mask;
57 		int nr;
58 		u8 type[3];
59 	} pior;
60 
61 	struct nvkm_gpuobj *inst;
62 	struct nvkm_ramht *ramht;
63 
64 	struct nvkm_disp_chan *chan[81];
65 
66 	struct {
67 		spinlock_t lock;
68 		struct nvkm_object object;
69 	} client;
70 };
71 
72 int nv04_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
73 int nv50_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
74 int g84_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
75 int gt200_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
76 int g94_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
77 int mcp77_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
78 int gt215_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
79 int mcp89_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
80 int gf119_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
81 int gk104_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
82 int gk110_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
83 int gm107_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
84 int gm200_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
85 int gp100_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
86 int gp102_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
87 int gv100_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
88 int tu102_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
89 int ga102_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
90 int ad102_disp_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_disp **);
91 #endif
92