comparison drivers/radeon/radeon_vid.c @ 3266:ff90589b635f

Fixed single buffering problems and -vo mga compatibility by number of buffers
author nick
date Sun, 02 Dec 2001 12:21:13 +0000
parents ec69d8238c84
children a4437ac3f034
comparison
equal deleted inserted replaced
3265:ec69d8238c84 3266:ff90589b635f
12 * This file is partly based on mga_vid and sis_vid stuff from 12 * This file is partly based on mga_vid and sis_vid stuff from
13 * mplayer's package. 13 * mplayer's package.
14 * Also here was used code from CVS of GATOS project and X11 trees. 14 * Also here was used code from CVS of GATOS project and X11 trees.
15 */ 15 */
16 16
17 #define RADEON_VID_VERSION "1.0.1" 17 #define RADEON_VID_VERSION "1.0.2"
18 18
19 /* 19 /*
20 It's entirely possible this major conflicts with something else 20 It's entirely possible this major conflicts with something else
21 mknod /dev/radeon_vid c 178 0 21 mknod /dev/radeon_vid c 178 0
22 or 22 or
309 while(!(INREG(OV0_REG_LOAD_CNTL)&REG_LD_CTL_LOCK_READBACK)); 309 while(!(INREG(OV0_REG_LOAD_CNTL)&REG_LD_CTL_LOCK_READBACK));
310 310
311 OUTREG(OV0_AUTO_FLIP_CNTL,OV0_AUTO_FLIP_CNTL_SOFT_BUF_ODD); 311 OUTREG(OV0_AUTO_FLIP_CNTL,OV0_AUTO_FLIP_CNTL_SOFT_BUF_ODD);
312 312
313 OUTREG(OV0_DEINTERLACE_PATTERN,besr.deinterlace_pattern); 313 OUTREG(OV0_DEINTERLACE_PATTERN,besr.deinterlace_pattern);
314
315 OUTREG(OV0_COLOUR_CNTL, (besr.brightness & 0x7f) |
316 (besr.saturation << 8) |
317 (besr.saturation << 16));
314 318
315 OUTREG(OV0_AUTO_FLIP_CNTL,(INREG(OV0_AUTO_FLIP_CNTL)^OV0_AUTO_FLIP_CNTL_SOFT_EOF_TOGGLE)); 319 OUTREG(OV0_AUTO_FLIP_CNTL,(INREG(OV0_AUTO_FLIP_CNTL)^OV0_AUTO_FLIP_CNTL_SOFT_EOF_TOGGLE));
316 OUTREG(OV0_AUTO_FLIP_CNTL,(INREG(OV0_AUTO_FLIP_CNTL)^OV0_AUTO_FLIP_CNTL_SOFT_EOF_TOGGLE)); 320 OUTREG(OV0_AUTO_FLIP_CNTL,(INREG(OV0_AUTO_FLIP_CNTL)^OV0_AUTO_FLIP_CNTL_SOFT_EOF_TOGGLE));
317 321
318 OUTREG(OV0_H_INC, besr.h_inc); 322 OUTREG(OV0_H_INC, besr.h_inc);
613 if(radeon_config.frame_size==0 || radeon_config.frame_size>1024*768*2){ 617 if(radeon_config.frame_size==0 || radeon_config.frame_size>1024*768*2){
614 printk(RVID_MSG"illegal frame_size: %d\n",radeon_config.frame_size); 618 printk(RVID_MSG"illegal frame_size: %d\n",radeon_config.frame_size);
615 return -EFAULT; 619 return -EFAULT;
616 } 620 }
617 621
618 if(radeon_config.num_frames<1 || radeon_config.num_frames>4){ 622 if(radeon_config.num_frames<1){
619 printk(RVID_MSG"illegal num_frames: %d\n",radeon_config.num_frames); 623 printk(RVID_MSG"illegal num_frames: %d\n",radeon_config.num_frames);
620 return -EFAULT; 624 return -EFAULT;
621 } 625 }
622 626 if(radeon_config.num_frames==1) besr.double_buff=0;
627 if(!besr.double_buff) radeon_config.num_frames=1;
628 else radeon_config.num_frames=2;
623 radeon_config.card_type = 0; 629 radeon_config.card_type = 0;
624 radeon_config.ram_size = radeon_ram_size; 630 radeon_config.ram_size = radeon_ram_size;
625 radeon_overlay_off = radeon_ram_size*0x100000 - radeon_config.frame_size*radeon_config.num_frames; 631 radeon_overlay_off = radeon_ram_size*0x100000 - radeon_config.frame_size*radeon_config.num_frames;
626 radeon_overlay_off &= 0xffff0000; 632 radeon_overlay_off &= 0xffff0000;
627 if(radeon_overlay_off < 0){ 633 if(radeon_overlay_off < 0){