1 #ifndef __NV04_DISPLAY_H__
2 #define __NV04_DISPLAY_H__
4 #include <subdev/bios/pll.h>
6 #include "nouveau_display.h"
8 enum nv04_fp_display_regs
{
18 struct nv04_crtc_reg
{
19 unsigned char MiscOutReg
;
24 uint8_t Attribute
[21];
25 unsigned char DAC
[768];
35 uint32_t crtc_eng_ctrl
;
38 uint32_t nv10_cursync
;
39 struct nouveau_pll_vals pllvals
;
40 uint32_t ramdac_gen_ctrl
;
46 uint32_t tv_vsync_delay
;
49 uint32_t tv_hsync_delay
;
50 uint32_t tv_hsync_delay2
;
51 uint32_t fp_horiz_regs
[7];
52 uint32_t fp_vert_regs
[7];
55 uint32_t dither_regs
[6];
59 uint32_t fp_margin_color
;
64 uint32_t ctv_regs
[38];
67 struct nv04_output_reg
{
72 struct nv04_mode_state
{
73 struct nv04_crtc_reg crtc_reg
[2];
79 struct nv04_mode_state mode_reg
;
80 struct nv04_mode_state saved_reg
;
81 uint32_t saved_vga_font
[4][16384];
82 uint32_t dac_users
[4];
83 struct nouveau_bo
*image
[2];
86 static inline struct nv04_display
*
87 nv04_display(struct drm_device
*dev
)
89 return nouveau_display(dev
)->priv
;
93 int nv04_display_early_init(struct drm_device
*);
94 void nv04_display_late_takedown(struct drm_device
*);
95 int nv04_display_create(struct drm_device
*);
96 void nv04_display_destroy(struct drm_device
*);
97 int nv04_display_init(struct drm_device
*);
98 void nv04_display_fini(struct drm_device
*);
101 int nv04_crtc_create(struct drm_device
*, int index
);
104 int nv04_dac_create(struct drm_connector
*, struct dcb_output
*);
105 uint32_t nv17_dac_sample_load(struct drm_encoder
*encoder
);
106 int nv04_dac_output_offset(struct drm_encoder
*encoder
);
107 void nv04_dac_update_dacclk(struct drm_encoder
*encoder
, bool enable
);
108 bool nv04_dac_in_use(struct drm_encoder
*encoder
);
111 int nv04_dfp_create(struct drm_connector
*, struct dcb_output
*);
112 int nv04_dfp_get_bound_head(struct drm_device
*dev
, struct dcb_output
*dcbent
);
113 void nv04_dfp_bind_head(struct drm_device
*dev
, struct dcb_output
*dcbent
,
115 void nv04_dfp_disable(struct drm_device
*dev
, int head
);
116 void nv04_dfp_update_fp_control(struct drm_encoder
*encoder
, int mode
);
119 int nv04_tv_identify(struct drm_device
*dev
, int i2c_index
);
120 int nv04_tv_create(struct drm_connector
*, struct dcb_output
*);
123 int nv17_tv_create(struct drm_connector
*, struct dcb_output
*);
126 void nouveau_overlay_init(struct drm_device
*dev
);
129 nv_two_heads(struct drm_device
*dev
)
131 struct nouveau_drm
*drm
= nouveau_drm(dev
);
132 const int impl
= dev
->pdev
->device
& 0x0ff0;
134 if (nv_device(drm
->device
)->card_type
>= NV_10
&& impl
!= 0x0100 &&
135 impl
!= 0x0150 && impl
!= 0x01a0 && impl
!= 0x0200)
142 nv_gf4_disp_arch(struct drm_device
*dev
)
144 return nv_two_heads(dev
) && (dev
->pdev
->device
& 0x0ff0) != 0x0110;
148 nv_two_reg_pll(struct drm_device
*dev
)
150 struct nouveau_drm
*drm
= nouveau_drm(dev
);
151 const int impl
= dev
->pdev
->device
& 0x0ff0;
153 if (impl
== 0x0310 || impl
== 0x0340 || nv_device(drm
->device
)->card_type
>= NV_40
)
159 nv_match_device(struct drm_device
*dev
, unsigned device
,
160 unsigned sub_vendor
, unsigned sub_device
)
162 return dev
->pdev
->device
== device
&&
163 dev
->pdev
->subsystem_vendor
== sub_vendor
&&
164 dev
->pdev
->subsystem_device
== sub_device
;
167 #include <subdev/bios.h>
168 #include <subdev/bios/init.h>
171 nouveau_bios_run_init_table(struct drm_device
*dev
, u16 table
,
172 struct dcb_output
*outp
, int crtc
)
174 struct nouveau_device
*device
= nouveau_dev(dev
);
175 struct nouveau_bios
*bios
= nouveau_bios(device
);
176 struct nvbios_init init
= {
177 .subdev
= nv_subdev(bios
),