Skip to content

Commit

Permalink
Staging: xgifb: Remove code for WIN2000
Browse files Browse the repository at this point in the history
Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Arnaud Patard <apatard@mandriva.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Bill Pemberton authored and Greg Kroah-Hartman committed Jun 22, 2010
1 parent 23aada9 commit bf4fc6a
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 558 deletions.
17 changes: 0 additions & 17 deletions drivers/staging/xgifb/osdef.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#define _OSDEF_H_

/* #define WINCE_HEADER*/
/*#define WIN2000*/
/* #define TC */
#define LINUX_KERNEL
/* #define LINUX_XF86 */
Expand All @@ -16,8 +15,6 @@
/**********************************************************************/
#ifdef TC
#endif
#ifdef WIN2000
#endif
#ifdef WINCE_HEADER
#endif
#ifdef LINUX_XF86
Expand All @@ -31,9 +28,6 @@
#ifdef TC
#define XGI_SetMemory(MemoryAddress,MemorySize,value) memset(MemoryAddress, value, MemorySize);
#endif
#ifdef WIN2000
#define XGI_SetMemory(MemoryAddress,MemorySize,value) MemFill((PVOID) MemoryAddress,(ULONG) MemorySize,(UCHAR) value);
#endif
#ifdef WINCE_HEADER
#define XGI_SetMemory(MemoryAddress,MemorySize,value) memset(MemoryAddress, value, MemorySize);
#endif
Expand All @@ -50,9 +44,6 @@
#ifdef TC
#define XGI_MemoryCopy(Destination,Soruce,Length) memmove(Destination, Soruce, Length);
#endif
#ifdef WIN2000
#define XGI_MemoryCopy(Destination,Soruce,Length) /*VideoPortMoveMemory((PUCHAR)Destination , Soruce,length);*/
#endif
#ifdef WINCE_HEADER
#define XGI_MemoryCopy(Destination,Soruce,Length) memmove(Destination, Soruce, Length);
#endif
Expand Down Expand Up @@ -128,14 +119,6 @@
/* WIN 2000 */
/**********************************************************************/

#ifdef WIN2000
#define OutPortByte(p,v) VideoPortWritePortUchar ((PUCHAR) (p), (UCHAR) (v))
#define OutPortWord(p,v) VideoPortWritePortUshort((PUSHORT) (p), (USHORT) (v))
#define OutPortLong(p,v) VideoPortWritePortUlong ((PULONG) (p), (ULONG) (v))
#define InPortByte(p) VideoPortReadPortUchar ((PUCHAR) (p))
#define InPortWord(p) VideoPortReadPortUshort ((PUSHORT) (p))
#define InPortLong(p) VideoPortReadPortUlong ((PULONG) (p))
#endif


/**********************************************************************/
Expand Down
304 changes: 0 additions & 304 deletions drivers/staging/xgifb/vb_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,6 @@



#ifdef WIN2000

#include <dderror.h>
#include <devioctl.h>
#include <miniport.h>
#include <ntddvdeo.h>
#include <video.h>
#include "xgiv.h"
#include "dd_i2c.h"
#include "tools.h"
#endif /* WIN2000 */

#ifdef LINUX_XF86
#include "xf86.h"
Expand Down Expand Up @@ -42,9 +31,6 @@ extern UCHAR XGI330_OutputSelect;
extern USHORT XGI330_RGBSenseData2;
extern USHORT XGI330_YCSenseData2;
extern USHORT XGI330_VideoSenseData2;
#ifdef WIN2000
extern UCHAR SenseCHTV(PHW_DEVICE_EXTENSION pHWDE); /* 2007/05/17 Billy */
#endif
void XGI_GetSenseStatus( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_INFO pVBInfo );
BOOLEAN XGINew_GetPanelID(PVB_DEVICE_INFO pVBInfo);
USHORT XGINew_SenseLCD(PXGI_HW_DEVICE_INFO,PVB_DEVICE_INFO pVBInfo);
Expand All @@ -62,18 +48,6 @@ void XGI_WaitDisplay(void);
BOOLEAN XGI_Is301C(PVB_DEVICE_INFO);
BOOLEAN XGI_Is301LV(PVB_DEVICE_INFO);

#ifdef WIN2000
UCHAR XGI_SenseLCD(PHW_DEVICE_EXTENSION, PVB_DEVICE_INFO);
UCHAR XGI_GetLCDDDCInfo(PHW_DEVICE_EXTENSION,PVB_DEVICE_INFO);

extern BOOL bGetDdcInfo(
PHW_DEVICE_EXTENSION pHWDE,
ULONG ulWhichOne,
PUCHAR pjQueryBuffer,
ULONG ulBufferSize
);

#endif


/* --------------------------------------------------------------------- */
Expand Down Expand Up @@ -164,284 +138,6 @@ BOOLEAN XGINew_Sense( USHORT tempbx , USHORT tempcx, PVB_DEVICE_INFO pVBInfo )
return( 0 ) ;
}

#ifdef WIN2000
/* --------------------------------------------------------------------- */
/* Function : XGI_SenseLCD */
/* Input : */
/* Output : */
/* Description : */
/* --------------------------------------------------------------------- */
UCHAR XGI_SenseLCD( PHW_DEVICE_EXTENSION pHWDE, PVB_DEVICE_INFO pVBInfo)
{
USHORT tempax , tempbx , tempcx ;
UCHAR SoftSetting = XGI330_SoftSetting ;

if ( pVBInfo->VBType & ( VB_XGI301LV | VB_XGI302LV ) )
return( 1 ) ;


if ( SoftSetting & HotPlugFunction ) /* Hot Plug Detection */
{
XGINew_SetRegAND( pVBInfo->Part4Port , 0x0F , 0x3F ) ;
tempbx = 0 ;
tempcx = 0x9010 ;
if ( XGINew_Sense( tempbx , tempcx, pVBInfo ) )
return( 1 ) ;

return( 0 ) ;
}
else /* Get LCD Info from EDID */
return(XGI_GetLCDDDCInfo(pHWDE, pVBInfo));
}


/* --------------------------------------------------------------------- */
/* Function : XGI_GetLCDDDCInfo */
/* Input : */
/* Output : */
/* Description : */
/* --------------------------------------------------------------------- */
UCHAR XGI_GetLCDDDCInfo( PHW_DEVICE_EXTENSION pHWDE , PVB_DEVICE_INFO pVBInfo)
{
UCHAR tempah , tempbl , tempbh ;
USHORT tempbx , temp ;
UCHAR pjEDIDBuf[ 256 ] ;
ULONG ulBufferSize = 256 ;
UCHAR bMASK_OUTPUTSTATE_CRT2LCD = 2 ; /* 0423 shampoo */

bGetDdcInfo( pHWDE , MASK_OUTPUTSTATE_CRT2LCD , pjEDIDBuf , ulBufferSize ) ;
if ( ( *( ( PULONG )pjEDIDBuf ) == 0xFFFFFF00 ) && ( *( ( PULONG )( pjEDIDBuf + 4 ) ) == 0x00FFFFFF ) )
{
tempah = Panel1024x768 ;
tempbl=( *( pjEDIDBuf + 0x3A ) ) & 0xf0 ;

if ( tempbl != 0x40 )
{
tempah = Panel1600x1200 ;
if ( tempbl != 0x60 )
{
tempah = Panel1280x1024 ;
tempbh = ( *( pjEDIDBuf + 0x3B ) ) ;
if ( tempbh != 0x00 )
{
tempah = Panel1280x960 ;
if ( tempbh != 0x0C0 )
{
tempbx = ( ( *( pjEDIDBuf + 0x24 ) ) << 8 ) | ( *( pjEDIDBuf + 0x23 ) ) ;
tempah = Panel1280x1024 ;
if ( !( tempbx & 0x0100 ) )
{
tempah = Panel1024x768 ;
if ( !( tempbx & 0x0E00 ) )
{
tempah = Panel1280x1024 ;
}
}
}

if ( tempbx & 0x00FF )
{
temp = ScalingLCD ;
XGINew_SetRegOR( pVBInfo->P3d4 , 0x37 , temp ) ;
}
}
}
}
XGINew_SetRegANDOR( pVBInfo->P3d4 , 0x36 , ( ~0x07 ) , tempah ) ;
tempah = ( ( *( pjEDIDBuf + 0x47 ) ) & 0x06 ) ; /* Polarity */
tempah = ( tempah ^ 0x06 ) << 4 ;
tempah |= LCDSync ;
XGINew_SetRegANDOR( pVBInfo->P3d4 , 0x37 , ( ~LCDSyncBit ) , tempah ) ;
tempbh= XGINew_GetReg1( pVBInfo->P3d4 , 0x36 ) ;
tempbh &= 0x07 ;
if ( tempbh == Panel1280x960 )
XGINew_SetRegAND( pVBInfo->P3d4 , 0x37 , 0x0E ) ;
}
else if ( *pjEDIDBuf == 0x20 )
{
tempah = Panel1024x768 ;
XGINew_SetRegANDOR( pVBInfo->P3d4 , 0x36 , ( ~0x07 ) , tempah ) ;
}
else
{
return( 0 ) ;
}

return( 1 ) ;
}


/* --------------------------------------------------------------------- */
/* Function : XGI_DySense */
/* Input : */
/* Output : */
/* Description : */
/* --------------------------------------------------------------------- */
BOOLEAN XGI_DySense( PHW_DEVICE_EXTENSION pHWDE , PUCHAR ujConnectStatus)
{
UCHAR pre_CRD,pre_SR1E , pre_Part2_0 , pre_Part4_D ;
USHORT tempax , tempbx , tempcx , pushax , temp ;
VB_DEVICE_INFO VBINF;
PVB_DEVICE_INFO pVBInfo = &VBINF;
UCHAR OutputSelect = XGI330_OutputSelect ;
PXGI_HW_DEVICE_INFO HwDeviceExtension= pHWDE->pXGIHWDE ;
UCHAR bConnectStatus = 0 ;
pVBInfo->BaseAddr = HwDeviceExtension->pjIOAddress ;
pVBInfo->ROMAddr = pHWDE->pjVirtualRomBase ;

pVBInfo->P3c2 = pVBInfo->BaseAddr + 0x12 ;
pVBInfo->P3c4 = pVBInfo->BaseAddr + 0x14 ;
pVBInfo->P3d4 = pVBInfo->BaseAddr + 0x24 ;
pVBInfo->Part2Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_10 ;
pVBInfo->Part4Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_14 ;
pushax = XGINew_GetReg1( pVBInfo->P3d4 , 0x17 ) ; /* 0512 Fix Dysense hanged */
temp = ( pushax & 0x00FF ) | 0x80 ;
XGINew_SetRegOR( pVBInfo->P3d4 , 0x17 , temp ) ;
XGINew_SetReg1( pVBInfo->P3c4 , 0x05 , 0x86 ) ;
/* beginning of dynamic sense CRT1 */

pVBInfo->IF_DEF_CH7007 = 0;
if (pHWDE->bCH7007)
{
InitTo330Pointer( pHWDE->pXGIHWDE->jChipType, pVBInfo ) ;
HwDeviceExtension->pDevice = (PVOID)pHWDE;
pVBInfo->IF_DEF_CH7007 = 1;
/* [Billy] 2007/05/14 For CH7007 */
if ( pVBInfo->IF_DEF_CH7007 == 1 )
{
bConnectStatus = SenseCHTV(HwDeviceExtension->pDevice) ; /* 07/05/28 */
XGINew_SetRegANDOR( pVBInfo->P3d4 , 0x32 , ~0x03 , (UCHAR)bConnectStatus ) ;
}
}
if(( pHWDE->jChipID >= XG40 ) || ( pHWDE->jChipID >= XG20 ))
{

if ( pHWDE->jChipID >= XG40 )
XGINew_SetReg1( pVBInfo->P3d4 , 0x57 , 0x4A ) ; /* write sense pattern 30->4a */
else
XGINew_SetReg1( pVBInfo->P3d4 , 0x57 , 0x5F ) ; /* write sense pattern */

XGINew_SetRegANDOR( pVBInfo->P3d4 , 0x53 , 0xFF , 0x02 ) ; /* enable sense DAC */
XGI_WaitDisply(pVBInfo) ;

if(XGINew_GetReg2( pVBInfo->P3c2 ) & 0x10 )
bConnectStatus |= Monitor1Sense ;

XGINew_SetRegAND( pVBInfo->P3d4 , 0x53 , 0xFD ) ; /* disable sense DAC */
XGINew_SetRegAND( pVBInfo->P3d4 , 0x57 , 0x00 ) ; /* clear sense pattern */


/* ---------- End of dynamic sense CRT1 ----------- */

/* ---------- beginning of dynamic sense VB ------------ */
pre_SR1E = XGINew_GetReg1( pVBInfo->P3c4 , 0x1E ) ;
XGINew_SetRegOR( pVBInfo->P3c4 , 0x1E , 0x20 ) ; /* Enable CRT2,work-a-round for 301B/301LV/302LV */
pre_Part2_0 = XGINew_GetReg1( pVBInfo->Part2Port , 0x00 ) ;
pre_Part4_D = XGINew_GetReg1( pVBInfo->Part4Port , 0x0D ) ;

if ( XGI_Is301C( pVBInfo ) ) /* 301C only */
XGINew_SetRegANDOR( pVBInfo->Part4Port , 0x0D , ~0x07 , 0x01 ) ; /* Set Part4 0x0D D[2:0] to 001b */

/* tempax = 0 ; */
if ( !XGI_Is301LV( pVBInfo ) )
{
tempbx = XGI330_RGBSenseData2 ;
tempcx = 0x0E08 ;
if(XGINew_Sense( tempbx , tempcx, pVBInfo ) )
{
bConnectStatus |= Monitor2Sense ;
if ( OutputSelect & SetSCARTOutput )
{
bConnectStatus ^= ( Monitor2Sense | SCARTSense ) ;
}
}
}
if ( XGI_Is301C( pVBInfo ) ) /* 301C only */
XGINew_SetRegOR( pVBInfo->Part4Port , 0x0D , 0x04 ) ; /* Set Part4 0x0D D[2]=1 for dynamic sense */

if ( ( XGINew_Is301B( pVBInfo ) ) )
XGINew_SetRegOR( pVBInfo->Part2Port , 0x00 , 0x0C ) ; /* ????????? */

if ( XGINew_SenseHiTV( HwDeviceExtension , pVBInfo) ) /* add by kuku for Dysense HiTV //start */
{
bConnectStatus|= YPbPrSense ;
}
else
{
tempbx = XGI330_YCSenseData2 ; /* Y/C Sense Data Ptr */
tempcx = 0x0604 ;
if ( XGINew_Sense( tempbx , tempcx , pVBInfo) )
bConnectStatus |= SVIDEOSense ;

if ( OutputSelect & BoardTVType )
{
tempbx = XGI330_VideoSenseData2 ;
tempcx = 0x0804 ;
if ( XGINew_Sense(tempbx , tempcx, pVBInfo) )
bConnectStatus|= AVIDEOSense ;
}
else
{
if ( !( bConnectStatus & SVIDEOSense ) )
{
tempbx = XGI330_VideoSenseData2 ;
tempcx = 0x0804 ;
if ( XGINew_Sense( tempbx , tempcx, pVBInfo ) )
bConnectStatus |= AVIDEOSense ;
}
}
} /* end */
/* DySenseVBCnt */

tempbx = 0 ;
tempcx = 0 ;
XGINew_Sense(tempbx , tempcx, pVBInfo ) ;

if ( !( bConnectStatus & Monitor2Sense ) )
{
if ( XGI_SenseLCD( pHWDE , pVBInfo ) )
bConnectStatus |= LCDSense ;
}

XGINew_SetRegANDOR( pVBInfo->P3d4 , 0x32 , ~( AVIDEOSense | SVIDEOSense | LCDSense | Monitor2Sense | Monitor1Sense ) , bConnectStatus ) ;

XGINew_SetReg1( pVBInfo->Part4Port , 0x0D , pre_Part4_D ) ;
XGINew_SetReg1( pVBInfo->Part2Port , 0x00 , pre_Part2_0 ) ;
XGINew_SetReg1( pVBInfo->P3c4 , 0x1E , pre_SR1E ) ;

if ( XGI_Is301C( pVBInfo ) ) /* 301C only */
{
tempax = XGINew_GetReg1( pVBInfo->Part2Port , 0x00 ) ;
if ( tempax & 0x20 )
{
/* Reset VBPro */
for( tempcx = 2 ; tempcx > 0 ; tempcx-- )
{
tempax ^= 0x20 ;
XGINew_SetReg1( pVBInfo->Part2Port , 0x00 , tempax ) ;
}
}
}
/* End of dynamic sense VB */
}
else
{
XGI_SenseCRT1(pVBInfo) ;
XGI_GetSenseStatus( HwDeviceExtension, pVBInfo ) ; /* sense CRT2 */
bConnectStatus = XGINew_GetReg1( pVBInfo->P3d4 , 0x32 ) ;
}
temp = pushax & 0x00FF ; /* 0512 Fix Dysense hanged */
XGINew_SetReg1( pVBInfo->P3d4 , 0x17 , temp ) ;
if ( bConnectStatus )
{
*ujConnectStatus = bConnectStatus ;
return( 1 ) ;
}
else
return( 0 ) ;
}

#endif /* WIN2000 */

/* --------------------------------------------------------------------- */
/* Function : XGISetDPMS */
Expand Down
3 changes: 0 additions & 3 deletions drivers/staging/xgifb/vb_ext.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,5 @@ extern void XGI_GetSenseStatus( PXGI_HW_DEVICE_INFO HwDeviceExtension , PV
extern void XGINew_SetModeScratch ( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_INFO pVBInfo ) ;
extern void ReadVBIOSTablData( UCHAR ChipType , PVB_DEVICE_INFO pVBInfo);
extern USHORT XGINew_SenseLCD(PXGI_HW_DEVICE_INFO,PVB_DEVICE_INFO pVBInfo);
#ifdef WIN2000
extern BOOLEAN XGI_DySense( PHW_DEVICE_EXTENSION pHWDE , PUCHAR ujConnectStatus );
#endif /* WIN2000 */

#endif
Loading

0 comments on commit bf4fc6a

Please sign in to comment.