comparison vidix/drivers/mach64_vid.c @ 5792:d2aec12937f8

reading pll in 32-bit instead of 8-bit +1, +2
author michael
date Tue, 23 Apr 2002 01:31:01 +0000
parents 56983ecb89aa
children 52818222a8be
comparison
equal deleted inserted replaced
5791:b584598afac9 5792:d2aec12937f8
145 static __inline__ uint32_t INPLL(uint32_t addr) 145 static __inline__ uint32_t INPLL(uint32_t addr)
146 { 146 {
147 uint32_t res; 147 uint32_t res;
148 uint32_t in; 148 uint32_t in;
149 149
150 /* preserve unknown bits */ 150 in= INREG(CLOCK_CNTL);
151 in= INREG8(CLOCK_CNTL + 1); 151 in &= ~((PLL_WR_EN | PLL_ADDR)); //clean some stuff
152 if(__verbose>0)printf("[mach64] pll: %X\n", in); 152 OUTREG(CLOCK_CNTL, in | (addr<<10));
153 in &= ~((PLL_WR_EN | PLL_ADDR)>>8); //clean some stuff
154 153
155 /* write addr byte */
156 OUTREG8(CLOCK_CNTL + 1, in | (addr << 2));
157 /* read the register value */ 154 /* read the register value */
158 res = INREG8(CLOCK_CNTL + 2); 155 res = (INREG(CLOCK_CNTL)>>16)&0xFF;
159 return res; 156 return res;
160 } 157 }
161 158
162 static __inline__ void OUTPLL(uint32_t addr,uint32_t val) 159 static __inline__ void OUTPLL(uint32_t addr,uint32_t val)
163 { 160 {
161 //FIXME buggy but its not used
164 /* write addr byte */ 162 /* write addr byte */
165 OUTREG8(CLOCK_CNTL + 1, (addr << 2) | PLL_WR_EN); 163 OUTREG8(CLOCK_CNTL + 1, (addr << 2) | PLL_WR_EN);
166 /* write the register value */ 164 /* write the register value */
167 OUTREG(CLOCK_CNTL + 2, val); 165 OUTREG(CLOCK_CNTL + 2, val);
168 OUTREG8(CLOCK_CNTL + 1, (addr << 2) & ~PLL_WR_EN); 166 OUTREG8(CLOCK_CNTL + 1, (addr << 2) & ~PLL_WR_EN);
735 } 733 }
736 dest_w = config->dest.w; 734 dest_w = config->dest.w;
737 dest_h = config->dest.h; 735 dest_h = config->dest.h;
738 besr.fourcc = config->fourcc; 736 besr.fourcc = config->fourcc;
739 ecp = (INPLL(PLL_VCLK_CNTL) & PLL_ECP_DIV) >> 4; 737 ecp = (INPLL(PLL_VCLK_CNTL) & PLL_ECP_DIV) >> 4;
738 #if 0
739 {
740 int i;
741 for(i=0; i<32; i++){
742 printf("%X ", INPLL(i));
743 }
744 }
745 #endif
740 if(__verbose>0) printf("[mach64] ecp: %d\n", ecp); 746 if(__verbose>0) printf("[mach64] ecp: %d\n", ecp);
741 v_inc = src_h * mach64_get_vert_stretch(); 747 v_inc = src_h * mach64_get_vert_stretch();
742 748
743 if(mach64_is_interlace()) v_inc<<=1; 749 if(mach64_is_interlace()) v_inc<<=1;
744 if(mach64_is_dbl_scan() ) v_inc>>=1; 750 if(mach64_is_dbl_scan() ) v_inc>>=1;