Mercurial > mplayer.hg
comparison vidix/savage_vid.c @ 22868:3657ff134131
killed warnings in savage driver
author | ben |
---|---|
date | Sun, 01 Apr 2007 12:57:47 +0000 |
parents | 6c57087c5a2d |
children | a9e111b88c4a |
comparison
equal
deleted
inserted
replaced
22867:d76307ffcb77 | 22868:3657ff134131 |
---|---|
128 /** | 128 /** |
129 * @brief Information on PCI device. | 129 * @brief Information on PCI device. |
130 */ | 130 */ |
131 pciinfo_t pci_info; | 131 pciinfo_t pci_info; |
132 | 132 |
133 /** | |
134 * @brief Unichrome driver colorkey settings. | |
135 */ | |
136 static vidix_grkey_t savage_grkey; | |
137 | |
138 static int frames[VID_PLAY_MAXFRAMES]; | |
139 uint8_t *vio; | 133 uint8_t *vio; |
140 uint8_t mclk_save[3]; | 134 uint8_t mclk_save[3]; |
141 | 135 |
142 #define outb(reg,val) OUTPORT8(reg,val) | 136 #define outb(reg,val) OUTPORT8(reg,val) |
143 #define inb(reg) INPORT8(reg) | 137 #define inb(reg) INPORT8(reg) |
668 | 662 |
669 | 663 |
670 | 664 |
671 static void savage_getscreenproperties(struct savage_info *info){ | 665 static void savage_getscreenproperties(struct savage_info *info){ |
672 unsigned char bpp=0; | 666 unsigned char bpp=0; |
673 uint32_t width=0; | |
674 | 667 |
675 uint32_t vgaIOBase, vgaCRIndex, vgaCRReg; | 668 uint32_t vgaIOBase, vgaCRIndex, vgaCRReg; |
676 | 669 |
677 vgaIOBase = 0x3d0; | 670 vgaIOBase = 0x3d0; |
678 vgaCRIndex = vgaIOBase + 4; | 671 vgaCRIndex = vgaIOBase + 4; |
840 */ | 833 */ |
841 static int | 834 static int |
842 savage_init (void) | 835 savage_init (void) |
843 { | 836 { |
844 int mtrr; | 837 int mtrr; |
845 unsigned char config1, m, n, n1, n2, sr8, cr3f, cr66 = 0, tmp; | 838 unsigned char config1, tmp; |
846 | 839 |
847 static unsigned char RamSavage3D[] = { 8, 4, 4, 2 }; | 840 static unsigned char RamSavage3D[] = { 8, 4, 4, 2 }; |
848 static unsigned char RamSavage4[] = { 2, 4, 8, 12, 16, 32, 64, 32 }; | 841 static unsigned char RamSavage4[] = { 2, 4, 8, 12, 16, 32, 64, 32 }; |
849 static unsigned char RamSavageMX[] = { 2, 8, 4, 16, 8, 16, 4, 16 }; | 842 static unsigned char RamSavageMX[] = { 2, 8, 4, 16, 8, 16, 4, 16 }; |
850 static unsigned char RamSavageNB[] = { 0, 2, 4, 8, 16, 32, 16, 2 }; | 843 static unsigned char RamSavageNB[] = { 0, 2, 4, 8, 16, 32, 16, 2 }; |
851 | 844 |
852 int videoRam, videoRambytes; | 845 int videoRam; |
853 | 846 |
854 uint32_t vgaIOBase, vgaCRIndex, vgaCRReg ; | 847 uint32_t vgaIOBase, vgaCRIndex, vgaCRReg ; |
855 | 848 |
856 unsigned char val; | 849 unsigned char val; |
857 | 850 |
971 cr66 = VGAIN8 (0x3d5); | 964 cr66 = VGAIN8 (0x3d5); |
972 VGAOUT8 (0x3d5, cr66 | 0x02); | 965 VGAOUT8 (0x3d5, cr66 | 0x02); |
973 udelay (10000); | 966 udelay (10000); |
974 | 967 |
975 VGAOUT8 (0x3d4, 0x66); | 968 VGAOUT8 (0x3d4, 0x66); |
976 VGAOUT8 (0x3d5, cr66 & ~0x02); /* clear reset flag */ | 969 VGAOUT8 (0x3d5, cr66 & ~0x02); */ // clear reset flag |
977 /* udelay (10000); */ | 970 /* udelay (10000); */ |
978 | 971 |
979 /* This maps framebuffer @6MB, thus 2MB are left for video. */ | 972 /* This maps framebuffer @6MB, thus 2MB are left for video. */ |
980 if (info->chip.arch == S3_SAVAGE3D) { | 973 if (info->chip.arch == S3_SAVAGE3D) { |
981 info->video_base = map_phys_mem(pci_info.base0, info->chip.fbsize); | 974 info->video_base = map_phys_mem(pci_info.base0, info->chip.fbsize); |
984 else { | 977 else { |
985 info->video_base = map_phys_mem(pci_info.base1, info->chip.fbsize); | 978 info->video_base = map_phys_mem(pci_info.base1, info->chip.fbsize); |
986 info->picture_offset = info->chip.fbsize - FRAMEBUFFER_SIZE; | 979 info->picture_offset = info->chip.fbsize - FRAMEBUFFER_SIZE; |
987 // info->picture_offset = 1024*1024* 4 * 2; | 980 // info->picture_offset = 1024*1024* 4 * 2; |
988 } | 981 } |
989 if ( info->video_base < 0 ){ | 982 if ( info->video_base == NULL){ |
990 printf("errno = %s\n", strerror(errno)); | 983 printf("errno = %s\n", strerror(errno)); |
991 return -1; | 984 return -1; |
992 } | 985 } |
993 | 986 |
994 | 987 |
1177 { | 1170 { |
1178 return 0; | 1171 return 0; |
1179 } | 1172 } |
1180 | 1173 |
1181 /** | 1174 /** |
1182 * @brief Y, U, V offsets. | |
1183 */ | |
1184 static int YOffs, UOffs, VOffs; | |
1185 | |
1186 /** | |
1187 * @brief Configure driver for playback. Driver should prepare BES. | 1175 * @brief Configure driver for playback. Driver should prepare BES. |
1188 * | 1176 * |
1189 * @param info configuration description for playback. | 1177 * @param info configuration description for playback. |
1190 * | 1178 * |
1191 * @returns 0 in case of success. | 1179 * @returns 0 in case of success. |
1194 static int | 1182 static int |
1195 savage_config_playback (vidix_playback_t * vinfo) | 1183 savage_config_playback (vidix_playback_t * vinfo) |
1196 { | 1184 { |
1197 int uv_size, swap_uv; | 1185 int uv_size, swap_uv; |
1198 unsigned int i; | 1186 unsigned int i; |
1199 int extfifo_on; | |
1200 int srcPitch,srcPitch2; | |
1201 | |
1202 /* Overlay register settings */ | |
1203 uint32_t win_start, win_end; | |
1204 uint32_t zoom, mini; | |
1205 uint32_t dcount, falign, qwfetch; | |
1206 uint32_t y_start, u_start, v_start; | |
1207 uint32_t v_ctrl, fifo_ctrl; | |
1208 | 1187 |
1209 if (!is_supported_fourcc (vinfo->fourcc)) | 1188 if (!is_supported_fourcc (vinfo->fourcc)) |
1210 return -1; | 1189 return -1; |
1211 | 1190 |
1212 | 1191 |