Mercurial > mplayer.hg
comparison vidix/sis_vid.c @ 23048:7973a6935234
removed useless code from vidix drivers
author | ben |
---|---|
date | Sun, 22 Apr 2007 15:18:48 +0000 |
parents | 82216ef041e0 |
children | 427075ffb413 |
comparison
equal
deleted
inserted
replaced
23047:702085652768 | 23048:7973a6935234 |
---|---|
182 | 182 |
183 static void set_brightness(uint8_t brightness); | 183 static void set_brightness(uint8_t brightness); |
184 static void set_contrast(uint8_t contrast); | 184 static void set_contrast(uint8_t contrast); |
185 static void set_saturation(char saturation); | 185 static void set_saturation(char saturation); |
186 static void set_hue(uint8_t hue); | 186 static void set_hue(uint8_t hue); |
187 #if 0 | |
188 static void set_alpha(uint8_t alpha); | |
189 #endif | |
190 | 187 |
191 /* IO Port access functions */ | 188 /* IO Port access functions */ |
192 static uint8_t getvideoreg(uint8_t reg) | 189 static uint8_t getvideoreg(uint8_t reg) |
193 { | 190 { |
194 uint8_t ret; | 191 uint8_t ret; |
370 | 367 |
371 inSISIDXREG(SISSR, Index_SR_Graphic_Mode, sr_data); | 368 inSISIDXREG(SISSR, Index_SR_Graphic_Mode, sr_data); |
372 if (sr_data & 0x20) /* interlaced mode */ | 369 if (sr_data & 0x20) /* interlaced mode */ |
373 sis_vmode |= VMODE_INTERLACED; | 370 sis_vmode |= VMODE_INTERLACED; |
374 | 371 |
375 #if 0 /* getting back false data here... */ | |
376 /* CR9 bit 7 set = double scan active */ | |
377 inSISIDXREG(SISCR, 0x09, cr_data); | |
378 if (cr_data & 0x40) { | |
379 sis_vmode |= VMODE_DOUBLESCAN; | |
380 } | |
381 #endif | |
382 | |
383 /* JCP: eventually I'd like to replace this with a call to sisfb | 372 /* JCP: eventually I'd like to replace this with a call to sisfb |
384 SISFB_GET_INFO ioctl to get video bridge info. Not for now, | 373 SISFB_GET_INFO ioctl to get video bridge info. Not for now, |
385 since it requires a very new and not widely distributed version. */ | 374 since it requires a very new and not widely distributed version. */ |
386 sis_init_video_bridge(); | 375 sis_init_video_bridge(); |
387 | 376 |
765 } | 754 } |
766 | 755 |
767 /* FIXME: is it possible that srcW < 0? */ | 756 /* FIXME: is it possible that srcW < 0? */ |
768 overlay.srcW = src_w - (sx - src_x); | 757 overlay.srcW = src_w - (sx - src_x); |
769 overlay.srcH = src_h - (sy - src_y); | 758 overlay.srcH = src_h - (sy - src_y); |
770 | |
771 /* JCP: what to do about this? */ | |
772 #if 0 | |
773 if ((pPriv->oldx1 != overlay.dstBox.x1) || | |
774 (pPriv->oldx2 != overlay.dstBox.x2) || | |
775 (pPriv->oldy1 != overlay.dstBox.y1) || | |
776 (pPriv->oldy2 != overlay.dstBox.y2)) { | |
777 pPriv->mustwait = 1; | |
778 pPriv->oldx1 = overlay.dstBox.x1; | |
779 pPriv->oldx2 = overlay.dstBox.x2; | |
780 pPriv->oldy1 = overlay.dstBox.y1; | |
781 pPriv->oldy2 = overlay.dstBox.y2; | |
782 } | |
783 #endif | |
784 | 759 |
785 /* set merge line buffer */ | 760 /* set merge line buffer */ |
786 merge_line_buf(overlay.srcW > 384); | 761 merge_line_buf(overlay.srcW > 384); |
787 | 762 |
788 /* calculate line buffer length */ | 763 /* calculate line buffer length */ |
1213 | 1188 |
1214 /* get rid of warnings for now */ | 1189 /* get rid of warnings for now */ |
1215 index = index; | 1190 index = index; |
1216 iscrt2 = iscrt2; | 1191 iscrt2 = iscrt2; |
1217 | 1192 |
1218 #if 0 /* JCP: don't bother with this for now. */ | |
1219 /* TW: Stretch image due to idiotic LCD "auto"-scaling on LVDS (and 630+301B) */ | |
1220 if (pSiS->VBFlags & CRT2_LCD) { | |
1221 if (sis_bridge_is_slave) { | |
1222 if (pSiS->VBFlags & VB_LVDS) { | |
1223 dstH = (dstH * LCDheight) / pOverlay->SCREENheight; | |
1224 } else if ((sis_vga_engine == SIS_300_VGA) && | |
1225 (pSiS-> | |
1226 VBFlags & (VB_301B | VB_302B | VB_301LV | | |
1227 VB_302LV))) { | |
1228 dstH = (dstH * LCDheight) / pOverlay->SCREENheight; | |
1229 } | |
1230 } else if (iscrt2) { | |
1231 if (pSiS->VBFlags & VB_LVDS) { | |
1232 dstH = (dstH * LCDheight) / pOverlay->SCREENheight; | |
1233 if (sis_displaymode == DISPMODE_MIRROR) | |
1234 flag = 1; | |
1235 } else if ((sis_vga_engine == SIS_300_VGA) && | |
1236 (pSiS-> | |
1237 VBFlags & (VB_301B | VB_302B | VB_301LV | | |
1238 VB_302LV))) { | |
1239 dstH = (dstH * LCDheight) / pOverlay->SCREENheight; | |
1240 if (sis_displaymode == DISPMODE_MIRROR) | |
1241 flag = 1; | |
1242 } | |
1243 } | |
1244 } | |
1245 #endif | |
1246 | |
1247 /* TW: For double scan modes, we need to double the height | 1193 /* TW: For double scan modes, we need to double the height |
1248 * (Perhaps we also need to scale LVDS, but I'm not sure.) | 1194 * (Perhaps we also need to scale LVDS, but I'm not sure.) |
1249 * On 310/325 series, we need to double the width as well. | 1195 * On 310/325 series, we need to double the width as well. |
1250 * Interlace mode vice versa. | 1196 * Interlace mode vice versa. |
1251 */ | 1197 */ |
1317 pOverlay->VUSF = ((srcH - dstH) << 16) / dstH; | 1263 pOverlay->VUSF = ((srcH - dstH) << 16) / dstH; |
1318 /* TW: Needed for LCD-scaling modes */ | 1264 /* TW: Needed for LCD-scaling modes */ |
1319 if ((flag) && (mult = (srcH / origdstH)) >= 2) | 1265 if ((flag) && (mult = (srcH / origdstH)) >= 2) |
1320 pOverlay->pitch /= mult; | 1266 pOverlay->pitch /= mult; |
1321 } else { | 1267 } else { |
1322 #if 0 | |
1323 if (((pOverlay->bobEnable & 0x08) == 0x00) && | |
1324 (((srcPitch * i) >> 2) > 0xFFF)) { | |
1325 pOverlay->bobEnable |= 0x08; | |
1326 srcPitch >>= 1; | |
1327 } | |
1328 #endif | |
1329 if (((srcPitch * i) >> 2) > 0xFFF) { | 1268 if (((srcPitch * i) >> 2) > 0xFFF) { |
1330 i = (0xFFF * 2 / srcPitch); | 1269 i = (0xFFF * 2 / srcPitch); |
1331 pOverlay->VUSF = 0xFFFF; | 1270 pOverlay->VUSF = 0xFFFF; |
1332 } else { | 1271 } else { |
1333 dstH = i * dstH; | 1272 dstH = i * dstH; |
1542 static void set_hue(uint8_t hue) | 1481 static void set_hue(uint8_t hue) |
1543 { | 1482 { |
1544 setvideoreg(Index_VI_Hue, (hue & 0x08) ? (hue ^ 0x07) : hue); | 1483 setvideoreg(Index_VI_Hue, (hue & 0x08) ? (hue ^ 0x07) : hue); |
1545 } | 1484 } |
1546 | 1485 |
1547 #if 0 | |
1548 /* JCP: not used (I don't think it's correct anyway) */ | |
1549 static void set_alpha(uint8_t alpha) | |
1550 { | |
1551 uint8_t data; | |
1552 | |
1553 data = getvideoreg(Index_VI_Key_Overlay_OP); | |
1554 data &= 0x0F; | |
1555 setvideoreg(Index_VI_Key_Overlay_OP, data | (alpha << 4)); | |
1556 } | |
1557 #endif | |
1558 | |
1559 VDXDriver sis_drv = { | 1486 VDXDriver sis_drv = { |
1560 "sis", | 1487 "sis", |
1561 NULL, | 1488 NULL, |
1562 | 1489 |
1563 .probe = sis_probe, | 1490 .probe = sis_probe, |