1/* Copyright (c) 2005 Advanced Micro Devices, Inc. 2 * 3 * Permission is hereby granted, free of charge, to any person obtaining a copy 4 * of this software and associated documentation files (the "Software"), to 5 * deal in the Software without restriction, including without limitation the 6 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 * sell copies of the Software, and to permit persons to whom the Software is 8 * furnished to do so, subject to the following conditions: 9 * 10 * The above copyright notice and this permission notice shall be included in 11 * all copies or substantial portions of the Software. 12 * 13 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 * IN THE SOFTWARE. 20 * 21 * Neither the name of the Advanced Micro Devices, Inc. nor the names of its 22 * contributors may be used to endorse or promote products derived from this 23 * software without specific prior written permission. 24 * */ 25 26/* 27 * This header file defines the Durango routines and variables used 28 * to access the memory mapped regions. 29 * */ 30 31#ifndef _gfx_rtns_h 32#define _gfx_rtns_h 33 34/* INCLUDE DURANGO DEFINITIONS */ 35/* These definitions are placed in another file to allow their inclusion 36 * in a user application. Such applications generally work through driver 37 * shell routines that simply pass their parameters to Durango routines. 38 * An external file provides an easy way to provide the definitions for these 39 * parameters without the applications gaining any Durango visisbility. 40 * */ 41 42#include "gfx_type.h" 43 44/* COMPILER OPTION FOR C++ PROGRAMS */ 45 46#ifdef __cplusplus 47extern "C" { 48#endif 49 50/* DURANGO MEMORY POINTERS */ 51 52 extern unsigned char *gfx_virt_regptr; 53 extern unsigned char *gfx_virt_fbptr; 54 extern unsigned char *gfx_virt_vidptr; 55 extern unsigned char *gfx_virt_vipptr; 56 extern unsigned char *gfx_virt_spptr; 57 extern unsigned char *gfx_virt_gpptr; 58 59 extern unsigned char *gfx_phys_regptr; 60 extern unsigned char *gfx_phys_fbptr; 61 extern unsigned char *gfx_phys_vidptr; 62 extern unsigned char *gfx_phys_vipptr; 63 extern unsigned char *gfx_phys_spptr; 64 extern unsigned char *gfx_phys_gpptr; 65 66/* DURANGO VARIABLES FOR RUNTIME SELECTION AND POSSIBLE VALUES */ 67 68 extern int gfx_display_type; 69#define GFX_DISPLAY_TYPE_GU1 0x0001 70#define GFX_DISPLAY_TYPE_GU2 0x0002 71 72 extern int gfx_init_type; 73#define GFX_INIT_TYPE_GU1 0x0001 74#define GFX_INIT_TYPE_GU2 0x0002 75 76 extern int gfx_msr_type; 77#define GFX_MSR_TYPE_REDCLOUD 0x0001 78 79 extern int gfx_2daccel_type; 80#define GFX_2DACCEL_TYPE_GU1 0x0001 81#define GFX_2DACCEL_TYPE_GU2 0x0002 82 83 extern int gfx_video_type; 84#define GFX_VIDEO_TYPE_CS5530 0x0001 85#define GFX_VIDEO_TYPE_SC1200 0x0002 86#define GFX_VIDEO_TYPE_REDCLOUD 0x0004 87 88 extern int gfx_vip_type; 89#define GFX_VIP_TYPE_SC1200 0x0001 90 91 extern int gfx_decoder_type; 92#define GFX_DECODER_TYPE_SAA7114 0x0001 93 94 extern int gfx_tv_type; 95#define GFX_TV_TYPE_SC1200 0x0001 96#define GFX_TV_TYPE_FS451 0x0002 97 98 extern int gfx_i2c_type; 99#define GFX_I2C_TYPE_ACCESS 0x0001 100#define GFX_I2C_TYPE_GPIO 0x0002 101 102/* GLOBAL CPU INFORMATION */ 103 104 extern unsigned long gfx_cpu_version; 105 extern unsigned long gfx_cpu_frequency; 106 extern unsigned long gfx_vid_version; 107 extern ChipType gfx_chip_revision; 108 109/* ROUTINES IN GFX_INIT.C */ 110 111 unsigned long gfx_pci_config_read(unsigned long address); 112 void gfx_pci_config_write(unsigned long address, unsigned long data); 113 unsigned long gfx_get_core_freq(void); 114 unsigned long gfx_detect_cpu(void); 115 unsigned long gfx_detect_video(void); 116 unsigned long gfx_get_cpu_register_base(void); 117 unsigned long gfx_get_graphics_register_base(void); 118 unsigned long gfx_get_frame_buffer_base(void); 119 unsigned long gfx_get_frame_buffer_size(void); 120 unsigned long gfx_get_vid_register_base(void); 121 unsigned long gfx_get_vip_register_base(void); 122 123/* ROUTINES IN GFX_MSR.C */ 124 125 int gfx_msr_init(void); 126 DEV_STATUS gfx_id_msr_device(MSR * pDev, unsigned long address); 127 DEV_STATUS gfx_get_msr_dev_address(unsigned int device, 128 unsigned long *address); 129 DEV_STATUS gfx_get_glink_id_at_address(unsigned int *device, 130 unsigned long address); 131 DEV_STATUS gfx_msr_read(unsigned int device, unsigned int msrRegister, 132 Q_WORD * msrValue); 133 DEV_STATUS gfx_msr_write(unsigned int device, unsigned int msrRegister, 134 Q_WORD * msrValue); 135 136/* ROUTINES IN GFX_DISP.C */ 137 138 int gfx_set_display_bpp(unsigned short bpp); 139 int gfx_is_display_mode_supported(int xres, int yres, int bpp, int hz); 140 int gfx_set_display_mode(int xres, int yres, int bpp, int hz); 141 int gfx_set_display_timings(unsigned short bpp, unsigned short flags, 142 unsigned short hactive, 143 unsigned short hblank_start, 144 unsigned short hsync_start, 145 unsigned short hsync_end, 146 unsigned short hblank_end, 147 unsigned short htotal, unsigned short vactive, 148 unsigned short vblank_start, 149 unsigned short vsync_start, 150 unsigned short vsync_end, 151 unsigned short vblank_end, 152 unsigned short vtotal, unsigned long frequency); 153 int gfx_set_vtotal(unsigned short vtotal); 154 void gfx_set_display_pitch(unsigned short pitch); 155 void gfx_set_display_offset(unsigned long offset); 156 int gfx_set_display_palette_entry(unsigned long index, 157 unsigned long palette); 158 int gfx_set_display_palette(unsigned long *palette); 159 void gfx_video_shutdown(void); 160 void gfx_set_clock_frequency(unsigned long frequency); 161 int gfx_set_crt_enable(int enable); 162 void gfx_set_cursor_enable(int enable); 163 void gfx_set_cursor_colors(unsigned long bkcolor, unsigned long fgcolor); 164 void gfx_set_cursor_position(unsigned long memoffset, 165 unsigned short xpos, unsigned short ypos, 166 unsigned short xhotspot, 167 unsigned short yhotspot); 168 void gfx_set_cursor_shape32(unsigned long memoffset, unsigned long *andmask, 169 unsigned long *xormask); 170 void gfx_set_cursor_shape64(unsigned long memoffset, unsigned long *andmask, 171 unsigned long *xormask); 172 void gfx_set_icon_enable(int enable); 173 void gfx_set_icon_colors(unsigned long color0, unsigned long color1, 174 unsigned long color2); 175 void gfx_set_icon_position(unsigned long memoffset, unsigned short xpos); 176 void gfx_set_icon_shape64(unsigned long memoffset, unsigned long *andmask, 177 unsigned long *xormask, unsigned int lines); 178 179 int gfx_set_compression_enable(int enable); 180 int gfx_set_compression_offset(unsigned long offset); 181 int gfx_set_compression_pitch(unsigned short pitch); 182 int gfx_set_compression_size(unsigned short size); 183 void gfx_set_display_priority_high(int enable); 184 int gfx_test_timing_active(void); 185 int gfx_test_vertical_active(void); 186 int gfx_wait_vertical_blank(void); 187 void gfx_delay_milliseconds(unsigned long milliseconds); 188 void gfx_delay_microseconds(unsigned long microseconds); 189 void gfx_enable_panning(int x, int y); 190 int gfx_is_panel_mode_supported(int panelResX, int panelResY, 191 unsigned short width, unsigned short height, 192 unsigned short bpp); 193 int gfx_set_fixed_timings(int panelResX, int panelResY, 194 unsigned short width, unsigned short height, 195 unsigned short bpp); 196 int gfx_set_panel_present(int panelResX, int panelResY, 197 unsigned short width, unsigned short height, 198 unsigned short bpp); 199 void gfx_reset_timing_lock(void); 200 201/* "READ" ROUTINES IN GFX_DISP.C */ 202 203 int gfx_get_display_details(unsigned int mode, int *xres, int *yres, 204 int *hz); 205 unsigned short gfx_get_display_pitch(void); 206 int gfx_get_vsa2_softvga_enable(void); 207 int gfx_get_sync_polarities(void); 208 unsigned long gfx_get_clock_frequency(void); 209 unsigned long gfx_get_max_supported_pixel_clock(void); 210 int gfx_mode_frequency_supported(int xres, int yres, int bpp, 211 unsigned long frequency); 212 int gfx_get_refreshrate_from_frequency(int xres, int yres, int bpp, 213 int *hz, unsigned long frequency); 214 int gfx_get_refreshrate_from_mode(int xres, int yres, int bpp, int *hz, 215 unsigned long frequency); 216 int gfx_get_frequency_from_refreshrate(int xres, int yres, int bpp, 217 int hz, int *frequency); 218 int gfx_get_display_mode_count(void); 219 int gfx_get_display_mode(int *xres, int *yres, int *bpp, int *hz); 220 unsigned long gfx_get_frame_buffer_line_size(void); 221 unsigned short gfx_get_hactive(void); 222 unsigned short gfx_get_hblank_start(void); 223 unsigned short gfx_get_hsync_start(void); 224 unsigned short gfx_get_hsync_end(void); 225 unsigned short gfx_get_hblank_end(void); 226 unsigned short gfx_get_htotal(void); 227 unsigned short gfx_get_vactive(void); 228 unsigned short gfx_get_vline(void); 229 unsigned short gfx_get_vblank_start(void); 230 unsigned short gfx_get_vsync_start(void); 231 unsigned short gfx_get_vsync_end(void); 232 unsigned short gfx_get_vblank_end(void); 233 unsigned short gfx_get_vtotal(void); 234 unsigned short gfx_get_display_bpp(void); 235 unsigned long gfx_get_display_offset(void); 236 int gfx_get_display_palette_entry(unsigned long index, 237 unsigned long *palette); 238 void gfx_get_display_palette(unsigned long *palette); 239 unsigned long gfx_get_cursor_enable(void); 240 unsigned long gfx_get_cursor_offset(void); 241 unsigned long gfx_get_cursor_position(void); 242 unsigned long gfx_get_cursor_clip(void); 243 unsigned long gfx_get_cursor_color(int color); 244 unsigned long gfx_get_icon_enable(void); 245 unsigned long gfx_get_icon_offset(void); 246 unsigned long gfx_get_icon_position(void); 247 unsigned long gfx_get_icon_color(int color); 248 int gfx_get_compression_enable(void); 249 unsigned long gfx_get_compression_offset(void); 250 unsigned short gfx_get_compression_pitch(void); 251 unsigned short gfx_get_compression_size(void); 252 int gfx_get_display_priority_high(void); 253 int gfx_get_valid_bit(int line); 254 255/* ROUTINES IN GFX_RNDR.C */ 256 257 void gfx_set_bpp(unsigned short bpp); 258 void gfx_set_solid_pattern(unsigned long color); 259 void gfx_set_mono_pattern(unsigned long bgcolor, unsigned long fgcolor, 260 unsigned long data0, unsigned long data1, 261 unsigned char transparency); 262 void gfx_set_color_pattern(unsigned long bgcolor, unsigned long fgcolor, 263 unsigned long data0, unsigned long data1, 264 unsigned long data2, unsigned long data3, 265 unsigned char transparency); 266 void gfx_load_color_pattern_line(short y, unsigned long *pattern_8x8); 267 void gfx_set_solid_source(unsigned long color); 268 void gfx_set_mono_source(unsigned long bgcolor, unsigned long fgcolor, 269 unsigned short transparent); 270 void gfx_set_pattern_flags(unsigned short flags); 271 void gfx_set_raster_operation(unsigned char rop); 272 void gfx_pattern_fill(unsigned short x, unsigned short y, 273 unsigned short width, unsigned short height); 274 void gfx_color_pattern_fill(unsigned short x, unsigned short y, 275 unsigned short width, unsigned short height, 276 unsigned long *pattern); 277 void gfx_screen_to_screen_blt(unsigned short srcx, unsigned short srcy, 278 unsigned short dstx, unsigned short dsty, 279 unsigned short width, unsigned short height); 280 void gfx_screen_to_screen_xblt(unsigned short srcx, unsigned short srcy, 281 unsigned short dstx, unsigned short dsty, 282 unsigned short width, unsigned short height, 283 unsigned long color); 284 void gfx_color_bitmap_to_screen_blt(unsigned short srcx, 285 unsigned short srcy, 286 unsigned short dstx, 287 unsigned short dsty, 288 unsigned short width, 289 unsigned short height, 290 unsigned char *data, long pitch); 291 void gfx_color_bitmap_to_screen_xblt(unsigned short srcx, 292 unsigned short srcy, 293 unsigned short dstx, 294 unsigned short dsty, 295 unsigned short width, 296 unsigned short height, 297 unsigned char *data, long pitch, 298 unsigned long color); 299 void gfx_mono_bitmap_to_screen_blt(unsigned short srcx, unsigned short srcy, 300 unsigned short dstx, unsigned short dsty, 301 unsigned short width, 302 unsigned short height, 303 unsigned char *data, short pitch); 304 void gfx_text_blt(unsigned short dstx, unsigned short dsty, 305 unsigned short width, unsigned short height, 306 unsigned char *data); 307 void gfx_bresenham_line(unsigned short x, unsigned short y, 308 unsigned short length, unsigned short initerr, 309 unsigned short axialerr, unsigned short diagerr, 310 unsigned short flags); 311 void gfx_wait_until_idle(void); 312 int gfx_test_blt_pending(void); 313 314/* SECOND GENERATION RENDERING ROUTINES */ 315 316 void gfx2_set_source_stride(unsigned short stride); 317 void gfx2_set_destination_stride(unsigned short stride); 318 void gfx2_set_pattern_origin(int x, int y); 319 void gfx2_set_source_transparency(unsigned long color, unsigned long mask); 320 void gfx2_set_alpha_mode(int mode); 321 void gfx2_set_alpha_value(unsigned char value); 322 void gfx2_pattern_fill(unsigned long dstoffset, unsigned short width, 323 unsigned short height); 324 void gfx2_color_pattern_fill(unsigned long dstoffset, 325 unsigned short width, unsigned short height, 326 unsigned long *pattern); 327 void gfx2_screen_to_screen_blt(unsigned long srcoffset, 328 unsigned long dstoffset, 329 unsigned short width, unsigned short height, 330 int flags); 331 void gfx2_mono_expand_blt(unsigned long srcbase, unsigned short srcx, 332 unsigned short srcy, unsigned long dstoffset, 333 unsigned short width, unsigned short height, 334 int byte_packed); 335 void gfx2_color_bitmap_to_screen_blt(unsigned short srcx, 336 unsigned short srcy, 337 unsigned long dstoffset, 338 unsigned short width, 339 unsigned short height, 340 unsigned char *data, short pitch); 341 void gfx2_mono_bitmap_to_screen_blt(unsigned short srcx, 342 unsigned short srcy, 343 unsigned long dstoffset, 344 unsigned short width, 345 unsigned short height, 346 unsigned char *data, short pitch); 347 void gfx2_text_blt(unsigned long dstoffset, unsigned short width, 348 unsigned short height, unsigned char *data); 349 void gfx2_bresenham_line(unsigned long dstoffset, unsigned short length, 350 unsigned short initerr, unsigned short axialerr, 351 unsigned short diagerr, unsigned short flags); 352 void gfx2_sync_to_vblank(void); 353 354/* ROUTINES IN GFX_VID.C */ 355 356 int gfx_set_video_enable(int enable); 357 int gfx_set_video_format(unsigned long format); 358 int gfx_set_video_size(unsigned short width, unsigned short height); 359 int gfx_set_video_yuv_pitch(unsigned long ypitch, unsigned long uvpitch); 360 int gfx_set_video_offset(unsigned long offset); 361 int gfx_set_video_yuv_offsets(unsigned long yoffset, 362 unsigned long uoffset, unsigned long voffset); 363 int gfx_set_video_window(short x, short y, unsigned short w, 364 unsigned short h); 365 int gfx_set_video_left_crop(unsigned short x); 366 int gfx_set_video_upscale(unsigned short srcw, unsigned short srch, 367 unsigned short dstw, unsigned short dsth); 368 int gfx_set_video_scale(unsigned short srcw, unsigned short srch, 369 unsigned short dstw, unsigned short dsth); 370 int gfx_set_video_vertical_downscale(unsigned short srch, 371 unsigned short dsth); 372 void gfx_set_video_vertical_downscale_enable(int enable); 373 int gfx_set_video_downscale_config(unsigned short type, unsigned short m); 374 int gfx_set_video_color_key(unsigned long key, unsigned long mask, 375 int bluescreen); 376 int gfx_set_video_filter(int xfilter, int yfilter); 377 int gfx_set_video_palette(unsigned long *palette); 378 int gfx_set_graphics_palette(unsigned long *palette); 379 int gfx_set_video_palette_bypass(int enable); 380 int gfx_set_video_palette_entry(unsigned long index, unsigned long color); 381 int gfx_set_graphics_palette_entry(unsigned long index, 382 unsigned long color); 383 int gfx_set_video_downscale_coefficients(unsigned short coef1, 384 unsigned short coef2, 385 unsigned short coef3, 386 unsigned short coef4); 387 int gfx_set_video_downscale_enable(int enable); 388 int gfx_set_video_source(VideoSourceType source); 389 int gfx_set_vbi_source(VbiSourceType source); 390 int gfx_set_vbi_lines(unsigned long even, unsigned long odd); 391 int gfx_set_vbi_total(unsigned long even, unsigned long odd); 392 int gfx_set_video_interlaced(int enable); 393 int gfx_set_color_space_YUV(int enable); 394 int gfx_set_vertical_scaler_offset(char offset); 395 int gfx_set_top_line_in_odd(int enable); 396 int gfx_set_genlock_delay(unsigned long delay); 397 int gfx_set_genlock_enable(int flags); 398 int gfx_set_video_cursor(unsigned long key, unsigned long mask, 399 unsigned short select_color2, unsigned long color1, 400 unsigned long color2); 401 int gfx_set_video_cursor_enable(int enable); 402 int gfx_set_video_request(short x, short y); 403 404 int gfx_select_alpha_region(int region); 405 int gfx_set_alpha_enable(int enable); 406 int gfx_set_alpha_window(short x, short y, 407 unsigned short width, unsigned short height); 408 int gfx_set_alpha_value(unsigned char alpha, char delta); 409 int gfx_set_alpha_priority(int priority); 410 int gfx_set_alpha_color(unsigned long color); 411 int gfx_set_alpha_color_enable(int enable); 412 int gfx_set_no_ck_outside_alpha(int enable); 413 int gfx_disable_softvga(void); 414 int gfx_enable_softvga(void); 415 int gfx_set_macrovision_enable(int enable); 416 unsigned long gfx_get_max_video_width(void); 417 418/* READ ROUTINES IN GFX_VID.C */ 419 420 int gfx_get_video_enable(void); 421 int gfx_get_video_format(void); 422 unsigned long gfx_get_video_src_size(void); 423 unsigned long gfx_get_video_line_size(void); 424 unsigned long gfx_get_video_xclip(void); 425 unsigned long gfx_get_video_offset(void); 426 void gfx_get_video_yuv_offsets(unsigned long *yoffset, 427 unsigned long *uoffset, 428 unsigned long *voffset); 429 void gfx_get_video_yuv_pitch(unsigned long *ypitch, unsigned long *uvpitch); 430 unsigned long gfx_get_video_upscale(void); 431 unsigned long gfx_get_video_scale(void); 432 unsigned long gfx_get_video_downscale_delta(void); 433 int gfx_get_video_vertical_downscale_enable(void); 434 int gfx_get_video_downscale_config(unsigned short *type, unsigned short *m); 435 void gfx_get_video_downscale_coefficients(unsigned short *coef1, 436 unsigned short *coef2, 437 unsigned short *coef3, 438 unsigned short *coef4); 439 void gfx_get_video_downscale_enable(int *enable); 440 unsigned long gfx_get_video_dst_size(void); 441 unsigned long gfx_get_video_position(void); 442 unsigned long gfx_get_video_color_key(void); 443 unsigned long gfx_get_video_color_key_mask(void); 444 int gfx_get_video_palette_entry(unsigned long index, 445 unsigned long *palette); 446 int gfx_get_video_color_key_src(void); 447 int gfx_get_video_filter(void); 448 int gfx_get_video_request(short *x, short *y); 449 int gfx_get_video_source(VideoSourceType * source); 450 int gfx_get_vbi_source(VbiSourceType * source); 451 unsigned long gfx_get_vbi_lines(int odd); 452 unsigned long gfx_get_vbi_total(int odd); 453 int gfx_get_video_interlaced(void); 454 int gfx_get_color_space_YUV(void); 455 int gfx_get_vertical_scaler_offset(char *offset); 456 unsigned long gfx_get_genlock_delay(void); 457 int gfx_get_genlock_enable(void); 458 int gfx_get_video_cursor(unsigned long *key, unsigned long *mask, 459 unsigned short *select_color2, 460 unsigned long *color1, unsigned short *color2); 461 unsigned long gfx_read_crc(void); 462 unsigned long gfx_read_crc32(void); 463 unsigned long gfx_read_window_crc(int source, unsigned short x, 464 unsigned short y, unsigned short width, 465 unsigned short height, int crc32); 466 int gfx_get_macrovision_enable(void); 467 468 void gfx_get_alpha_enable(int *enable); 469 void gfx_get_alpha_size(unsigned short *x, unsigned short *y, 470 unsigned short *width, unsigned short *height); 471 void gfx_get_alpha_value(unsigned char *alpha, char *delta); 472 void gfx_get_alpha_priority(int *priority); 473 void gfx_get_alpha_color(unsigned long *color); 474 475/* ROUTINES IN GFX_VIP.C */ 476 477 int gfx_set_vip_enable(int enable); 478 int gfx_set_vip_capture_run_mode(int mode); 479 int gfx_set_vip_base(unsigned long even, unsigned long odd); 480 int gfx_set_vip_pitch(unsigned long pitch); 481 int gfx_set_vip_mode(int mode); 482 int gfx_set_vbi_enable(int enable); 483 int gfx_set_vbi_mode(int mode); 484 int gfx_set_vbi_base(unsigned long even, unsigned long odd); 485 int gfx_set_vbi_pitch(unsigned long pitch); 486 int gfx_set_vbi_direct(unsigned long even_lines, unsigned long odd_lines); 487 int gfx_set_vbi_interrupt(int enable); 488 int gfx_set_vip_bus_request_threshold_high(int enable); 489 int gfx_set_vip_last_line(int last_line); 490 int gfx_test_vip_odd_field(void); 491 int gfx_test_vip_bases_updated(void); 492 int gfx_test_vip_fifo_overflow(void); 493 int gfx_get_vip_line(void); 494 495/* READ ROUTINES IN GFX_VIP.C */ 496 497 int gfx_get_vip_enable(void); 498 unsigned long gfx_get_vip_base(int odd); 499 unsigned long gfx_get_vip_pitch(void); 500 int gfx_get_vip_mode(void); 501 int gfx_get_vbi_enable(void); 502 int gfx_get_vbi_mode(void); 503 unsigned long gfx_get_vbi_base(int odd); 504 unsigned long gfx_get_vbi_pitch(void); 505 unsigned long gfx_get_vbi_direct(int odd); 506 int gfx_get_vbi_interrupt(void); 507 int gfx_get_vip_bus_request_threshold_high(void); 508 509/* ROUTINES IN GFX_DCDR.C */ 510 511 int gfx_set_decoder_defaults(void); 512 int gfx_set_decoder_analog_input(unsigned char input); 513 int gfx_set_decoder_brightness(unsigned char brightness); 514 int gfx_set_decoder_contrast(unsigned char contrast); 515 int gfx_set_decoder_hue(char hue); 516 int gfx_set_decoder_saturation(unsigned char saturation); 517 int gfx_set_decoder_input_offset(unsigned short x, unsigned short y); 518 int gfx_set_decoder_input_size(unsigned short width, unsigned short height); 519 int gfx_set_decoder_output_size(unsigned short width, 520 unsigned short height); 521 int gfx_set_decoder_scale(unsigned short srcw, unsigned short srch, 522 unsigned short dstw, unsigned short dsth); 523 int gfx_set_decoder_vbi_format(int start, int end, int format); 524 int gfx_set_decoder_vbi_enable(int enable); 525 int gfx_set_decoder_vbi_upscale(void); 526 int gfx_set_decoder_TV_standard(TVStandardType TVStandard); 527 int gfx_set_decoder_luminance_filter(unsigned char lufi); 528 int gfx_decoder_software_reset(void); 529 int gfx_decoder_detect_macrovision(void); 530 int gfx_decoder_detect_video(void); 531 532/* READ ROUTINES IN GFX_DCDR.C */ 533 534 unsigned char gfx_get_decoder_brightness(void); 535 unsigned char gfx_get_decoder_contrast(void); 536 char gfx_get_decoder_hue(void); 537 unsigned char gfx_get_decoder_saturation(void); 538 unsigned long gfx_get_decoder_input_offset(void); 539 unsigned long gfx_get_decoder_input_size(void); 540 unsigned long gfx_get_decoder_output_size(void); 541 int gfx_get_decoder_vbi_format(int line); 542 543/* ROUTINES IN GFX_I2C.C */ 544 545 int gfx_i2c_reset(unsigned char busnum, short adr, char freq); 546 int gfx_i2c_write(unsigned char busnum, unsigned char chipadr, 547 unsigned char subadr, unsigned char bytes, 548 unsigned char *data); 549 int gfx_i2c_read(unsigned char busnum, unsigned char chipadr, 550 unsigned char subadr, unsigned char bytes, 551 unsigned char *data); 552 int gfx_i2c_select_gpio(int clock, int data); 553 int gfx_i2c_init(void); 554 void gfx_i2c_cleanup(void); 555 556/* ROUTINES IN GFX_TV.C */ 557 558 int gfx_set_tv_format(TVStandardType format, GfxOnTVType resolution); 559 int gfx_set_tv_output(int output); 560 int gfx_set_tv_enable(int enable); 561 int gfx_set_tv_flicker_filter(int ff); 562 int gfx_set_tv_sub_carrier_reset(int screset); 563 int gfx_set_tv_vphase(int vphase); 564 int gfx_set_tv_YC_delay(int delay); 565 int gfx_set_tvenc_reset_interval(int interval); 566 int gfx_set_tv_cc_enable(int enable); 567 int gfx_set_tv_cc_data(unsigned char data1, unsigned char data2); 568 int gfx_set_tv_display(int width, int height); 569 int gfx_test_tvout_odd_field(void); 570 int gfx_test_tvenc_odd_field(void); 571 int gfx_set_tv_field_status_invert(int enable); 572 int gfx_get_tv_vphase(void); 573 int gfx_get_tv_enable(unsigned int *p_on); 574 int gfx_get_tv_output(void); 575 int gfx_get_tv_mode_count(TVStandardType format); 576 int gfx_get_tv_display_mode(int *width, int *height, int *bpp, int *hz); 577 int gfx_get_tv_display_mode_frequency(unsigned short width, 578 unsigned short height, 579 TVStandardType format, 580 int *frequency); 581 int gfx_is_tv_display_mode_supported(unsigned short width, 582 unsigned short height, 583 TVStandardType format); 584 585 int gfx_get_tv_standard(unsigned long *p_standard); 586 int gfx_get_available_tv_standards(unsigned long *p_standards); 587 int gfx_set_tv_standard(unsigned long standard); 588 int gfx_get_tv_vga_mode(unsigned long *p_vga_mode); 589 int gfx_get_available_tv_vga_modes(unsigned long *p_vga_modes); 590 int gfx_set_tv_vga_mode(unsigned long vga_mode); 591 int gfx_get_tvout_mode(unsigned long *p_tvout_mode); 592 int gfx_set_tvout_mode(unsigned long tvout_mode); 593 int gfx_get_sharpness(int *p_sharpness); 594 int gfx_set_sharpness(int sharpness); 595 int gfx_get_flicker_filter(int *p_flicker); 596 int gfx_set_flicker_filter(int flicker); 597 int gfx_get_overscan(int *p_x, int *p_y); 598 int gfx_set_overscan(int x, int y); 599 int gfx_get_position(int *p_x, int *p_y); 600 int gfx_set_position(int x, int y); 601 int gfx_get_color(int *p_color); 602 int gfx_set_color(int color); 603 int gfx_get_brightness(int *p_brightness); 604 int gfx_set_brightness(int brightness); 605 int gfx_get_contrast(int *p_contrast); 606 int gfx_set_contrast(int contrast); 607 int gfx_get_yc_filter(unsigned int *p_yc_filter); 608 int gfx_set_yc_filter(unsigned int yc_filter); 609 int gfx_get_aps_trigger_bits(unsigned int *p_trigger_bits); 610 int gfx_set_aps_trigger_bits(unsigned int trigger_bits); 611 612/* ROUTINES IN GFX_VGA.C */ 613 614 int gfx_get_softvga_active(void); 615 int gfx_vga_test_pci(void); 616 unsigned char gfx_vga_get_pci_command(void); 617 int gfx_vga_set_pci_command(unsigned char command); 618 int gfx_vga_seq_reset(int reset); 619 int gfx_vga_set_graphics_bits(void); 620 int gfx_vga_mode(gfx_vga_struct * vga, int xres, int yres, int bpp, int hz); 621 int gfx_vga_pitch(gfx_vga_struct * vga, unsigned short pitch); 622 int gfx_vga_save(gfx_vga_struct * vga, int flags); 623 int gfx_vga_restore(gfx_vga_struct * vga, int flags); 624 int gfx_vga_mode_switch(int active); 625 void gfx_vga_clear_extended(void); 626 627/* CLOSE BRACKET FOR C++ COMPLILATION */ 628 629#ifdef __cplusplus 630} 631#endif 632#endif /* !_gfx_rtns_h */ 633/* END OF FILE */ 634