Mercurial > mplayer.hg
comparison vidix/drivers/mach64_vid.c @ 4847:75f2935e9984
vsync
author | michael |
---|---|
date | Sun, 24 Feb 2002 18:31:14 +0000 |
parents | 75a701b39d61 |
children | f85d5a17d782 |
comparison
equal
deleted
inserted
replaced
4846:effab9f7da71 | 4847:75f2935e9984 |
---|---|
522 // OVERLAY_SCALE_CNTL bits & what they seem to affect | 522 // OVERLAY_SCALE_CNTL bits & what they seem to affect |
523 // bit 0 no effect | 523 // bit 0 no effect |
524 // bit 1 yuv2rgb coeff related | 524 // bit 1 yuv2rgb coeff related |
525 // bit 2 horizontal interpolation if 0 | 525 // bit 2 horizontal interpolation if 0 |
526 // bit 3 vertical interpolation if 0 | 526 // bit 3 vertical interpolation if 0 |
527 // bit 4 chroma related | 527 // bit 4 chroma encoding (0-> 128=neutral / 1-> 0->neutral) |
528 // bit 5-6 gamma correction | 528 // bit 5-6 gamma correction |
529 // bit 7 nothing visible if set | 529 // bit 7 nothing visible if set |
530 // bit 8-27 no effect | 530 // bit 8-27 no effect |
531 // bit 28-31 nothing interresting just crashed my system when i played with them :( | 531 // bit 28-31 nothing interresting just crashed my system when i played with them :( |
532 | 532 |
533 mach64_wait_for_idle(); | 533 mach64_wait_for_idle(); |
534 vf = INREG(VIDEO_FORMAT); | 534 vf = INREG(VIDEO_FORMAT); |
535 | 535 |
536 // Bits 16-19 seem to select the format | 536 // Bits 16-19 seem to select the format |
537 // 0x0 dunno behaves strange | 537 // 0x0 dunno behaves strange |
545 // 0x8 YYYYUVUV | 545 // 0x8 YYYYUVUV |
546 // 0x9 YVU9 | 546 // 0x9 YVU9 |
547 // 0xA YV12 | 547 // 0xA YV12 |
548 // 0xB YUY2 | 548 // 0xB YUY2 |
549 // 0xC UYVY | 549 // 0xC UYVY |
550 // 0xD UYVY (not again ... dont ask me, i dunno the difference) | 550 // 0xD UYVY (no difference is visible if i switch between C/D for every even/odd frame) |
551 // 0xE dunno behaves strange | 551 // 0xE dunno behaves strange |
552 // 0xF dunno behaves strange | 552 // 0xF dunno behaves strange |
553 // Bit 28 all values are assumed to be 7 bit with chroma=64 for black (tested with YV12 & YUY2) | 553 // Bit 28 all values are assumed to be 7 bit with chroma=64 for black (tested with YV12 & YUY2) |
554 // the remaining bits seem to have no effect | 554 // the remaining bits seem to have no effect |
555 | 555 |
749 return 0; | 749 return 0; |
750 } | 750 } |
751 | 751 |
752 static void mach64_wait_vsync( void ) | 752 static void mach64_wait_vsync( void ) |
753 { | 753 { |
754 #warning MACH64 VSYNC WAS NOT IMPLEMENTED!!! | 754 int i; |
755 | |
756 for(i=0; i<2000000; i++) | |
757 if( (INREG(CRTC_INT_CNTL)&CRTC_VBLANK)==0 ) break; | |
758 for(i=0; i<2000000; i++) | |
759 if( (INREG(CRTC_INT_CNTL)&CRTC_VBLANK) ) break; | |
760 | |
755 } | 761 } |
756 | 762 |
757 int vixPlaybackFrameSelect(unsigned int frame) | 763 int vixPlaybackFrameSelect(unsigned int frame) |
758 { | 764 { |
759 uint32_t off[6]; | 765 uint32_t off[6]; |
804 buf0[x*2 + y*1280]= buf0[x + y*640]; | 810 buf0[x*2 + y*1280]= buf0[x + y*640]; |
805 } | 811 } |
806 }*/ | 812 }*/ |
807 for(y=0; y<480; y++) | 813 for(y=0; y<480; y++) |
808 { | 814 { |
809 // for(x=0; x<1280; x++) buf0[x + y*1280]=0; | 815 for(x=0; x<1280; x++) buf0[x + y*1280]=0; |
810 for(x=0; x<1280/4; x++) | 816 for(x=0; x<1280/2; x++) buf0[x*2 + y*1280]=128; |
817 for(x=0; x<1280/24; x++) | |
811 { | 818 { |
812 // 1-> gray0 | 819 // 1-> gray0 |
813 // buf0[x*2 + y*1280 +0] ^= buf0[x*2 + y*1280 +1]; | 820 // buf0[x*2 + y*1280 +0] ^= buf0[x*2 + y*1280 +1]; |
814 // buf0[x*2 + y*1280 +1] ^= buf0[x*2 + y*1280 +0]; | 821 // buf0[x*2 + y*1280 +1] ^= buf0[x*2 + y*1280 +0]; |
815 // buf0[x*2 + y*1280 +0] ^= buf0[x*2 + y*1280 +1]; | 822 // buf0[x*2 + y*1280 +0] ^= buf0[x*2 + y*1280 +1]; |
816 | 823 |
817 buf0[x*4 + y*1280 +1] =x; //buf0[x*4 + y*1280 +0]>>1; | 824 buf0[x*24 + y*1280 +0] =128; |
818 buf0[x*4 + y*1280 +3] =128; //buf0[x*4 + y*1280 +2]>>1; | 825 buf0[x*24 + y*1280 +1] =x; //buf0[x*4 + y*1280 +0]>>1; |
819 buf0[x*4 + y*1280 +0] =128; | 826 buf0[x*24 + y*1280 +2] =128; |
820 buf0[x*4 + y*1280 +2] =128; | 827 buf0[x*24 + y*1280 +3] =x; //buf0[x*4 + y*1280 +2]>>1; |
821 | 828 |
822 // buf0[x*8 + y*1280 +0]= 1; | 829 // buf0[x*8 + y*1280 +0]= 1; |
823 // buf0[x*2 + y*1280 +1]= 7; | 830 // buf0[x*2 + y*1280 +1]= 7; |
824 // buf0[x*2 + y*1280+6 ]= 255; | 831 // buf0[x*2 + y*1280+6 ]= 255; |
825 } | 832 } |
828 /*for(y=0; y<480; y++) | 835 /*for(y=0; y<480; y++) |
829 { | 836 { |
830 // for(x=0; x<1280; x++) buf0[x + y*1280]=128; | 837 // for(x=0; x<1280; x++) buf0[x + y*1280]=128; |
831 for(x=0; x<640; x++) | 838 for(x=0; x<640; x++) |
832 { | 839 { |
833 buf0[x + y*640 ]>>=1; | 840 // buf0[x + y*640 ]=255;//>>=1; |
834 buf0[x + y*640 ]|=128; | 841 // buf0[x + y*640 ]|=128; |
835 } | 842 } |
836 } | 843 } |
837 for(y=0; y<480/2; y++) | 844 for(y=0; y<480/2; y++) |
838 { | 845 { |
839 // for(x=0; x<1280; x++) buf0[x + y*1280]=128; | 846 // for(x=0; x<1280; x++) buf0[x + y*1280]=128; |
840 for(x=0; x<640/2; x++) | 847 for(x=0; x<640/2; x++) |
841 { | 848 { |
842 buf1[x + y*320 ]>>=1; | 849 buf1[x + y*320 ]+=128 ;//>>=1; |
843 buf2[x + y*320 ]>>=1; | 850 buf2[x + y*320 ]+=128 ;//>>=1; |
844 } | 851 } |
845 }*/ | 852 }*/ |
846 } | 853 } |
847 #endif | 854 #endif |
848 } | 855 } |
849 | 856 #if 0 // delay routine so the individual frames can be ssen better |
850 mach64_wait_vsync(); | 857 { |
858 volatile int i=0; | |
859 for(i=0; i<10000000; i++); | |
860 } | |
861 #endif | |
862 | |
851 mach64_wait_for_idle(); | 863 mach64_wait_for_idle(); |
852 mach64_fifo_wait(7); | 864 mach64_fifo_wait(7); |
865 | |
853 OUTREG(SCALER_BUF0_OFFSET, off[0]); | 866 OUTREG(SCALER_BUF0_OFFSET, off[0]); |
854 OUTREG(SCALER_BUF0_OFFSET_U, off[1]); | 867 OUTREG(SCALER_BUF0_OFFSET_U, off[1]); |
855 OUTREG(SCALER_BUF0_OFFSET_V, off[2]); | 868 OUTREG(SCALER_BUF0_OFFSET_V, off[2]); |
856 OUTREG(SCALER_BUF1_OFFSET, off[3]); | 869 OUTREG(SCALER_BUF1_OFFSET, off[3]); |
857 OUTREG(SCALER_BUF1_OFFSET_U, off[4]); | 870 OUTREG(SCALER_BUF1_OFFSET_U, off[4]); |
858 OUTREG(SCALER_BUF1_OFFSET_V, off[5]); | 871 OUTREG(SCALER_BUF1_OFFSET_V, off[5]); |
872 mach64_wait_vsync(); | |
873 | |
859 if(__verbose > VERBOSE_LEVEL) mach64_vid_dump_regs(); | 874 if(__verbose > VERBOSE_LEVEL) mach64_vid_dump_regs(); |
860 return 0; | 875 return 0; |
861 } | 876 } |
862 | 877 |
863 vidix_video_eq_t equal = | 878 vidix_video_eq_t equal = |