3 * Copyright (C) 2005 Advanced Micro Devices, Inc. All Rights Reserved.
10 * Cimarron function prototypes.
18 /* INCLUDE USER PARAMETER DEFINITIONS */
22 /* COMPILER OPTION FOR C++ PROGRAMS */
28 /*--------------------------*/
29 /* CIMARRON MEMORY POINTERS */
30 /*--------------------------*/
32 extern unsigned char *cim_gp_ptr
;
33 extern unsigned char *cim_fb_ptr
;
34 extern unsigned char *cim_cmd_base_ptr
;
35 extern unsigned char *cim_cmd_ptr
;
36 extern unsigned char *cim_vid_ptr
;
37 extern unsigned char *cim_vip_ptr
;
38 extern unsigned char *cim_vg_ptr
;
40 /*----------------------------------------*/
41 /* INITIALIZATION ROUTINE DEFINITIONS */
42 /*----------------------------------------*/
44 int init_detect_cpu (unsigned long *cpu_revision
, unsigned long *companion_revision
);
45 unsigned long init_read_pci (unsigned long address
);
46 int init_read_base_addresses (INIT_BASE_ADDRESSES
*base_addresses
);
47 int init_read_cpu_frequency (unsigned long *cpu_frequency
);
49 /*----------------------------------------*/
50 /* GRAPHICS PROCESSOR ROUTINE DEFINITIONS */
51 /*----------------------------------------*/
53 void gp_set_limit_on_buffer_lead (unsigned long lead
);
54 void gp_set_command_buffer_base (unsigned long address
, unsigned long start
,
56 void gp_set_frame_buffer_base (unsigned long address
, unsigned long size
);
57 void gp_set_bpp (int bpp
);
58 void gp_declare_blt (unsigned long flags
);
59 void gp_declare_vector (unsigned long flags
);
60 void gp_write_parameters (void);
61 void gp_set_raster_operation (unsigned char ROP
);
62 void gp_set_alpha_operation (int alpha_operation
, int alpha_type
, int channel
,
63 int apply_alpha
, unsigned char alpha
);
64 void gp_set_solid_pattern (unsigned long color
);
65 void gp_set_mono_pattern (unsigned long bgcolor
, unsigned long fgcolor
,
66 unsigned long data0
, unsigned long data1
, int transparent
, int x
, int y
);
67 void gp_set_pattern_origin (int x
, int y
);
68 void gp_set_color_pattern (unsigned long *pattern
, int format
, int x
, int y
);
69 void gp_set_mono_source (unsigned long bgcolor
, unsigned long fgcolor
,
71 void gp_set_solid_source (unsigned long color
);
72 void gp_set_source_transparency (unsigned long color
, unsigned long mask
);
73 void gp_program_lut (unsigned long *colors
, int full_lut
);
74 void gp_set_vector_pattern (unsigned long pattern
, unsigned long color
, int length
);
75 void gp_set_strides (unsigned long dst_stride
, unsigned long src_stride
);
76 void gp_set_source_format (int format
);
77 void gp_pattern_fill (unsigned long dstoffset
, unsigned long width
, unsigned long height
);
78 void gp_screen_to_screen_blt (unsigned long dstoffset
, unsigned long srcoffset
,
79 unsigned long width
, unsigned long height
, int flags
);
80 void gp_screen_to_screen_convert (unsigned long dstoffset
, unsigned long srcoffset
,
81 unsigned long width
, unsigned long height
, int nibble
);
82 void gp_color_bitmap_to_screen_blt (unsigned long dstoffset
, unsigned long srcx
,
83 unsigned long width
, unsigned long height
, unsigned char *data
, long pitch
);
84 void gp_color_convert_blt (unsigned long dstoffset
, unsigned long srcx
,
85 unsigned long width
, unsigned long height
, unsigned char *data
, long pitch
);
86 void gp_custom_convert_blt (unsigned long dstoffset
, unsigned long srcx
,
87 unsigned long width
, unsigned long height
, unsigned char *data
, long pitch
);
88 void gp_rotate_blt (unsigned long dstoffset
, unsigned long srcoffset
,
89 unsigned long width
, unsigned long height
, int degrees
);
90 void gp_mono_bitmap_to_screen_blt (unsigned long dstoffset
, unsigned long srcx
,
91 unsigned long width
, unsigned long height
, unsigned char *data
, long stride
);
92 void gp_text_blt (unsigned long dstoffset
, unsigned long width
,
93 unsigned long height
, unsigned char *data
);
94 void gp_mono_expand_blt (unsigned long dstoffset
, unsigned long srcoffset
,
95 unsigned long srcx
, unsigned long width
, unsigned long height
, int byte_packed
);
96 void gp_antialiased_text (unsigned long dstoffset
, unsigned long srcx
,
97 unsigned long width
, unsigned long height
, unsigned char *data
, long stride
,
99 void gp_masked_blt (unsigned long dstoffset
, unsigned long width
,
100 unsigned long height
, unsigned long mono_srcx
, unsigned long color_srcx
,
101 unsigned char *mono_mask
, unsigned char *color_data
, long mono_pitch
,
103 void gp_screen_to_screen_masked (unsigned long dstoffset
, unsigned long srcoffset
,
104 unsigned long width
, unsigned long height
, unsigned long mono_srcx
,
105 unsigned char *mono_mask
, long mono_pitch
);
106 void gp_bresenham_line (unsigned long dstoffset
, unsigned short length
,
107 unsigned short initerr
, unsigned short axialerr
, unsigned short diagerr
,
108 unsigned long flags
);
109 void gp_line_from_endpoints (unsigned long dstoffset
, unsigned long x0
,
110 unsigned long y0
, unsigned long x1
, unsigned long y1
, int inclusive
);
112 int gp_test_blt_pending (void);
113 void gp_wait_blt_pending (void);
114 void gp_wait_until_idle (void);
115 int gp_test_blt_busy (void);
116 void gp_save_state (GP_SAVE_RESTORE
*gp_state
);
117 void gp_restore_state (GP_SAVE_RESTORE
*gp_state
);
119 /*----------------------------------------*/
120 /* VIDEO GENERATOR ROUTINE DEFINITIONS */
121 /*----------------------------------------*/
123 int vg_delay_milliseconds (unsigned long ms
);
124 int vg_set_display_mode (unsigned long src_width
, unsigned long src_height
,
125 unsigned long dst_width
, unsigned long dst_height
, int bpp
, int hz
,
126 unsigned long flags
);
127 int vg_set_panel_mode (unsigned long src_width
, unsigned long src_height
,
128 unsigned long dst_width
, unsigned long dst_height
,
129 unsigned long panel_width
, unsigned long panel_height
,
130 int bpp
, unsigned long flags
);
131 int vg_set_tv_mode (unsigned long *src_width
, unsigned long *src_height
,
132 unsigned long encoder
, unsigned long tvres
, int bpp
, unsigned long flags
,
133 unsigned long h_overscan
, unsigned long v_overscan
);
134 int vg_set_custom_mode (VG_DISPLAY_MODE
*mode_params
, int bpp
);
135 int vg_set_display_bpp (int bpp
);
136 int vg_get_display_mode_index (VG_QUERY_MODE
*query
);
137 int vg_get_display_mode_information (unsigned int index
, VG_DISPLAY_MODE
*vg_mode
);
138 int vg_get_display_mode_count (void);
139 int vg_get_current_display_mode (VG_DISPLAY_MODE
*current_display
, int *bpp
);
140 int vg_set_scaler_filter_coefficients (long h_taps
[][5], long v_taps
[][3]);
141 int vg_configure_flicker_filter (unsigned long flicker_strength
, int flicker_alpha
);
142 int vg_set_clock_frequency (unsigned long frequency
, unsigned long pll_flags
);
143 int vg_set_border_color (unsigned long border_color
);
144 int vg_set_cursor_enable(int enable
);
145 int vg_set_mono_cursor_colors (unsigned long bkcolor
, unsigned long fgcolor
);
146 int vg_set_cursor_position(long xpos
, long ypos
, VG_PANNING_COORDINATES
*panning
);
147 int vg_set_mono_cursor_shape32(unsigned long memoffset
, unsigned long *andmask
,
148 unsigned long *xormask
, unsigned long x_hotspot
, unsigned long y_hotspot
);
149 int vg_set_mono_cursor_shape64(unsigned long memoffset
, unsigned long *andmask
,
150 unsigned long *xormask
, unsigned long x_hotspot
, unsigned long y_hotspot
);
151 int vg_set_color_cursor_shape (unsigned long memoffset
, unsigned char *data
,
152 unsigned long width
, unsigned long height
, long pitch
,
153 unsigned long x_hotspot
, unsigned long y_hotspot
);
154 int vg_pan_desktop (unsigned long x
, unsigned long y
, VG_PANNING_COORDINATES
*panning
);
155 int vg_set_display_offset (unsigned long address
);
156 int vg_set_display_pitch (unsigned long pitch
);
157 int vg_set_display_palette_entry (unsigned long index
, unsigned long palette
);
158 int vg_set_display_palette (unsigned long *palette
);
159 int vg_set_compression_enable (int enable
);
160 int vg_configure_compression (VG_COMPRESSION_DATA
*comp_data
);
161 int vg_test_timing_active (void);
162 int vg_test_vertical_active (void);
163 int vg_wait_vertical_blank(void);
164 int vg_test_even_field(void);
165 int vg_configure_line_interrupt (VG_INTERRUPT_PARAMS
*interrupt_info
);
166 unsigned long vg_test_and_clear_interrupt (void);
167 unsigned long vg_test_flip_status (void);
168 int vg_save_state (VG_SAVE_RESTORE
*vg_state
);
169 int vg_restore_state (VG_SAVE_RESTORE
*vg_state
);
171 /*----------------------------------------*/
172 /* VIDEO GENERATOR READ ROUTINES */
173 /*----------------------------------------*/
175 unsigned long vg_read_graphics_crc (int crc_source
);
176 unsigned long vg_read_window_crc (int crc_source
, unsigned long x
, unsigned long y
,
177 unsigned long width
, unsigned long height
);
178 int vg_get_scaler_filter_coefficients (long h_taps
[][5], long v_taps
[][3]);
179 int vg_get_flicker_filter_configuration (unsigned long *strength
, int *flicker_alpha
);
180 unsigned long vg_get_display_pitch (void);
181 unsigned long vg_get_frame_buffer_line_size (void);
182 unsigned long vg_get_current_vline (void);
183 unsigned long vg_get_display_offset (void);
184 int vg_get_cursor_info (VG_CURSOR_DATA
*cursor_data
);
185 int vg_get_display_palette_entry (unsigned long index
, unsigned long *entry
);
186 unsigned long vg_get_border_color (void);
187 int vg_get_display_palette (unsigned long *palette
);
188 int vg_get_compression_info (VG_COMPRESSION_DATA
*comp_data
);
189 int vg_get_compression_enable (void);
190 int vg_get_valid_bit (int line
);
192 /*----------------------------------------*/
193 /* DISPLAY FILTER ROUTINE DEFINITIONS */
194 /*----------------------------------------*/
196 int df_set_crt_enable (int crt_output
);
197 int df_set_panel_enable (int panel_output
);
198 int df_configure_video_source (DF_VIDEO_SOURCE_PARAMS
*video_source_odd
,
199 DF_VIDEO_SOURCE_PARAMS
*video_source_even
);
200 int df_set_video_offsets (int even
, unsigned long y_offset
,
201 unsigned long u_offset
, unsigned long v_offset
);
202 int df_set_video_scale (unsigned long src_width
, unsigned long src_height
,
203 unsigned long dst_width
, unsigned long dst_height
, unsigned long flags
);
204 int df_set_video_position (DF_VIDEO_POSITION
*video_window
);
205 int df_set_video_filter_coefficients (long taps
[][4], int phase256
);
206 int df_set_video_enable (int enable
, unsigned long flags
);
207 int df_set_video_color_key (unsigned long key
, unsigned long mask
, int graphics
);
208 int df_set_video_palette (unsigned long *palette
);
209 int df_set_video_palette_entry (unsigned long index
, unsigned long palette
);
210 int df_configure_video_cursor_color_key (DF_VIDEO_CURSOR_PARAMS
*cursor_color_key
);
211 int df_set_video_cursor_color_key_enable (int enable
);
212 int df_configure_alpha_window (int window
, DF_ALPHA_REGION_PARAMS
*alpha_data
);
213 int df_set_alpha_window_enable (int window
, int enable
);
214 int df_set_no_ck_outside_alpha (int enable
);
215 int df_set_video_request (unsigned long x
, unsigned long y
);
216 int df_set_output_color_space (int color_space
);
217 int df_set_output_path (int format
);
218 unsigned long df_test_video_flip_status (void);
219 int df_save_state (DF_SAVE_RESTORE
*gp_state
);
220 int df_restore_state (DF_SAVE_RESTORE
*gp_state
);
222 /*----------------------------------------*/
223 /* DISPLAY FILTER READ ROUTINES */
224 /*----------------------------------------*/
226 unsigned long df_read_composite_crc (int crc_source
);
227 unsigned long df_read_composite_window_crc (unsigned long x
, unsigned long y
,
228 unsigned long width
, unsigned long height
, int source
);
229 unsigned long df_read_panel_crc (void);
230 int df_get_video_enable (int *enable
, unsigned long *flags
);
231 int df_get_video_source_configuration (DF_VIDEO_SOURCE_PARAMS
*video_source_odd
,
232 DF_VIDEO_SOURCE_PARAMS
*video_source_even
);
233 int df_get_video_position (DF_VIDEO_POSITION
*video_window
);
234 int df_get_video_scale (unsigned long *x_scale
, unsigned long *y_scale
);
235 int df_get_video_filter_coefficients (long taps
[][4], int *phase256
);
236 int df_get_video_color_key (unsigned long *key
, unsigned long *mask
, int *graphics
);
237 int df_get_video_palette_entry(unsigned long index
, unsigned long *palette
);
238 int df_get_video_palette (unsigned long *palette
);
239 int df_get_video_cursor_color_key (DF_VIDEO_CURSOR_PARAMS
*cursor_color_key
);
240 int df_get_video_cursor_color_key_enable (void);
241 int df_get_alpha_window_configuration (int window
, DF_ALPHA_REGION_PARAMS
*alpha_data
);
242 int df_get_alpha_window_enable (int window
);
243 int df_get_video_request (unsigned long *x
, unsigned long *y
);
244 int df_get_output_color_space (int *color_space
);
246 /*----------------------------------------*/
247 /* MSR ROUTINE DEFINITIONS */
248 /*----------------------------------------*/
250 int msr_init_table (void);
251 int msr_create_geodelink_table (GEODELINK_NODE
*gliu_nodes
);
252 int msr_create_device_list (GEODELINK_NODE
*gliu_nodes
, int max_devices
);
253 int msr_read64 (unsigned long device
, unsigned long msr_register
,
255 int msr_write64 (unsigned long device
, unsigned long msr_register
,
258 /*----------------------------------------*/
259 /* VIP ROUTINE DEFINITIONS */
260 /*----------------------------------------*/
262 int vip_initialize (VIPSETMODEBUFFER
*buffer
);
263 int vip_update_601_params (VIP_601PARAMS
*buffer
);
264 int vip_terminate (void);
265 int vip_configure_capture_buffers (int buffer_type
, VIPINPUTBUFFER
*buffer
);
266 int vip_toggle_video_offsets (int buffer_type
, VIPINPUTBUFFER
*buffer
);
267 int vip_max_address_enable (unsigned long max_address
, int enable
);
268 int vip_set_interrupt_enable (unsigned long mask
, int enable
);
269 unsigned long vip_get_interrupt_state (void);
270 int vip_set_capture_state (unsigned long state
);
271 int vip_set_vsync_error (unsigned long vertical_count
, unsigned long window_before
,
272 unsigned long window_after
, int enable
);
273 int vip_configure_fifo (unsigned long fifo_type
, unsigned long fifo_size
);
274 int vip_set_loopback_enable (int bEnable
);
275 int vip_configure_genlock (VIPGENLOCKBUFFER
*buffer
);
276 int vip_set_genlock_enable (int bEnable
);
277 int vip_configure_pages (int page_count
, unsigned long page_offset
);
278 int vip_set_interrupt_line (int line
);
279 int vip_reset (void);
280 int vip_set_subwindow_enable (VIPSUBWINDOWBUFFER
*buffer
);
281 int vip_reset_interrupt_state (unsigned long interrupt_mask
);
283 int vip_save_state(VIPSTATEBUFFER
*save_buffer
);
284 int vip_restore_state(VIPSTATEBUFFER
*restore_buffer
);
285 int vip_set_power_characteristics (VIPPOWERBUFFER
*buffer
);
286 int vip_set_priority_characteristics (VIPPRIORITYBUFFER
*buffer
);
287 int vip_set_debug_characteristics (VIPDEBUGBUFFER
*buffer
);
288 int vip_test_genlock_active (void);
289 int vip_test_signal_status (void);
290 unsigned long vip_get_current_field (void);
292 /*----------------------------------------*/
293 /* VIP READ ROUTINES */
294 /*----------------------------------------*/
296 int vip_get_current_mode (VIPSETMODEBUFFER
*buffer
);
297 int vip_get_601_configuration (VIP_601PARAMS
*buffer
);
298 int vip_get_buffer_configuration (int buffer_type
, VIPINPUTBUFFER
*buffer
);
299 int vip_get_genlock_configuration (VIPGENLOCKBUFFER
*buffer
);
300 int vip_get_genlock_enable (void);
301 int vip_is_buffer_update_latched (void);
302 unsigned long vip_get_capture_state (void);
303 unsigned long vip_get_current_line (void);
304 unsigned long vip_read_fifo (unsigned long fifo_address
);
305 int vip_write_fifo (unsigned long fifo_address
, unsigned long fifo_data
);
306 int vip_enable_fifo_access (int enable
);
307 int vip_get_capability_characteristics (VIPCAPABILITIESBUFFER
*buffer
);
308 int vip_get_power_characteristics (VIPPOWERBUFFER
*buffer
);
309 int vip_get_priority_characteristics (VIPPRIORITYBUFFER
*buffer
);
311 /*----------------------------------------*/
312 /* VOP ROUTINE DEFINITIONS */
313 /*----------------------------------------*/
315 int vop_set_vbi_window (VOPVBIWINDOWBUFFER
*buffer
);
316 int vop_enable_vbi_output (int enable
);
317 int vop_set_configuration (VOPCONFIGURATIONBUFFER
*config
);
318 int vop_save_state(VOPSTATEBUFFER
*save_buffer
);
319 int vop_restore_state(VOPSTATEBUFFER
*save_buffer
);
321 /*----------------------------------------*/
322 /* VOP READ ROUTINES */
323 /*----------------------------------------*/
325 int vop_get_current_mode (VOPCONFIGURATIONBUFFER
*config
);
326 int vop_get_vbi_configuration (VOPVBIWINDOWBUFFER
*buffer
);
327 int vop_get_vbi_enable (void);
328 unsigned long vop_get_crc (void);
329 unsigned long vop_read_vbi_crc(void);
331 /* CLOSE BRACKET FOR C++ COMPLILATION */