static void
s3v_I2CPutBits(I2CBusPtr b, int clock,  int data)
{
    S3VPtr ps3v = S3VPTR(xf86Screens[b->scrnIndex]);
    unsigned int reg = 0x10;

    if(clock) reg |= 0x1;
    if(data)  reg |= 0x2;

    OUTREG(DDC_REG,reg);
    /*ErrorF("s3v_I2CPutBits: %d %d\n", clock, data); */
}
static void
s3v_I2CGetBits(I2CBusPtr b, int *clock, int *data)
{
    S3VPtr ps3v = S3VPTR(xf86Screens[b->scrnIndex]);
    unsigned int reg;

    reg = (INREG(DDC_REG));

    *clock = reg & 0x4;
    *data = reg & 0x8;

    /*ErrorF("s3v_I2CGetBits: %d %d\n", *clock, *data);*/
}
示例#3
0
int S3VQueryXvCapable(ScrnInfoPtr pScrn)
{
  S3VPtr ps3v = S3VPTR(pScrn);

  if(
     ((pScrn->bitsPerPixel == 24) || 
      (pScrn->bitsPerPixel == 16)
      ) 
     &&
     ((ps3v->Chipset == S3_ViRGE_DXGX)  || 
      S3_ViRGE_MX_SERIES(ps3v->Chipset) || 
      S3_ViRGE_GX2_SERIES(ps3v->Chipset)
      ))
    return TRUE;
  else
    return FALSE;
}
Bool
S3V_I2CInit(ScrnInfoPtr pScrn)
{
    S3VPtr ps3v = S3VPTR(pScrn);
    I2CBusPtr I2CPtr;


    I2CPtr = xf86CreateI2CBusRec();
    if(!I2CPtr) return FALSE;

    ps3v->I2C = I2CPtr;

    I2CPtr->BusName    = "I2C bus";
    I2CPtr->scrnIndex  = pScrn->scrnIndex;
    I2CPtr->I2CPutBits = s3v_I2CPutBits;
    I2CPtr->I2CGetBits = s3v_I2CGetBits;

    if (!xf86I2CBusInit(I2CPtr))
        return FALSE;

    return TRUE;
}
示例#5
0
void S3VInitVideo(ScreenPtr pScreen)
{
    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
    XF86VideoAdaptorPtr *adaptors, *newAdaptors = NULL;
    XF86VideoAdaptorPtr newAdaptor = NULL;
    S3VPtr ps3v = S3VPTR(pScrn);
    int num_adaptors;

    if(
       ((pScrn->bitsPerPixel == 24) || 
	(pScrn->bitsPerPixel == 16)
	) 
       &&
       ((ps3v->Chipset == S3_ViRGE_DXGX)  || 
	S3_ViRGE_MX_SERIES(ps3v->Chipset) || 
	S3_ViRGE_GX2_SERIES(ps3v->Chipset) /* || */
	/* (ps3v->Chipset == S3_ViRGE) */
	)
       && !ps3v->NoAccel
       && ps3v->XVideo
       )
    {
#if 0
	if((pMga->Overlay8Plus24 /* || dualhead */ || pMga->TexturedVideo) &&
	   (pScrn->bitsPerPixel != 24))
        {
	    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Using texture video\n");
	    newAdaptor = MGASetupImageVideoTexture(pScreen);
	    pMga->TexturedVideo = TRUE;
	} else {
#endif

	    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Using overlay video\n");
	    newAdaptor = S3VSetupImageVideoOverlay(pScreen);

#if 0
	    pMga->TexturedVideo = FALSE;
	}*/

	if(!pMga->Overlay8Plus24 /* && !dualhead */)	  
	  S3VInitOffscreenImages(pScreen);
	pMga->BlockHandler = pScreen->BlockHandler;
	pScreen->BlockHandler = MGABlockHandler;
#endif
    }
    

    num_adaptors = xf86XVListGenericAdaptors(pScrn, &adaptors);

    if(newAdaptor) {
	if(!num_adaptors) {
	    num_adaptors = 1;
	    adaptors = &newAdaptor;
	} else {
	    newAdaptors =  /* need to free this someplace */
		xalloc((num_adaptors + 1) * sizeof(XF86VideoAdaptorPtr*));
	    if(newAdaptors) {
		memcpy(newAdaptors, adaptors, num_adaptors * 
					sizeof(XF86VideoAdaptorPtr));
		newAdaptors[num_adaptors] = newAdaptor;
		adaptors = newAdaptors;
		num_adaptors++;
	    }
	}
    }

    if(num_adaptors)
        xf86XVScreenInit(pScreen, adaptors, num_adaptors);

    if(newAdaptors)
	xfree(newAdaptors);
}