4 #include <exec/types.h>
21 DDC_NONE_DETECTED
, DDC_NONE
= DDC_NONE_DETECTED
,
41 CONNECTOR_PROPRIETARY
,
48 } RADEONConnectorType
;
60 CONNECTOR_DIGITAL_ATOM
,
61 CONNECTOR_UNSUPPORTED_ATOM
62 } RADEONConnectorTypeATOM
;
80 RADEONDDCType DDCType
;
81 RADEONDacType DACType
;
82 RADEONTmdsType TMDSType
;
83 RADEONConnectorType ConnectorType
;
84 RADEONMonitorType MonType
;
125 #define IS_RV100_VARIANT ((sd->Card.Type == RV100) || \
126 (sd->Card.Type == RV200) || \
127 (sd->Card.Type == RS100) || \
128 (sd->Card.Type == RS200) || \
129 (sd->Card.Type == RV250) || \
130 (sd->Card.Type == RV280) || \
131 (sd->Card.Type == RS300))
133 #define IS_R300_VARIANT ((sd->Card.Type == R300) || \
134 (sd->Card.Type == RV350) || \
135 (sd->Card.Type == R350) || \
136 (sd->Card.Type == RV380) || \
137 (sd->Card.Type == R420))
140 ULONG pixelc
, HDisplay
, bpp
;
142 /* Common registers */
144 ULONG ovr_wid_left_right
;
145 ULONG ovr_wid_top_bottom
;
146 ULONG ov0_scale_cntl
;
153 ULONG cap0_trig_cntl
;
154 ULONG cap1_trig_cntl
;
157 ULONG bios_4_scratch
;
158 ULONG bios_5_scratch
;
159 ULONG bios_6_scratch
;
161 /* Other registers to save for VT switches */
163 ULONG rbbm_soft_reset
;
164 ULONG clock_cntl_index
;
165 ULONG amcgpio_en_reg
;
172 ULONG crtc_h_total_disp
;
173 ULONG crtc_h_sync_strt_wid
;
174 ULONG crtc_v_total_disp
;
175 ULONG crtc_v_sync_strt_wid
;
177 ULONG crtc_offset_cntl
;
179 ULONG disp_merge_cntl
;
180 ULONG grph_buffer_cntl
;
181 ULONG crtc_more_cntl
;
183 /* CRTC2 registers */
184 ULONG crtc2_gen_cntl
;
187 ULONG disp_output_cntl
;
189 ULONG disp2_merge_cntl
;
190 ULONG grph2_buffer_cntl
;
191 ULONG crtc2_h_total_disp
;
192 ULONG crtc2_h_sync_strt_wid
;
193 ULONG crtc2_v_total_disp
;
194 ULONG crtc2_v_sync_strt_wid
;
196 ULONG crtc2_offset_cntl
;
198 /* Flat panel registers */
199 ULONG fp_crtc_h_total_disp
;
200 ULONG fp_crtc_v_total_disp
;
203 ULONG fp_h_sync_strt_wid
;
204 ULONG fp2_h_sync_strt_wid
;
205 ULONG fp_horz_stretch
;
207 ULONG fp_v_sync_strt_wid
;
208 ULONG fp2_v_sync_strt_wid
;
209 ULONG fp_vert_stretch
;
213 ULONG tmds_transmitter_cntl
;
215 /* Computed values for PLL */
216 ULONG dot_clock_freq
;
217 ULONG pll_output_freq
;
222 unsigned ppll_ref_div
;
226 /* Computed values for PLL2 */
227 ULONG dot_clock_freq_2
;
228 ULONG pll_output_freq_2
;
251 UBYTE
*VBIOS
, *vbios_org
;
255 UWORD ROMHeaderStart
;
256 UWORD MasterDataStart
;
264 #warning TODO: Remove IsSecondary! Clone screens instead
267 BOOL R300CGWorkaround
;
278 BOOL ReversedDAC
; /* TVDAC used as primary dac */
279 BOOL ReversedTMDS
; /* DDC_DVI is used for external TMDS */
280 RADEONMonitorType MonType2
;
281 RADEONMonitorType MonType1
;
283 RADEONConnector PortInfo
[2];
284 RADEONTMDSPll tmds_pll
[4];
289 ULONG PanelXRes
, PanelYRes
;
290 ULONG HBlank
, HOverPlus
, HSyncWidth
;
291 ULONG VBlank
, VOverPlus
, VSyncWidth
;
304 #define V_DBLSCAN 0x00000001
305 #define V_CSYNC 0x00000002
306 #define V_NHSYNC 0x00000004
307 #define V_NVSYNC 0x00000008
308 #define V_INTERLACE 0x10000000
309 #define RADEON_USE_RMX 0x80000000
311 #define RADEON_IDLE_ENTRY 16
312 #define RADEON_TIMEOUT 2000000
313 #define RADEON_MMIOSIZE 0x80000
315 #define RADEONWaitForFifo(sd, entries) \
317 if (sd->Card.FIFOSlots < entries) \
318 RADEONWaitForFifoFunction(sd, entries); \
319 sd->Card.FIFOSlots -= entries; \
323 struct ati_staticdata
;
324 void SaveState(struct ati_staticdata
*sd
, struct CardState
*save
);
325 void LoadState(struct ati_staticdata
*sd
, struct CardState
*restore
);
326 void DPMS(struct ati_staticdata
*sd
, HIDDT_DPMSLevel level
);
327 void ShowHideCursor(struct ati_staticdata
*sd
, BOOL visible
);
328 void InitMode(struct ati_staticdata
*sd
, struct CardState
*save
,
329 ULONG width
, ULONG height
, UBYTE bpp
, ULONG pixelc
, IPTR base
,
330 ULONG HDisplay
, ULONG VDisplay
,
331 ULONG HSyncStart
, ULONG HSyncEnd
, ULONG HTotal
,
332 ULONG VSyncStart
, ULONG VSyncEnd
, ULONG VTotal
);
333 BOOL
RADEONInit(struct ati_staticdata
*sd
);
335 IPTR
AllocBitmapArea(struct ati_staticdata
*sd
, ULONG width
, ULONG height
,
336 ULONG bpp
, BOOL must_have
);
337 VOID
FreeBitmapArea(struct ati_staticdata
*sd
, IPTR bmp
, ULONG width
, ULONG height
, ULONG bpp
);
338 void R300CGWorkaround(struct ati_staticdata
*sd
);
339 unsigned RADEONINPLL(struct ati_staticdata
*sd
, int addr
);
340 VOID
SetGamma(struct ati_staticdata
*sd
, float r
, float g
, float b
);