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
;
126 CHIP_ERRATA_R300_CG
= 0x00000001,
127 CHIP_ERRATA_PLL_DUMMYREADS
= 0x00000002,
128 CHIP_ERRATA_PLL_DELAY
= 0x00000004
131 #define IS_RV100_VARIANT ((sd->Card.Type == RV100) || \
132 (sd->Card.Type == RV200) || \
133 (sd->Card.Type == RS100) || \
134 (sd->Card.Type == RS200) || \
135 (sd->Card.Type == RV250) || \
136 (sd->Card.Type == RV280) || \
137 (sd->Card.Type == RS300))
139 #define IS_R300_VARIANT ((sd->Card.Type == R300) || \
140 (sd->Card.Type == RV350) || \
141 (sd->Card.Type == R350) || \
142 (sd->Card.Type == RV380) || \
143 (sd->Card.Type == R420))
146 ULONG pixelc
, HDisplay
, bpp
;
148 /* Common registers */
150 ULONG ovr_wid_left_right
;
151 ULONG ovr_wid_top_bottom
;
152 ULONG ov0_scale_cntl
;
159 ULONG cap0_trig_cntl
;
160 ULONG cap1_trig_cntl
;
163 ULONG bios_4_scratch
;
164 ULONG bios_5_scratch
;
165 ULONG bios_6_scratch
;
167 /* Other registers to save for VT switches */
169 ULONG rbbm_soft_reset
;
170 ULONG clock_cntl_index
;
171 ULONG amcgpio_en_reg
;
178 ULONG crtc_h_total_disp
;
179 ULONG crtc_h_sync_strt_wid
;
180 ULONG crtc_v_total_disp
;
181 ULONG crtc_v_sync_strt_wid
;
183 ULONG crtc_offset_cntl
;
185 ULONG disp_merge_cntl
;
186 ULONG grph_buffer_cntl
;
187 ULONG crtc_more_cntl
;
189 /* CRTC2 registers */
190 ULONG crtc2_gen_cntl
;
193 ULONG disp_output_cntl
;
195 ULONG disp2_merge_cntl
;
196 ULONG grph2_buffer_cntl
;
197 ULONG crtc2_h_total_disp
;
198 ULONG crtc2_h_sync_strt_wid
;
199 ULONG crtc2_v_total_disp
;
200 ULONG crtc2_v_sync_strt_wid
;
202 ULONG crtc2_offset_cntl
;
204 /* Flat panel registers */
205 ULONG fp_crtc_h_total_disp
;
206 ULONG fp_crtc_v_total_disp
;
209 ULONG fp_h_sync_strt_wid
;
210 ULONG fp2_h_sync_strt_wid
;
211 ULONG fp_horz_stretch
;
213 ULONG fp_v_sync_strt_wid
;
214 ULONG fp2_v_sync_strt_wid
;
215 ULONG fp_vert_stretch
;
219 ULONG tmds_transmitter_cntl
;
221 /* Computed values for PLL */
222 ULONG dot_clock_freq
;
223 ULONG pll_output_freq
;
228 unsigned ppll_ref_div
;
232 /* Computed values for PLL2 */
233 ULONG dot_clock_freq_2
;
234 ULONG pll_output_freq_2
;
257 UBYTE
*VBIOS
, *vbios_org
;
261 UWORD ROMHeaderStart
;
262 UWORD MasterDataStart
;
270 /* TODO: Remove IsSecondary! Clone screens instead */
273 BOOL R300CGWorkaround
;
284 BOOL ReversedDAC
; /* TVDAC used as primary dac */
285 BOOL ReversedTMDS
; /* DDC_DVI is used for external TMDS */
286 RADEONMonitorType MonType2
;
287 RADEONMonitorType MonType1
;
289 RADEONErrata ChipErrata
;
291 RADEONConnector PortInfo
[2];
292 RADEONTMDSPll tmds_pll
[4];
297 ULONG PanelXRes
, PanelYRes
;
298 ULONG HBlank
, HOverPlus
, HSyncWidth
;
299 ULONG VBlank
, VOverPlus
, VSyncWidth
;
312 #define V_DBLSCAN 0x00000001
313 #define V_CSYNC 0x00000002
314 #define V_NHSYNC 0x00000004
315 #define V_NVSYNC 0x00000008
316 #define V_INTERLACE 0x10000000
317 #define RADEON_USE_RMX 0x80000000
319 #define RADEON_IDLE_ENTRY 16
320 #define RADEON_TIMEOUT 2000000
321 #define RADEON_MMIOSIZE 0x80000
323 #define RADEONWaitForFifo(sd, entries) \
325 if (sd->Card.FIFOSlots < entries) \
326 RADEONWaitForFifoFunction(sd, entries); \
327 sd->Card.FIFOSlots -= entries; \
331 struct ati_staticdata
;
332 void SaveState(struct ati_staticdata
*sd
, struct CardState
*save
);
333 void LoadState(struct ati_staticdata
*sd
, struct CardState
*restore
);
334 void DPMS(struct ati_staticdata
*sd
, HIDDT_DPMSLevel level
);
335 void ShowHideCursor(struct ati_staticdata
*sd
, BOOL visible
);
336 void InitMode(struct ati_staticdata
*sd
, struct CardState
*save
,
337 ULONG width
, ULONG height
, UBYTE bpp
, ULONG pixelc
, IPTR base
,
338 ULONG HDisplay
, ULONG VDisplay
,
339 ULONG HSyncStart
, ULONG HSyncEnd
, ULONG HTotal
,
340 ULONG VSyncStart
, ULONG VSyncEnd
, ULONG VTotal
);
341 BOOL
RADEONInit(struct ati_staticdata
*sd
);
343 IPTR
AllocBitmapArea(struct ati_staticdata
*sd
, ULONG width
, ULONG height
,
344 ULONG bpp
, BOOL must_have
);
345 VOID
FreeBitmapArea(struct ati_staticdata
*sd
, IPTR bmp
, ULONG width
, ULONG height
, ULONG bpp
);
346 void R300CGWorkaround(struct ati_staticdata
*sd
);
347 unsigned RADEONINPLL(struct ati_staticdata
*sd
, int addr
);
348 VOID
SetGamma(struct ati_staticdata
*sd
, float r
, float g
, float b
);