Mercurial > mplayer.hg
comparison vidix/drivers/mach64_vid.c @ 5574:bdfd4b72244a
fixing vertical scaling on non mobility cards, this might have overflowed into the horizontal stuff, so perhaps it fixes the horizontal stuff too
author | michael |
---|---|
date | Fri, 12 Apr 2002 12:29:12 +0000 |
parents | 51fcb1e5c96e |
children | 865c1fd6e0b0 |
comparison
equal
deleted
inserted
replaced
5573:b8a8ab95c73d | 5574:bdfd4b72244a |
---|---|
28 static int32_t mach64_overlay_offset = 0; | 28 static int32_t mach64_overlay_offset = 0; |
29 static uint32_t mach64_ram_size = 0; | 29 static uint32_t mach64_ram_size = 0; |
30 static uint32_t mach64_buffer_base[10][3]; | 30 static uint32_t mach64_buffer_base[10][3]; |
31 static int num_mach64_buffers=-1; | 31 static int num_mach64_buffers=-1; |
32 static int supports_planar=0; | 32 static int supports_planar=0; |
33 static int supports_lcd_v_stretch=0; | |
33 | 34 |
34 pciinfo_t pci_info; | 35 pciinfo_t pci_info; |
35 static int probed = 0; | 36 static int probed = 0; |
36 static int __verbose = 0; | 37 static int __verbose = 0; |
37 | 38 |
259 int vert_stretching; | 260 int vert_stretching; |
260 int ext_vert_stretch; | 261 int ext_vert_stretch; |
261 int ret; | 262 int ret; |
262 int yres= mach64_get_yres(); | 263 int yres= mach64_get_yres(); |
263 | 264 |
264 //FIXME check for mobility & co | 265 if(!supports_lcd_etch) return 1<<16; |
265 | 266 |
266 lcd_index= INREG(LCD_INDEX); | 267 lcd_index= INREG(LCD_INDEX); |
267 | 268 |
268 vert_stretching= ATIGetMach64LCDReg(LCD_VERT_STRETCHING); | 269 vert_stretching= ATIGetMach64LCDReg(LCD_VERT_STRETCHING); |
269 if(!(vert_stretching&VERT_STRETCH_EN)) ret= 1<<16; | 270 if(!(vert_stretching&VERT_STRETCH_EN)) ret= 1<<16; |
280 | 281 |
281 // lcd_gen_ctrl = ATIGetMach64LCDReg(LCD_GEN_CNTL); | 282 // lcd_gen_ctrl = ATIGetMach64LCDReg(LCD_GEN_CNTL); |
282 | 283 |
283 OUTREG(LCD_INDEX, lcd_index); | 284 OUTREG(LCD_INDEX, lcd_index); |
284 | 285 |
285 if(__verbose>VERBOSE_LEVEL) printf("[mach64] vertical stretching factor= %d\n", ret); | 286 if(__verbose>0) printf("[mach64] vertical stretching factor= %d\n", ret); |
286 | 287 |
287 return ret; | 288 return ret; |
288 } | 289 } |
289 | 290 |
290 static void mach64_vid_make_default() | 291 static void mach64_vid_make_default() |
469 | 470 |
470 if(INREG(SCALER_BUF0_OFFSET_U)) supports_planar=1; | 471 if(INREG(SCALER_BUF0_OFFSET_U)) supports_planar=1; |
471 } | 472 } |
472 if(supports_planar) printf("[mach64] Planar YUV formats are supported :)\n"); | 473 if(supports_planar) printf("[mach64] Planar YUV formats are supported :)\n"); |
473 else printf("[mach64] Planar YUV formats are not supported :(\n"); | 474 else printf("[mach64] Planar YUV formats are not supported :(\n"); |
474 | 475 |
476 if( mach64_cap.device_id==DEVICE_ATI_RAGE_MOBILITY_P_M | |
477 || mach64_cap.device_id==DEVICE_ATI_RAGE_MOBILITY_P_M2 | |
478 || mach64_cap.device_id==DEVICE_ATI_RAGE_MOBILITY_L | |
479 || mach64_cap.device_id==DEVICE_ATI_RAGE_MOBILITY_L2) | |
480 supports_lcd_v_stretch=1; | |
481 else | |
482 supports_lcd_v_stretch=0; | |
483 | |
475 reset_regs(); | 484 reset_regs(); |
476 mach64_vid_make_default(); | 485 mach64_vid_make_default(); |
477 | 486 |
478 if(__verbose > VERBOSE_LEVEL) mach64_vid_dump_regs(); | 487 if(__verbose > VERBOSE_LEVEL) mach64_vid_dump_regs(); |
479 return 0; | 488 return 0; |
715 } | 724 } |
716 dest_w = config->dest.w; | 725 dest_w = config->dest.w; |
717 dest_h = config->dest.h; | 726 dest_h = config->dest.h; |
718 besr.fourcc = config->fourcc; | 727 besr.fourcc = config->fourcc; |
719 ecp = (INPLL(PLL_VCLK_CNTL) & PLL_ECP_DIV) >> 4; | 728 ecp = (INPLL(PLL_VCLK_CNTL) & PLL_ECP_DIV) >> 4; |
729 if(__verbose>0) printf("[mach64] ecp: %d\n", ecp); | |
720 v_inc = src_h * mach64_get_vert_stretch(); | 730 v_inc = src_h * mach64_get_vert_stretch(); |
721 | 731 |
722 if(mach64_is_interlace()) v_inc<<=1; | 732 if(mach64_is_interlace()) v_inc<<=1; |
723 if(mach64_is_dbl_scan() ) v_inc>>=1; | 733 if(mach64_is_dbl_scan() ) v_inc>>=1; |
724 v_inc>>=4; // convert 16.16 -> 20.12 | 734 v_inc>>=4; // convert 16.16 -> 20.12 |