[MPlayer-cvslog] r23066 - trunk/vidix

ben subversion at mplayerhq.hu
Sun Apr 22 17:18:48 CEST 2007


Author: ben
Date: Sun Apr 22 17:18:48 2007
New Revision: 23066

Log:
removed useless code from vidix drivers

Modified:
   trunk/vidix/mach64_vid.c
   trunk/vidix/mga_vid.c
   trunk/vidix/pci.c
   trunk/vidix/radeon_vid.c
   trunk/vidix/savage_vid.c
   trunk/vidix/sis_bridge.c
   trunk/vidix/sis_vid.c

Modified: trunk/vidix/mach64_vid.c
==============================================================================
--- trunk/vidix/mach64_vid.c	(original)
+++ trunk/vidix/mach64_vid.c	Sun Apr 22 17:18:48 2007
@@ -770,14 +770,7 @@ static int mach64_vid_init_video( vidix_
     dest_h = config->dest.h;
     besr.fourcc = config->fourcc;
     ecp = (INPLL(PLL_VCLK_CNTL) & PLL_ECP_DIV) >> 4;
-#if 0
-{
-int i;
-for(i=0; i<32; i++){
-    printf("%X ", INPLL(i));
-}
-}
-#endif
+
     if(__verbose>0) printf("[mach64] ecp: %d\n", ecp);
     v_inc = src_h * mach64_get_vert_stretch();
     
@@ -950,13 +943,6 @@ static int mach64_frame_sel(unsigned int
     	off[i+3]= mach64_buffer_base[last_frame][i];
     }
 
-#if 0 // delay routine so the individual frames can be ssen better
-{
-volatile int i=0;
-for(i=0; i<10000000; i++);
-}
-#endif
-
     mach64_wait_for_idle();
     mach64_fifo_wait(7);
 

Modified: trunk/vidix/mga_vid.c
==============================================================================
--- trunk/vidix/mga_vid.c	(original)
+++ trunk/vidix/mga_vid.c	Sun Apr 22 17:18:48 2007
@@ -671,13 +671,6 @@ void mga_handle_irq(int irq, void *dev_i
 	crtc2_frame_sel(mga_next_frame);
 #endif
 	
-#if 0
-	++counter;
-	if(!(counter&63)){
-	    printf("mga irq counter = %d\n",counter);
-	}
-#endif
-
 //    } else {
 //	debug_irqignore = 1;
 //    }
@@ -821,20 +814,6 @@ static int mga_config_playback(vidix_pla
                     + (1<<16)   // chroma upsampling
                     + (1<<17)   // 4:2:0 mode
                     + (1<<18);  // dither enabled
-#if 0
-	if(is_g400)
-	{
-		//zoom disabled, zoom filter disabled, 420 3 plane format, proc amp
-		//disabled, rgb mode disabled 
-		regs.besglobctl = (1<<5);
-	}
-	else
-	{
-		//zoom disabled, zoom filter disabled, Cb samples in 0246, Cr
-		//in 1357, BES register update on besvcnt
-	        regs.besglobctl = 0;
-	}
-#endif
         break;
 
     case IMGFMT_YUY2:	
@@ -1323,20 +1302,6 @@ static int mga_init(void)
 	    }
 	} 
 
-#if 0
-//	    printf("List resources -----------\n");
-	    for(temp=0;temp<DEVICE_COUNT_RESOURCE;temp++){
-	        struct resource *res=&pci_dev->resource[temp];
-	        if(res->flags){
-	          int size=(1+res->end-res->start)>>20;
-	          printf("res %d:  start: 0x%X   end: 0x%X  (%d MB) flags=0x%X\n",temp,res->start,res->end,size,res->flags);
-	          if(res->flags&(IORESOURCE_MEM|IORESOURCE_PREFETCH)){
-	              if(size>mga_ram_size && size<=64) mga_ram_size=size;
-	          }
-	        }
-	    }
-#endif
-
         printf("[mga] detected RAMSIZE is %d MB\n", (unsigned int) mga_ram_size);
 #endif
     }

Modified: trunk/vidix/pci.c
==============================================================================
--- trunk/vidix/pci.c	(original)
+++ trunk/vidix/pci.c	Sun Apr 22 17:18:48 2007
@@ -94,15 +94,6 @@
 #endif
 #endif
 
-#if 0
-#if defined(__SUNPRO_C) || defined(sun) || defined(__sun)
-#include <sys/psw.h>
-#else
-#include <sys/seg.h>
-#endif
-#include <sys/v86.h>
-#endif
- 
 #if defined(Lynx) && defined(__powerpc__)
 /* let's mimick the Linux Alpha stuff for LynxOS so we don't have
  * to change too much code

Modified: trunk/vidix/radeon_vid.c
==============================================================================
--- trunk/vidix/radeon_vid.c	(original)
+++ trunk/vidix/radeon_vid.c	Sun Apr 22 17:18:48 2007
@@ -1070,16 +1070,6 @@ static void radeon_set_transform(float b
 	CAdjBCb = sat * OvHueCos * trans[ref].RefBCb;
 	CAdjBCr = sat * OvHueSin * trans[ref].RefBCb;
     
-#if 0 /* default constants */
-	CAdjLuma = 1.16455078125;
-
-	CAdjRCb = 0.0;
-	CAdjRCr = 1.59619140625;
-	CAdjGCb = -0.39111328125;
-	CAdjGCr = -0.8125;
-	CAdjBCb = 2.01708984375;
-	CAdjBCr = 0;
-#endif
 	OvLuma = CAdjLuma;
 	OvRCb = CAdjRCb;
 	OvRCr = CAdjRCr;
@@ -1093,21 +1083,13 @@ static void radeon_set_transform(float b
 		OvLuma * Loff - (OvGCb + OvGCr) * Coff;
 	OvBOff = BlueAdj + CAdjOff - 
 		OvLuma * Loff - (OvBCb + OvBCr) * Coff;
-#if 0 /* default constants */
-	OvROff = -888.5;
-	OvGOff = 545;
-	OvBOff = -1104;
-#endif 
    
 	dwOvROff = ((int)(OvROff * 2.0)) & 0x1fff;
 	dwOvGOff = (int)(OvGOff * 2.0) & 0x1fff;
 	dwOvBOff = (int)(OvBOff * 2.0) & 0x1fff;
 	/* Whatever docs say about R200 having 3.8 format instead of 3.11
 	   as in Radeon is a lie */
-#if 0
-	if(!IsR200)
-	{
-#endif
+
 		dwOvLuma =(((int)(OvLuma * 2048.0))&0x7fff)<<17;
 		dwOvRCb = (((int)(OvRCb * 2048.0))&0x7fff)<<1;
 		dwOvRCr = (((int)(OvRCr * 2048.0))&0x7fff)<<17;
@@ -1115,19 +1097,7 @@ static void radeon_set_transform(float b
 		dwOvGCr = (((int)(OvGCr * 2048.0))&0x7fff)<<17;
 		dwOvBCb = (((int)(OvBCb * 2048.0))&0x7fff)<<1;
 		dwOvBCr = (((int)(OvBCr * 2048.0))&0x7fff)<<17;
-#if 0
-	}
-	else
-	{
-		dwOvLuma = (((int)(OvLuma * 256.0))&0x7ff)<<20;
-		dwOvRCb = (((int)(OvRCb * 256.0))&0x7ff)<<4;
-		dwOvRCr = (((int)(OvRCr * 256.0))&0x7ff)<<20;
-		dwOvGCb = (((int)(OvGCb * 256.0))&0x7ff)<<4;
-		dwOvGCr = (((int)(OvGCr * 256.0))&0x7ff)<<20;
-		dwOvBCb = (((int)(OvBCb * 256.0))&0x7ff)<<4;
-		dwOvBCr = (((int)(OvBCr * 256.0))&0x7ff)<<20;
-	}
-#endif
+
 	OUTREG(OV0_LIN_TRANS_A, dwOvRCb | dwOvLuma);
 	OUTREG(OV0_LIN_TRANS_B, dwOvROff | dwOvRCr);
 	OUTREG(OV0_LIN_TRANS_C, dwOvGCb | dwOvLuma);
@@ -1559,15 +1529,7 @@ static void radeon_vid_display_video( vo
     radeon_fifo_wait(15);
 
     force_second=0;
-#if 0 /* Warning: for now we have black screen only! :( */
-#ifndef RAGE128
-    if(rinfo.hasCRTC2 && 
-       (rinfo.dviDispType == MT_CTV || rinfo.dviDispType == MT_STV))
-    {
-	force_second=1;
-    }
-#endif
-#endif
+
     /* Shutdown capturing */
     OUTREG(FCP_CNTL, FCP_CNTL__GND);
     OUTREG(CAP0_TRIG_CNTL, 0);

Modified: trunk/vidix/savage_vid.c
==============================================================================
--- trunk/vidix/savage_vid.c	(original)
+++ trunk/vidix/savage_vid.c	Sun Apr 22 17:18:48 2007
@@ -1313,38 +1313,6 @@ savage_playback_off (void)
   return 0;
 }
 
-/**
- * @brief Driver should prepare and activate corresponded frame.
- *
- * @param frame the frame index.
- *
- * @return 0.
- *
- * @note This function is used only for double and triple buffering
- *       and never used for single buffering playback.
- */
-#if 0
-static int
-savage_frame_select (unsigned int frame)
-{
-////FIXME ADD
-//    savage_overlay_start(info, frame);
-    //if (info->num_frames >= 1)
-//	    info->cur_frame = frame//(frame+1)%info->num_frames;
-//
-//	savage4_waitidle(info); 
- 	
-   printf("vixPlaybackFrameSelect Leave\n" );
-	 // FIXME: does this work to avoid tearing?
-//   VerticalRetraceWait();
-   
-  return 0;
-}
-
-#endif 
-
-
-
 void debugout(unsigned int addr, unsigned int val){
 	return ;
     switch ( addr ){
@@ -1442,9 +1410,6 @@ VDXDriver savage_drv = {
   .config_playback = savage_config_playback,
   .playback_on = savage_playback_on,
   .playback_off = savage_playback_off,
-#if 0
-  .frame_sel = savage_frame_select,
-#endif
   .get_eq = savage_get_eq,
   .set_eq = savage_set_eq,
   .set_gkey = savage_set_gkeys,

Modified: trunk/vidix/sis_bridge.c
==============================================================================
--- trunk/vidix/sis_bridge.c	(original)
+++ trunk/vidix/sis_bridge.c	Sun Apr 22 17:18:48 2007
@@ -80,42 +80,7 @@ static void sis_sense_30x(void)
 
     sis_do_sense(0, 0, 0, 0);
 
-    if ((sis_vga_engine == SIS_315_VGA) ||
-	(sis_device_id == DEVICE_SIS_300)) {
-#if 0
-	if (0 /*pSiS->sishw_ext.UseROM */ ) {
-	    if (sis_vga_engine == SIS_300_VGA)
-		temp = 0xfe;
-	    else {
-		temp = 0xf3;
-		if (sis_device_id == DEVICE_SIS_330)
-		    temp = 0x11b;
-	    }
-	    if (pSiS->BIOS[temp] & 0x08) {
-		if (sis_verbose > 1) {
-		    printf
-			("[SiS] SiS30x: Video bridge has DVI-I TMDS/VGA combo connector\n");
-		}
-		orSISIDXREG(SISCR, 0x32, 0x80);
-	    } else {
-		andSISIDXREG(SISCR, 0x32, 0x7f);
-	    }
-	}
-#endif
-    }
-
     if (sis_vga_engine == SIS_300_VGA) {
-	if (0 /*pSiS->sishw_ext.UseROM */ ) {
-#if 0
-	    testvga2_tempbh = pSiS->BIOS[0xf9];
-	    testvga2_tempbl = pSiS->BIOS[0xf8];
-	    testsvhs_tempbh = pSiS->BIOS[0xfb];
-	    testsvhs_tempbl = pSiS->BIOS[0xfa];
-	    testcvbs_tempbh = pSiS->BIOS[0xfd];
-	    testcvbs_tempbl = pSiS->BIOS[0xfc];
-	    biosflag = pSiS->BIOS[0xfe];
-#endif
-	} else {
 	    testvga2_tempbh = 0x00;
 	    testvga2_tempbl = 0xd1;
 	    testsvhs_tempbh = 0x00;
@@ -123,7 +88,7 @@ static void sis_sense_30x(void)
 	    testcvbs_tempbh = 0x00;
 	    testcvbs_tempbl = 0xb3;
 	    biosflag = 0;
-	}
+
 	if (sis_vbflags & (VB_301B | VB_302B | VB_301LV | VB_302LV)) {
 	    testvga2_tempbh = 0x01;
 	    testvga2_tempbl = 0x90;
@@ -158,27 +123,6 @@ static void sis_sense_30x(void)
 	    }
 	}
     } else {
-	if (0 /*pSiS->sishw_ext.UseROM */ ) {
-#if 0
-	    if (sis_device_id == DEVICE_SIS_330) {
-		testvga2_tempbh = pSiS->BIOS[0xe6];
-		testvga2_tempbl = pSiS->BIOS[0xe5];
-		testsvhs_tempbh = pSiS->BIOS[0xe8];
-		testsvhs_tempbl = pSiS->BIOS[0xe7];
-		testcvbs_tempbh = pSiS->BIOS[0xea];
-		testcvbs_tempbl = pSiS->BIOS[0xe9];
-		biosflag = pSiS->BIOS[0x11b];
-	    } else {
-		testvga2_tempbh = pSiS->BIOS[0xbe];
-		testvga2_tempbl = pSiS->BIOS[0xbd];
-		testsvhs_tempbh = pSiS->BIOS[0xc0];
-		testsvhs_tempbl = pSiS->BIOS[0xbf];
-		testcvbs_tempbh = pSiS->BIOS[0xc2];
-		testcvbs_tempbl = pSiS->BIOS[0xc1];
-		biosflag = pSiS->BIOS[0xf3];
-	    }
-#endif
-	} else {
 	    testvga2_tempbh = 0x00;
 	    testvga2_tempbl = 0xd1;
 	    testsvhs_tempbh = 0x00;
@@ -186,28 +130,8 @@ static void sis_sense_30x(void)
 	    testcvbs_tempbh = 0x00;
 	    testcvbs_tempbl = 0xb3;
 	    biosflag = 0;
-	}
 
 	if (sis_vbflags & (VB_301B | VB_302B | VB_301LV | VB_302LV)) {
-	    if (0 /*pSiS->sishw_ext.UseROM */ ) {
-#if 0
-		if (sis_device_id == DEVICE_SIS_330) {
-		    testvga2_tempbh = pSiS->BIOS[0xec];
-		    testvga2_tempbl = pSiS->BIOS[0xeb];
-		    testsvhs_tempbh = pSiS->BIOS[0xee];
-		    testsvhs_tempbl = pSiS->BIOS[0xed];
-		    testcvbs_tempbh = pSiS->BIOS[0xf0];
-		    testcvbs_tempbl = pSiS->BIOS[0xef];
-		} else {
-		    testvga2_tempbh = pSiS->BIOS[0xc4];
-		    testvga2_tempbl = pSiS->BIOS[0xc3];
-		    testsvhs_tempbh = pSiS->BIOS[0xc6];
-		    testsvhs_tempbl = pSiS->BIOS[0xc5];
-		    testcvbs_tempbh = pSiS->BIOS[0xc8];
-		    testcvbs_tempbl = pSiS->BIOS[0xc7];
-		}
-#endif
-	    } else {
 		if (sis_vbflags & (VB_301B | VB_302B)) {
 		    testvga2_tempbh = 0x01;
 		    testvga2_tempbl = 0x90;
@@ -223,7 +147,6 @@ static void sis_sense_30x(void)
 		    testcvbs_tempbh = 0x01;
 		    testcvbs_tempbl = 0x00;
 		}
-	    }
 	}
 	if (sis_vbflags & (VB_301 | VB_301B | VB_302B)) {
 	    inSISIDXREG(SISPART4, 0x01, myflag);
@@ -512,33 +435,6 @@ static void sis_detect_crt2(void)
 
     if (CR32 & 0x10)
 	sis_vbflags |= CRT2_VGA;
-
-#if 0
-    if (!(pSiS->nocrt2ddcdetection)) {
-	if (sis_vbflags & (VB_301B | VB_302B)) {
-	    if (!(sis_vbflags & (CRT2_VGA | CRT2_LCD))) {
-		printf
-		    ("[SiS] BIOS detected no secondary VGA, sensing via DDC\n");
-		if (SiS_SenseVGA2DDC(pSiS->SiS_Pr, pSiS)) {
-		    printf
-			("[SiS] DDC error during secondary VGA detection\n");
-		} else {
-		    inSISIDXREG(SISCR, 0x32, CR32);
-		    if (CR32 & 0x10) {
-			sis_vbflags |= CRT2_VGA;
-			/*pSiS->postVBCR32 |= 0x10; */
-			printf
-			    ("[SiS] Detected secondary VGA connection\n");
-		    } else {
-			printf
-			    ("[SiS] No secondary VGA connection detected\n");
-		    }
-		}
-	    }
-	}
-    }
-#endif
-
 }
 
 
@@ -650,15 +546,6 @@ static void sis_detect_video_bridge(void
     /* detects if brdige uses LCDA for low res text modes */
     if (sis_vga_engine == SIS_315_VGA) {
 	if (sis_vbflags & (VB_302B | VB_301LV | VB_302LV)) {
-#if 0
-	    if (pSiS->sisfblcda != 0xff) {
-		if ((pSiS->sisfblcda & 0x03) == 0x03) {
-		    //pSiS->SiS_Pr->SiS_UseLCDA = TRUE;
-		    sis_vbflags |= VB_USELCDA;
-		}
-	    } else
-#endif
-	    {
 		inSISIDXREG(SISCR, 0x34, temp);
 		if (temp <= 0x13) {
 		    inSISIDXREG(SISCR, 0x38, temp);
@@ -676,7 +563,6 @@ static void sis_detect_video_bridge(void
 			}
 		    }
 		}
-	    }
 	    if (sis_vbflags & VB_USELCDA) {
 		/* printf("Bridge uses LCDA for low resolution and text modes\n"); */
 	    }

Modified: trunk/vidix/sis_vid.c
==============================================================================
--- trunk/vidix/sis_vid.c	(original)
+++ trunk/vidix/sis_vid.c	Sun Apr 22 17:18:48 2007
@@ -184,9 +184,6 @@ static void set_brightness(uint8_t brigh
 static void set_contrast(uint8_t contrast);
 static void set_saturation(char saturation);
 static void set_hue(uint8_t hue);
-#if 0
-static void set_alpha(uint8_t alpha);
-#endif
 
 /* IO Port access functions */
 static uint8_t getvideoreg(uint8_t reg)
@@ -372,14 +369,6 @@ static int sis_init(void)
     if (sr_data & 0x20)		/* interlaced mode */
 	sis_vmode |= VMODE_INTERLACED;
 
-#if 0				/* getting back false data here... */
-    /* CR9 bit 7 set = double scan active */
-    inSISIDXREG(SISCR, 0x09, cr_data);
-    if (cr_data & 0x40) {
-	sis_vmode |= VMODE_DOUBLESCAN;
-    }
-#endif
-
     /* JCP: eventually I'd like to replace this with a call to sisfb
        SISFB_GET_INFO ioctl to get video bridge info.  Not for now,
        since it requires a very new and not widely distributed version. */
@@ -768,20 +757,6 @@ static int sis_config_playback(vidix_pla
     overlay.srcW = src_w - (sx - src_x);
     overlay.srcH = src_h - (sy - src_y);
 
-    /* JCP: what to do about this? */
-#if 0
-    if ((pPriv->oldx1 != overlay.dstBox.x1) ||
-	(pPriv->oldx2 != overlay.dstBox.x2) ||
-	(pPriv->oldy1 != overlay.dstBox.y1) ||
-	(pPriv->oldy2 != overlay.dstBox.y2)) {
-	pPriv->mustwait = 1;
-	pPriv->oldx1 = overlay.dstBox.x1;
-	pPriv->oldx2 = overlay.dstBox.x2;
-	pPriv->oldy1 = overlay.dstBox.y1;
-	pPriv->oldy2 = overlay.dstBox.y2;
-    }
-#endif
-
     /* set merge line buffer */
     merge_line_buf(overlay.srcW > 384);
 
@@ -1215,35 +1190,6 @@ calc_scale_factor(SISOverlayPtr pOverlay
     index = index;
     iscrt2 = iscrt2;
 
-#if 0				/* JCP: don't bother with this for now. */
-    /* TW: Stretch image due to idiotic LCD "auto"-scaling on LVDS (and 630+301B) */
-    if (pSiS->VBFlags & CRT2_LCD) {
-	if (sis_bridge_is_slave) {
-	    if (pSiS->VBFlags & VB_LVDS) {
-		dstH = (dstH * LCDheight) / pOverlay->SCREENheight;
-	    } else if ((sis_vga_engine == SIS_300_VGA) &&
-		       (pSiS->
-			VBFlags & (VB_301B | VB_302B | VB_301LV |
-				   VB_302LV))) {
-		dstH = (dstH * LCDheight) / pOverlay->SCREENheight;
-	    }
-	} else if (iscrt2) {
-	    if (pSiS->VBFlags & VB_LVDS) {
-		dstH = (dstH * LCDheight) / pOverlay->SCREENheight;
-		if (sis_displaymode == DISPMODE_MIRROR)
-		    flag = 1;
-	    } else if ((sis_vga_engine == SIS_300_VGA) &&
-		       (pSiS->
-			VBFlags & (VB_301B | VB_302B | VB_301LV |
-				   VB_302LV))) {
-		dstH = (dstH * LCDheight) / pOverlay->SCREENheight;
-		if (sis_displaymode == DISPMODE_MIRROR)
-		    flag = 1;
-	    }
-	}
-    }
-#endif
-
     /* TW: For double scan modes, we need to double the height
      *     (Perhaps we also need to scale LVDS, but I'm not sure.)
      *     On 310/325 series, we need to double the width as well.
@@ -1319,13 +1265,6 @@ calc_scale_factor(SISOverlayPtr pOverlay
 	    if ((flag) && (mult = (srcH / origdstH)) >= 2)
 		pOverlay->pitch /= mult;
 	} else {
-#if 0
-	    if (((pOverlay->bobEnable & 0x08) == 0x00) &&
-		(((srcPitch * i) >> 2) > 0xFFF)) {
-		pOverlay->bobEnable |= 0x08;
-		srcPitch >>= 1;
-	    }
-#endif
 	    if (((srcPitch * i) >> 2) > 0xFFF) {
 		i = (0xFFF * 2 / srcPitch);
 		pOverlay->VUSF = 0xFFFF;
@@ -1544,18 +1483,6 @@ static void set_hue(uint8_t hue)
     setvideoreg(Index_VI_Hue, (hue & 0x08) ? (hue ^ 0x07) : hue);
 }
 
-#if 0
-/* JCP: not used (I don't think it's correct anyway) */
-static void set_alpha(uint8_t alpha)
-{
-    uint8_t data;
-
-    data = getvideoreg(Index_VI_Key_Overlay_OP);
-    data &= 0x0F;
-    setvideoreg(Index_VI_Key_Overlay_OP, data | (alpha << 4));
-}
-#endif
-
 VDXDriver sis_drv = {
   "sis",
   NULL,



More information about the MPlayer-cvslog mailing list