Home | History | Annotate | Line # | Download | only in disp
      1 /*	$NetBSD: nv50.h,v 1.3 2021/12/18 23:45:35 riastradh Exp $	*/
      2 
      3 /* SPDX-License-Identifier: MIT */
      4 #ifndef __NV50_DISP_H__
      5 #define __NV50_DISP_H__
      6 
      7 #include <linux/workqueue.h>
      8 
      9 #define nv50_disp(p) container_of((p), struct nv50_disp, base)
     10 #include "priv.h"
     11 struct nvkm_head;
     12 
     13 #include <core/enum.h>
     14 
     15 struct nv50_disp {
     16 	const struct nv50_disp_func *func;
     17 	struct nvkm_disp base;
     18 
     19 	struct workqueue_struct *wq;
     20 	struct work_struct supervisor;
     21 	u32 super;
     22 
     23 	struct nvkm_event uevent;
     24 
     25 	struct {
     26 		unsigned long mask;
     27 		int nr;
     28 	} wndw, head, dac;
     29 
     30 	struct {
     31 		unsigned long mask;
     32 		int nr;
     33 		u32 lvdsconf;
     34 	} sor;
     35 
     36 	struct {
     37 		unsigned long mask;
     38 		int nr;
     39 		u8 type[3];
     40 	} pior;
     41 
     42 	struct nvkm_gpuobj *inst;
     43 	struct nvkm_ramht *ramht;
     44 
     45 	struct nv50_disp_chan *chan[81];
     46 };
     47 
     48 void nv50_disp_super_1(struct nv50_disp *);
     49 void nv50_disp_super_1_0(struct nv50_disp *, struct nvkm_head *);
     50 void nv50_disp_super_2_0(struct nv50_disp *, struct nvkm_head *);
     51 void nv50_disp_super_2_1(struct nv50_disp *, struct nvkm_head *);
     52 void nv50_disp_super_2_2(struct nv50_disp *, struct nvkm_head *);
     53 void nv50_disp_super_3_0(struct nv50_disp *, struct nvkm_head *);
     54 
     55 int nv50_disp_new_(const struct nv50_disp_func *, struct nvkm_device *,
     56 		   int index, struct nvkm_disp **);
     57 
     58 struct nv50_disp_func {
     59 	int (*init)(struct nv50_disp *);
     60 	void (*fini)(struct nv50_disp *);
     61 	void (*intr)(struct nv50_disp *);
     62 	void (*intr_error)(struct nv50_disp *, int chid);
     63 
     64 	const struct nvkm_event_func *uevent;
     65 	void (*super)(struct work_struct *);
     66 
     67 	const struct nvkm_disp_oclass *root;
     68 
     69 	struct {
     70 		int (*cnt)(struct nvkm_disp *, unsigned long *mask);
     71 		int (*new)(struct nvkm_disp *, int id);
     72 	} wndw, head, dac, sor, pior;
     73 
     74 	u16 ramht_size;
     75 };
     76 
     77 int nv50_disp_init(struct nv50_disp *);
     78 void nv50_disp_fini(struct nv50_disp *);
     79 void nv50_disp_intr(struct nv50_disp *);
     80 void nv50_disp_super(struct work_struct *);
     81 extern const struct nvkm_enum nv50_disp_intr_error_type[];
     82 
     83 int gf119_disp_init(struct nv50_disp *);
     84 void gf119_disp_fini(struct nv50_disp *);
     85 void gf119_disp_intr(struct nv50_disp *);
     86 void gf119_disp_super(struct work_struct *);
     87 void gf119_disp_intr_error(struct nv50_disp *, int);
     88 
     89 void gv100_disp_fini(struct nv50_disp *);
     90 void gv100_disp_intr(struct nv50_disp *);
     91 void gv100_disp_super(struct work_struct *);
     92 int gv100_disp_wndw_cnt(struct nvkm_disp *, unsigned long *);
     93 
     94 void nv50_disp_dptmds_war_2(struct nv50_disp *, struct dcb_output *);
     95 void nv50_disp_dptmds_war_3(struct nv50_disp *, struct dcb_output *);
     96 void nv50_disp_update_sppll1(struct nv50_disp *);
     97 
     98 extern const struct nvkm_event_func nv50_disp_chan_uevent;
     99 int  nv50_disp_chan_uevent_ctor(struct nvkm_object *, void *, u32,
    100 				struct nvkm_notify *);
    101 void nv50_disp_chan_uevent_send(struct nv50_disp *, int);
    102 
    103 extern const struct nvkm_event_func gf119_disp_chan_uevent;
    104 extern const struct nvkm_event_func gv100_disp_chan_uevent;
    105 #endif
    106