a98b57f82fe773bcd49e36ac58263e9c27357ec0
[linux-block.git] / drivers / gpu / drm / nouveau / nvkm / engine / disp / priv.h
1 /* SPDX-License-Identifier: MIT */
2 #ifndef __NVKM_DISP_PRIV_H__
3 #define __NVKM_DISP_PRIV_H__
4 #define nvkm_udisp(p) container_of((p), struct nvkm_disp, client.object)
5 #include <engine/disp.h>
6 #include <core/enum.h>
7 struct nvkm_head;
8 struct nvkm_outp;
9 struct dcb_output;
10
11 int nvkm_disp_ctor(const struct nvkm_disp_func *, struct nvkm_device *, enum nvkm_subdev_type, int,
12                    struct nvkm_disp *);
13 int nvkm_disp_new_(const struct nvkm_disp_func *, struct nvkm_device *, enum nvkm_subdev_type, int,
14                    struct nvkm_disp **);
15 void nvkm_disp_vblank(struct nvkm_disp *, int head);
16
17 struct nvkm_disp_func {
18         int (*oneinit)(struct nvkm_disp *);
19         int (*init)(struct nvkm_disp *);
20         void (*fini)(struct nvkm_disp *);
21         void (*intr)(struct nvkm_disp *);
22         void (*intr_error)(struct nvkm_disp *, int chid);
23
24         void (*super)(struct work_struct *);
25
26         const struct nvkm_event_func *uevent;
27
28         struct {
29                 int (*cnt)(struct nvkm_disp *, unsigned long *mask);
30                 int (*new)(struct nvkm_disp *, int id);
31         } wndw, head, dac, sor, pior;
32
33         u16 ramht_size;
34
35         const struct nvkm_sclass root;
36
37         struct nvkm_disp_user {
38                 struct nvkm_sclass base;
39                 int (*ctor)(const struct nvkm_oclass *, void *argv, u32 argc,
40                             struct nvkm_object **);
41                 const struct nvkm_disp_chan_user *chan;
42         } user[];
43 };
44
45 int  nvkm_disp_ntfy(struct nvkm_object *, u32, struct nvkm_event **);
46
47 int nv50_disp_oneinit(struct nvkm_disp *);
48 int nv50_disp_init(struct nvkm_disp *);
49 void nv50_disp_fini(struct nvkm_disp *);
50 void nv50_disp_intr(struct nvkm_disp *);
51 extern const struct nvkm_enum nv50_disp_intr_error_type[];
52 void nv50_disp_super(struct work_struct *);
53 void nv50_disp_super_1(struct nvkm_disp *);
54 void nv50_disp_super_1_0(struct nvkm_disp *, struct nvkm_head *);
55 void nv50_disp_super_2_0(struct nvkm_disp *, struct nvkm_head *);
56 void nv50_disp_super_2_1(struct nvkm_disp *, struct nvkm_head *);
57 void nv50_disp_super_2_2(struct nvkm_disp *, struct nvkm_head *);
58 void nv50_disp_super_3_0(struct nvkm_disp *, struct nvkm_head *);
59
60 int gf119_disp_init(struct nvkm_disp *);
61 void gf119_disp_fini(struct nvkm_disp *);
62 void gf119_disp_intr(struct nvkm_disp *);
63 void gf119_disp_super(struct work_struct *);
64 void gf119_disp_intr_error(struct nvkm_disp *, int);
65
66 void gv100_disp_fini(struct nvkm_disp *);
67 void gv100_disp_intr(struct nvkm_disp *);
68 void gv100_disp_super(struct work_struct *);
69 int gv100_disp_wndw_cnt(struct nvkm_disp *, unsigned long *);
70 int gv100_disp_caps_new(const struct nvkm_oclass *, void *, u32, struct nvkm_object **);
71
72 int tu102_disp_init(struct nvkm_disp *);
73
74 void nv50_disp_dptmds_war_2(struct nvkm_disp *, struct dcb_output *);
75 void nv50_disp_dptmds_war_3(struct nvkm_disp *, struct dcb_output *);
76 void nv50_disp_update_sppll1(struct nvkm_disp *);
77
78 extern const struct nvkm_event_func nv50_disp_chan_uevent;
79 void nv50_disp_chan_uevent_send(struct nvkm_disp *, int);
80
81 extern const struct nvkm_event_func gf119_disp_chan_uevent;
82 extern const struct nvkm_event_func gv100_disp_chan_uevent;
83
84 int nvkm_udisp_new(const struct nvkm_oclass *, void *, u32, struct nvkm_object **);
85 int nvkm_uconn_new(const struct nvkm_oclass *, void *, u32, struct nvkm_object **);
86 int nvkm_uoutp_new(const struct nvkm_oclass *, void *, u32, struct nvkm_object **);
87 int nvkm_uhead_new(const struct nvkm_oclass *, void *, u32, struct nvkm_object **);
88 #endif