1b7019ac5SIlia Mirkin /* SPDX-License-Identifier: MIT */ 2c39f472eSBen Skeggs #ifndef __NVKM_DISP_PRIV_H__ 3c39f472eSBen Skeggs #define __NVKM_DISP_PRIV_H__ 4168c0299SBen Skeggs #define nvkm_udisp(p) container_of((p), struct nvkm_disp, client.object) 5c39f472eSBen Skeggs #include <engine/disp.h> 692fba5d3SBen Skeggs #include <core/enum.h> 792fba5d3SBen Skeggs struct nvkm_head; 892fba5d3SBen Skeggs struct nvkm_outp; 992fba5d3SBen Skeggs struct dcb_output; 10f2c906fcSBen Skeggs 11*9e994444SBen Skeggs int r535_disp_new(const struct nvkm_disp_func *, struct nvkm_device *, enum nvkm_subdev_type, int, 12*9e994444SBen Skeggs struct nvkm_disp **); 13*9e994444SBen Skeggs 14a7f000ecSBen Skeggs int nvkm_disp_ctor(const struct nvkm_disp_func *, struct nvkm_device *, enum nvkm_subdev_type, int, 15a7f000ecSBen Skeggs struct nvkm_disp *); 16a7f000ecSBen Skeggs int nvkm_disp_new_(const struct nvkm_disp_func *, struct nvkm_device *, enum nvkm_subdev_type, int, 17a7f000ecSBen Skeggs struct nvkm_disp **); 1870aa8670SBen Skeggs void nvkm_disp_vblank(struct nvkm_disp *, int head); 1970aa8670SBen Skeggs 2070aa8670SBen Skeggs struct nvkm_disp_func { 218c186c83SBen Skeggs void (*dtor)(struct nvkm_disp *); 223b9ba66aSBen Skeggs int (*oneinit)(struct nvkm_disp *); 23bb3b0a42SBen Skeggs int (*init)(struct nvkm_disp *); 248c186c83SBen Skeggs void (*fini)(struct nvkm_disp *, bool suspend); 2570aa8670SBen Skeggs void (*intr)(struct nvkm_disp *); 2692fba5d3SBen Skeggs void (*intr_error)(struct nvkm_disp *, int chid); 2770aa8670SBen Skeggs 2892fba5d3SBen Skeggs void (*super)(struct work_struct *); 290407b33fSBen Skeggs 300407b33fSBen Skeggs const struct nvkm_event_func *uevent; 310407b33fSBen Skeggs 320407b33fSBen Skeggs struct { 330407b33fSBen Skeggs int (*cnt)(struct nvkm_disp *, unsigned long *mask); 340407b33fSBen Skeggs int (*new)(struct nvkm_disp *, int id); 350407b33fSBen Skeggs } wndw, head, dac, sor, pior; 360407b33fSBen Skeggs 370407b33fSBen Skeggs u16 ramht_size; 3892fba5d3SBen Skeggs 398c186c83SBen Skeggs struct nvkm_sclass root; 40168c0299SBen Skeggs 41168c0299SBen Skeggs struct nvkm_disp_user { 42168c0299SBen Skeggs struct nvkm_sclass base; 43889fcbe9SBen Skeggs int (*ctor)(const struct nvkm_oclass *, void *argv, u32 argc, 44168c0299SBen Skeggs struct nvkm_object **); 45889fcbe9SBen Skeggs const struct nvkm_disp_chan_user *chan; 46168c0299SBen Skeggs } user[]; 47c39f472eSBen Skeggs }; 48c39f472eSBen Skeggs 49acbe9ecfSBen Skeggs int nv50_disp_oneinit(struct nvkm_disp *); 50acbe9ecfSBen Skeggs int nv50_disp_init(struct nvkm_disp *); 518c186c83SBen Skeggs void nv50_disp_fini(struct nvkm_disp *, bool suspend); 52acbe9ecfSBen Skeggs void nv50_disp_intr(struct nvkm_disp *); 53acbe9ecfSBen Skeggs extern const struct nvkm_enum nv50_disp_intr_error_type[]; 54acbe9ecfSBen Skeggs void nv50_disp_super(struct work_struct *); 5592fba5d3SBen Skeggs void nv50_disp_super_1(struct nvkm_disp *); 5692fba5d3SBen Skeggs void nv50_disp_super_1_0(struct nvkm_disp *, struct nvkm_head *); 5792fba5d3SBen Skeggs void nv50_disp_super_2_0(struct nvkm_disp *, struct nvkm_head *); 5892fba5d3SBen Skeggs void nv50_disp_super_2_1(struct nvkm_disp *, struct nvkm_head *); 5992fba5d3SBen Skeggs void nv50_disp_super_2_2(struct nvkm_disp *, struct nvkm_head *); 6092fba5d3SBen Skeggs void nv50_disp_super_3_0(struct nvkm_disp *, struct nvkm_head *); 6192fba5d3SBen Skeggs 6292fba5d3SBen Skeggs int gf119_disp_init(struct nvkm_disp *); 638c186c83SBen Skeggs void gf119_disp_fini(struct nvkm_disp *, bool suspend); 6492fba5d3SBen Skeggs void gf119_disp_intr(struct nvkm_disp *); 6592fba5d3SBen Skeggs void gf119_disp_super(struct work_struct *); 6692fba5d3SBen Skeggs void gf119_disp_intr_error(struct nvkm_disp *, int); 6792fba5d3SBen Skeggs 688c186c83SBen Skeggs void gv100_disp_fini(struct nvkm_disp *, bool suspend); 6992fba5d3SBen Skeggs void gv100_disp_intr(struct nvkm_disp *); 7092fba5d3SBen Skeggs void gv100_disp_super(struct work_struct *); 7192fba5d3SBen Skeggs int gv100_disp_wndw_cnt(struct nvkm_disp *, unsigned long *); 72889fcbe9SBen Skeggs int gv100_disp_caps_new(const struct nvkm_oclass *, void *, u32, struct nvkm_object **); 7392fba5d3SBen Skeggs 7492fba5d3SBen Skeggs int tu102_disp_init(struct nvkm_disp *); 7592fba5d3SBen Skeggs 7692fba5d3SBen Skeggs void nv50_disp_dptmds_war_2(struct nvkm_disp *, struct dcb_output *); 7792fba5d3SBen Skeggs void nv50_disp_dptmds_war_3(struct nvkm_disp *, struct dcb_output *); 7892fba5d3SBen Skeggs void nv50_disp_update_sppll1(struct nvkm_disp *); 7992fba5d3SBen Skeggs 8092fba5d3SBen Skeggs extern const struct nvkm_event_func nv50_disp_chan_uevent; 8192fba5d3SBen Skeggs void nv50_disp_chan_uevent_send(struct nvkm_disp *, int); 8292fba5d3SBen Skeggs 8392fba5d3SBen Skeggs extern const struct nvkm_event_func gf119_disp_chan_uevent; 8492fba5d3SBen Skeggs extern const struct nvkm_event_func gv100_disp_chan_uevent; 8592fba5d3SBen Skeggs 86168c0299SBen Skeggs int nvkm_udisp_new(const struct nvkm_oclass *, void *, u32, struct nvkm_object **); 8795983aeaSBen Skeggs int nvkm_uconn_new(const struct nvkm_oclass *, void *, u32, struct nvkm_object **); 881b255f1cSBen Skeggs int nvkm_uoutp_new(const struct nvkm_oclass *, void *, u32, struct nvkm_object **); 89a2b7eadfSBen Skeggs int nvkm_uhead_new(const struct nvkm_oclass *, void *, u32, struct nvkm_object **); 90c39f472eSBen Skeggs #endif 91