1#ifndef __NV50_DISP_H__ 2#define __NV50_DISP_H__ 3 4#include <core/parent.h> 5#include <core/namedb.h> 6#include <core/engctx.h> 7#include <core/ramht.h> 8#include <core/event.h> 9 10#include <engine/dmaobj.h> 11#include <engine/disp.h> 12 13#include "dport.h" 14 15struct nv50_disp_priv { 16 struct nouveau_disp base; 17 struct nouveau_oclass *sclass; 18 19 struct work_struct supervisor; 20 u32 super; 21 22 struct { 23 int nr; 24 } head; 25 struct { 26 int nr; 27 int (*power)(struct nv50_disp_priv *, int dac, u32 data); 28 int (*sense)(struct nv50_disp_priv *, int dac, u32 load); 29 } dac; 30 struct { 31 int nr; 32 int (*power)(struct nv50_disp_priv *, int sor, u32 data); 33 int (*hda_eld)(struct nv50_disp_priv *, int sor, u8 *, u32); 34 int (*hdmi)(struct nv50_disp_priv *, int head, int sor, u32); 35 u32 lvdsconf; 36 const struct nouveau_dp_func *dp; 37 } sor; 38 struct { 39 int nr; 40 int (*power)(struct nv50_disp_priv *, int ext, u32 data); 41 u8 type[3]; 42 const struct nouveau_dp_func *dp; 43 } pior; 44}; 45 46#define DAC_MTHD(n) (n), (n) + 0x03 47 48int nv50_dac_mthd(struct nouveau_object *, u32, void *, u32); 49int nv50_dac_power(struct nv50_disp_priv *, int, u32); 50int nv50_dac_sense(struct nv50_disp_priv *, int, u32); 51 52#define SOR_MTHD(n) (n), (n) + 0x3f 53 54int nva3_hda_eld(struct nv50_disp_priv *, int, u8 *, u32); 55int nvd0_hda_eld(struct nv50_disp_priv *, int, u8 *, u32); 56 57int nv84_hdmi_ctrl(struct nv50_disp_priv *, int, int, u32); 58int nva3_hdmi_ctrl(struct nv50_disp_priv *, int, int, u32); 59int nvd0_hdmi_ctrl(struct nv50_disp_priv *, int, int, u32); 60 61int nv50_sor_mthd(struct nouveau_object *, u32, void *, u32); 62int nv50_sor_power(struct nv50_disp_priv *, int, u32); 63 64int nv94_sor_dp_train_init(struct nv50_disp_priv *, int, int, int, u16, u16, 65 u32, struct dcb_output *); 66int nv94_sor_dp_train_fini(struct nv50_disp_priv *, int, int, int, u16, u16, 67 u32, struct dcb_output *); 68int nv94_sor_dp_train(struct nv50_disp_priv *, int, int, u16, u16, u32, 69 struct dcb_output *); 70int nv94_sor_dp_lnkctl(struct nv50_disp_priv *, int, int, int, u16, u16, u32, 71 struct dcb_output *); 72int nv94_sor_dp_drvctl(struct nv50_disp_priv *, int, int, int, u16, u16, u32, 73 struct dcb_output *); 74 75int nvd0_sor_dp_train(struct nv50_disp_priv *, int, int, u16, u16, u32, 76 struct dcb_output *); 77int nvd0_sor_dp_lnkctl(struct nv50_disp_priv *, int, int, int, u16, u16, u32, 78 struct dcb_output *); 79int nvd0_sor_dp_drvctl(struct nv50_disp_priv *, int, int, int, u16, u16, u32, 80 struct dcb_output *); 81 82#define PIOR_MTHD(n) (n), (n) + 0x03 83 84int nv50_pior_mthd(struct nouveau_object *, u32, void *, u32); 85int nv50_pior_power(struct nv50_disp_priv *, int, u32); 86 87struct nv50_disp_base { 88 struct nouveau_parent base; 89 struct nouveau_ramht *ramht; 90 u32 chan; 91}; 92 93struct nv50_disp_chan { 94 struct nouveau_namedb base; 95 int chid; 96}; 97 98int nv50_disp_chan_create_(struct nouveau_object *, struct nouveau_object *, 99 struct nouveau_oclass *, int, int, void **); 100void nv50_disp_chan_destroy(struct nv50_disp_chan *); 101u32 nv50_disp_chan_rd32(struct nouveau_object *, u64); 102void nv50_disp_chan_wr32(struct nouveau_object *, u64, u32); 103 104#define nv50_disp_chan_init(a) \ 105 nouveau_namedb_init(&(a)->base) 106#define nv50_disp_chan_fini(a,b) \ 107 nouveau_namedb_fini(&(a)->base, (b)) 108 109int nv50_disp_dmac_create_(struct nouveau_object *, struct nouveau_object *, 110 struct nouveau_oclass *, u32, int, int, void **); 111void nv50_disp_dmac_dtor(struct nouveau_object *); 112 113struct nv50_disp_dmac { 114 struct nv50_disp_chan base; 115 struct nouveau_dmaobj *pushdma; 116 u32 push; 117}; 118 119struct nv50_disp_pioc { 120 struct nv50_disp_chan base; 121}; 122 123extern struct nouveau_ofuncs nv50_disp_mast_ofuncs; 124extern struct nouveau_ofuncs nv50_disp_sync_ofuncs; 125extern struct nouveau_ofuncs nv50_disp_ovly_ofuncs; 126extern struct nouveau_ofuncs nv50_disp_oimm_ofuncs; 127extern struct nouveau_ofuncs nv50_disp_curs_ofuncs; 128extern struct nouveau_ofuncs nv50_disp_base_ofuncs; 129extern struct nouveau_oclass nv50_disp_cclass; 130void nv50_disp_intr_supervisor(struct work_struct *); 131void nv50_disp_intr(struct nouveau_subdev *); 132 133extern struct nouveau_omthds nv84_disp_base_omthds[]; 134 135extern struct nouveau_omthds nva3_disp_base_omthds[]; 136 137extern struct nouveau_ofuncs nvd0_disp_mast_ofuncs; 138extern struct nouveau_ofuncs nvd0_disp_sync_ofuncs; 139extern struct nouveau_ofuncs nvd0_disp_ovly_ofuncs; 140extern struct nouveau_ofuncs nvd0_disp_oimm_ofuncs; 141extern struct nouveau_ofuncs nvd0_disp_curs_ofuncs; 142extern struct nouveau_ofuncs nvd0_disp_base_ofuncs; 143extern struct nouveau_oclass nvd0_disp_cclass; 144void nvd0_disp_intr_supervisor(struct work_struct *); 145void nvd0_disp_intr(struct nouveau_subdev *); 146 147#endif 148