1 /* general card functions */ 2 status_t nv_general_powerup(void); 3 status_t nv_set_cas_latency(void); 4 void setup_virtualized_heads(bool); 5 void set_crtc_owner(bool); 6 status_t nv_general_output_select(bool); 7 status_t nv_general_head_select(bool); 8 status_t nv_general_wait_retrace(void); 9 status_t nv_general_validate_pic_size (display_mode *target, uint32 *bytes_per_row, bool *acc_mode); 10 11 /* AGP functions */ 12 status_t nv_agp_setup(void); 13 14 /* apsed: logging macros */ 15 #define MSG(args) do { /* if needed or si->settings with si NULL */ \ 16 nv_log args; \ 17 } while (0) 18 #define LOG(level_bit, args) do { \ 19 uint32 mod = (si->settings.logmask & 0xfffffff0) & MODULE_BIT; \ 20 uint32 lev = (si->settings.logmask & ~0xfffffff0) & level_bit; \ 21 if (mod && lev) nv_log args; \ 22 } while (0) 23 24 /* support functions */ 25 void delay(bigtime_t i); 26 void nv_log(char *format, ...); 27 28 /* i2c functions */ 29 int i2c_maven_read(unsigned char address); 30 void i2c_maven_write(unsigned char address, unsigned char data); 31 status_t i2c_init(void); 32 status_t i2c_maven_probe(void); 33 34 /* card info functions */ 35 status_t parse_pins(void); 36 void get_panel_modes(display_mode *p1, display_mode *p2, bool *pan1, bool *pan2); 37 void fake_panel_start(void); 38 void set_specs(void); 39 void dump_pins(void); 40 41 /* DAC functions */ 42 bool nv_dac_crt_connected(void); 43 status_t nv_dac_mode(int,float); 44 status_t nv_dac_palette(uint8*,uint8*,uint8*); 45 status_t nv_dac_pix_pll_find(display_mode target,float * result,uint8 *,uint8 *,uint8 *, uint8); 46 status_t nv_dac_set_pix_pll(display_mode target); 47 status_t nv_dac_sys_pll_find(float, float*, uint8*, uint8*, uint8*, uint8); 48 49 /* DAC2 functions */ 50 bool nv_dac2_crt_connected(void); 51 status_t nv_dac2_mode(int,float); 52 status_t nv_dac2_palette(uint8*,uint8*,uint8*); 53 status_t nv_dac2_pix_pll_find(display_mode target,float * result,uint8 *,uint8 *,uint8 *, uint8); 54 status_t nv_dac2_set_pix_pll(display_mode target); 55 56 /*MAVENTV functions*/ 57 status_t g100_g400max_maventv_vid_pll_find( 58 display_mode target, unsigned int * ht_new, unsigned int * ht_last_line, 59 uint8 * m_result, uint8 * n_result, uint8 * p_result); 60 int maventv_init(display_mode target); 61 62 /* CRTC1 functions */ 63 status_t nv_crtc_validate_timing( 64 uint16 *hd_e,uint16 *hs_s,uint16 *hs_e,uint16 *ht, 65 uint16 *vd_e,uint16 *vs_s,uint16 *vs_e,uint16 *vt 66 ); 67 status_t nv_crtc_set_timing(display_mode target); 68 status_t nv_crtc_depth(int mode); 69 status_t nv_crtc_set_display_start(uint32 startadd,uint8 bpp); 70 status_t nv_crtc_set_display_pitch(void); 71 72 status_t nv_crtc_dpms(bool, bool, bool); 73 status_t nv_crtc_dpms_fetch(bool*, bool*, bool*); 74 status_t nv_crtc_mem_priority(uint8); 75 76 status_t nv_crtc_cursor_init(void); /*Yes, cursor follows CRTC1 - not the DAC!*/ 77 status_t nv_crtc_cursor_define(uint8*,uint8*); 78 status_t nv_crtc_cursor_position(uint16 x ,uint16 y); 79 status_t nv_crtc_cursor_show(void); 80 status_t nv_crtc_cursor_hide(void); 81 82 /* CRTC2 functions */ 83 status_t nv_crtc2_validate_timing( 84 uint16 *hd_e,uint16 *hs_s,uint16 *hs_e,uint16 *ht, 85 uint16 *vd_e,uint16 *vs_s,uint16 *vs_e,uint16 *vt 86 ); 87 status_t nv_crtc2_set_timing(display_mode target); 88 status_t nv_crtc2_depth(int mode); 89 status_t nv_crtc2_set_display_start(uint32 startadd,uint8 bpp); 90 status_t nv_crtc2_set_display_pitch(void); 91 92 status_t nv_crtc2_dpms(bool, bool, bool); 93 status_t nv_crtc2_dpms_fetch(bool*, bool*, bool*); 94 status_t nv_crtc2_mem_priority(uint8); 95 96 status_t nv_crtc2_cursor_init(void); 97 status_t nv_crtc2_cursor_define(uint8*,uint8*); 98 status_t nv_crtc2_cursor_position(uint16 x ,uint16 y); 99 status_t nv_crtc2_cursor_show(void); 100 status_t nv_crtc2_cursor_hide(void); 101 102 /* acceleration functions */ 103 status_t check_acc_capability(uint32 feature); 104 status_t nv_acc_init(void); 105 status_t nv_acc_setup_blit(void); 106 status_t nv_acc_blit(uint16,uint16,uint16, uint16,uint16,uint16 ); 107 status_t nv_acc_setup_rectangle(uint32 color); 108 status_t nv_acc_rectangle(uint32 xs,uint32 xe,uint32 ys,uint32 yl); 109 status_t nv_acc_setup_rect_invert(void); 110 status_t nv_acc_rectangle_invert(uint32 xs,uint32 xe,uint32 ys,uint32 yl); 111 status_t nv_acc_transparent_blit(uint16,uint16,uint16, uint16,uint16,uint16, uint32); 112 status_t nv_acc_video_blit(uint16 xs,uint16 ys,uint16 ws, uint16 hs, 113 uint16 xd,uint16 yd,uint16 wd,uint16 hd); 114 status_t nv_acc_wait_idle(void); 115 116 /* backend scaler functions */ 117 status_t check_overlay_capability(uint32 feature); 118 void nv_bes_move_overlay(void); 119 status_t nv_bes_to_crtc(bool crtc); 120 status_t nv_bes_init(void); 121 status_t nv_configure_bes 122 (const overlay_buffer *ob, const overlay_window *ow,const overlay_view *ov, int offset); 123 status_t nv_release_bes(void); 124 125 /* I2C functions */ 126 status_t i2c_sec_tv_adapter(void); 127 128 /* driver structures and enums */ 129 enum{BPP8 = 0, BPP15 = 1, BPP16 = 2, BPP24 = 3, BPP32 = 4}; 130 enum{DS_CRTC1DAC_CRTC2MAVEN, DS_CRTC1MAVEN_CRTC2DAC, DS_CRTC1CON1_CRTC2CON2, DS_CRTC1CON2_CRTC2CON1}; 131