From fb9776494a71f789eed56548463adffc778a2244 Mon Sep 17 00:00:00 2001 From: Paulo Cesar Pereira de Andrade Date: Wed, 5 Mar 2008 19:53:05 -0300 Subject: [PATCH] Fix compile warnings. By adding prototypes, including headers, type casting, etc. Remaining warnings are about no prototype for RegionsEqual and usage of deprecated libpciaccess functions. --- src/vb_ext.c | 2 +- src/vb_init.c | 112 ++++++++++++++++++++++++++++++---------------------- src/vb_setmode.c | 29 +++++++++----- src/xgi.h | 7 ++- src/xgi_accel.h | 4 ++ src/xgi_dri.c | 8 ++-- src/xgi_driver.c | 12 +++-- src/xgi_setup.c | 7 +-- src/xgi_video.c | 39 ++++++++++-------- src/xgi_videohw.c | 17 ++++++-- src/xgi_videohw.h | 4 ++ 11 files changed, 147 insertions(+), 94 deletions(-) diff --git a/src/vb_ext.c b/src/vb_ext.c index fa2a4f3..37d471b 100644 --- a/src/vb_ext.c +++ b/src/vb_ext.c @@ -115,7 +115,7 @@ void XGI_GetSenseStatus( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_INFO USHORT tempax = 0 , tempbx , tempcx , temp , P2reg0 = 0 , SenseModeNo = 0 , OutputSelect = pVBInfo->OutputSelect, ModeIdIndex , i ; - pVBInfo->BaseAddr = ( USHORT )HwDeviceExtension->pjIOAddress ; + pVBInfo->BaseAddr = ( USHORT )(unsigned long)HwDeviceExtension->pjIOAddress ; { /* for 301 */ if ( pVBInfo->VBInfo & SetCRT2ToHiVisionTV ) diff --git a/src/vb_init.c b/src/vb_init.c index 9ba85bb..d446e35 100644 --- a/src/vb_init.c +++ b/src/vb_init.c @@ -108,46 +108,46 @@ static const USHORT XGINew_DDRDRAM_TYPE340[4][5]= static void XGINew_SetDRAMSize_340(PXGI_HW_DEVICE_INFO, PVB_DEVICE_INFO); static void XGINew_SetDRAMSize_XG45(PXGI_HW_DEVICE_INFO, PVB_DEVICE_INFO); static void XGINew_SetMemoryClock(PXGI_HW_DEVICE_INFO, PVB_DEVICE_INFO); -static void XGINew_SetDRAMModeRegister340(PXGI_HW_DEVICE_INFO, PVB_DEVICE_INFO); +/* static void XGINew_SetDRAMModeRegister340(PXGI_HW_DEVICE_INFO, PVB_DEVICE_INFO); */ static void XGINew_SetDRAMDefaultRegister340(PXGI_HW_DEVICE_INFO, USHORT, PVB_DEVICE_INFO); static void XGINew_SetDRAMDefaultRegisterXG45(PXGI_HW_DEVICE_INFO, USHORT, PVB_DEVICE_INFO); static UCHAR XGINew_Get340DRAMType(PXGI_HW_DEVICE_INFO, PVB_DEVICE_INFO); -static int XGINew_SetDDRChannel(int index, UCHAR ChannelNo, +/* static int XGINew_SetDDRChannel(int index, UCHAR ChannelNo, UCHAR XGINew_ChannelAB, const USHORT DRAMTYPE_TABLE[][5], - PVB_DEVICE_INFO pVBInfo); + PVB_DEVICE_INFO pVBInfo); */ static void XGINew_SetDRAMSizingType(int index , const USHORT DRAMTYPE_TABLE[][5], PVB_DEVICE_INFO pVBInfo); static USHORT XGINew_SetDRAMSizeReg(int index, const USHORT DRAMTYPE_TABLE[][5], PVB_DEVICE_INFO pVBInfo); -static int XGINew_SetRank(int index, UCHAR RankNo, UCHAR XGINew_ChannelAB, - const USHORT DRAMTYPE_TABLE[][5], PVB_DEVICE_INFO pVBInfo); +/* static int XGINew_SetRank(int index, UCHAR RankNo, UCHAR XGINew_ChannelAB, + const USHORT DRAMTYPE_TABLE[][5], PVB_DEVICE_INFO pVBInfo); */ -static int XGINew_CheckRanks(int RankNo, int index, - const USHORT DRAMTYPE_TABLE[][5], PVB_DEVICE_INFO pVBInfo); -static int XGINew_CheckRank(int RankNo, int index, - const USHORT DRAMTYPE_TABLE[][5], PVB_DEVICE_INFO pVBInfo); -static int XGINew_CheckDDRRank(int RankNo, int index, - const USHORT DRAMTYPE_TABLE[][5], PVB_DEVICE_INFO pVBInfo); -static int XGINew_CheckDDRRanks(int RankNo, int index, - const USHORT DRAMTYPE_TABLE[][5], PVB_DEVICE_INFO pVBInfo); +/* static int XGINew_CheckRanks(int RankNo, int index, + const USHORT DRAMTYPE_TABLE[][5], PVB_DEVICE_INFO pVBInfo); */ +/* static int XGINew_CheckRank(int RankNo, int index, + const USHORT DRAMTYPE_TABLE[][5], PVB_DEVICE_INFO pVBInfo); */ +/* static int XGINew_CheckDDRRank(int RankNo, int index, + const USHORT DRAMTYPE_TABLE[][5], PVB_DEVICE_INFO pVBInfo); */ +/* static int XGINew_CheckDDRRanks(int RankNo, int index, + const USHORT DRAMTYPE_TABLE[][5], PVB_DEVICE_INFO pVBInfo); */ -static int XGINew_CheckBanks(int index, const USHORT DRAMTYPE_TABLE[][5], - PVB_DEVICE_INFO pVBInfo); -static int XGINew_CheckColumn(int index, const USHORT DRAMTYPE_TABLE[][5], - PVB_DEVICE_INFO pVBInfo); +/* static int XGINew_CheckBanks(int index, const USHORT DRAMTYPE_TABLE[][5], + PVB_DEVICE_INFO pVBInfo); */ +/* static int XGINew_CheckColumn(int index, const USHORT DRAMTYPE_TABLE[][5], + PVB_DEVICE_INFO pVBInfo); */ static int XGINew_DDRSizing340(PXGI_HW_DEVICE_INFO, PVB_DEVICE_INFO); static int XGINew_DDRSizingXG45(PXGI_HW_DEVICE_INFO, PVB_DEVICE_INFO); -static int XGINew_SDRSizing(PVB_DEVICE_INFO); -static int XGINew_DDRSizing(PVB_DEVICE_INFO); +/* static int XGINew_SDRSizing(PVB_DEVICE_INFO); */ +/* static int XGINew_DDRSizing(PVB_DEVICE_INFO); */ -static void XGINew_DDR_MRS(PVB_DEVICE_INFO pVBInfo); -static void XGINew_SDR_MRS(PVB_DEVICE_INFO pVBInfo); +/* static void XGINew_DDR_MRS(PVB_DEVICE_INFO pVBInfo); */ +/* static void XGINew_SDR_MRS(PVB_DEVICE_INFO pVBInfo); */ static void XGINew_DDR1x_MRS_340(PXGI_HW_DEVICE_INFO HwDeviceExtension, USHORT P3c4, PVB_DEVICE_INFO pVBInfo); static void XGINew_DDR2x_MRS_340(PXGI_HW_DEVICE_INFO HwDeviceExtension, @@ -161,18 +161,18 @@ static void XGINew_DDR2x_DefaultRegister(PXGI_HW_DEVICE_INFO HwDeviceExtension, static void XGINew_DDR2_DefaultRegister(PXGI_HW_DEVICE_INFO HwDeviceExtension, USHORT Port, PVB_DEVICE_INFO pVBInfo); -static void XGINew_DisableChannelInterleaving(int index, - const USHORT XGINew_DDRDRAM_TYPE[][5], PVB_DEVICE_INFO pVBInfo); +/* static void XGINew_DisableChannelInterleaving(int index, + const USHORT XGINew_DDRDRAM_TYPE[][5], PVB_DEVICE_INFO pVBInfo); */ static void DualChipInit(PXGI_HW_DEVICE_INFO, PVB_DEVICE_INFO); -static void XGINew_DisableRefresh(PXGI_HW_DEVICE_INFO ,PVB_DEVICE_INFO); -static void XGINew_EnableRefresh(PXGI_HW_DEVICE_INFO, PVB_DEVICE_INFO); +/* static void XGINew_DisableRefresh(PXGI_HW_DEVICE_INFO ,PVB_DEVICE_INFO); */ +/* static void XGINew_EnableRefresh(PXGI_HW_DEVICE_INFO, PVB_DEVICE_INFO); */ -static void XGINew_Delay15us(ULONG); +/* static void XGINew_Delay15us(ULONG); */ static void SetPowerConsume(PXGI_HW_DEVICE_INFO, USHORT); static void XGINew_DDR1x_MRS_XG20(USHORT, PVB_DEVICE_INFO); -static void XGINew_SetDRAMModeRegister_XG20(PXGI_HW_DEVICE_INFO, PVB_DEVICE_INFO); +/* static void XGINew_SetDRAMModeRegister_XG20(PXGI_HW_DEVICE_INFO, PVB_DEVICE_INFO); */ static void XGINew_ChkSenseStatus(PXGI_HW_DEVICE_INFO, PVB_DEVICE_INFO); static int XGINew_ReadWriteRest( USHORT StopAddr, USHORT StartAddr, @@ -593,7 +593,7 @@ void DualChipInit( PXGI_HW_DEVICE_INFO HwDeviceExtension ,PVB_DEVICE_INFO pVBInf UCHAR tempal , i ; pVBInfo->ROMAddr = HwDeviceExtension->pjVirtualRomBase ; - pVBInfo->BaseAddr = (USHORT)HwDeviceExtension->pjIOAddress ; + pVBInfo->BaseAddr = (USHORT)(unsigned long)HwDeviceExtension->pjIOAddress ; /* Programming Congiguration Space in Secondary Chip */ /* set CRA1 D[6] = 1 */ XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3d4 , 0xA1 , 0xBF , 0x40 ) ; @@ -752,6 +752,7 @@ void XGINew_Delay15us(ULONG ulMicrsoSec) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ +#if 0 void XGINew_SDR_MRS(PVB_DEVICE_INFO pVBInfo) { USHORT data ; @@ -764,7 +765,7 @@ void XGINew_SDR_MRS(PVB_DEVICE_INFO pVBInfo) XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4 , 0x16 , data ) ; /* enable mode register set(MRS) high */ /* XGINew_Delay15us( 0x100 ) ; */ } - +#endif /* --------------------------------------------------------------------- */ /* Function : XGINew_DDR1x_MRS_340 */ @@ -1334,6 +1335,7 @@ void XGINew_SetDRAMDefaultRegisterXG45( PXGI_HW_DEVICE_INFO HwDeviceExtension , /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ +#if 0 void XGINew_DDR_MRS(PVB_DEVICE_INFO pVBInfo) { USHORT data ; @@ -1390,7 +1392,7 @@ void XGINew_DDR_MRS(PVB_DEVICE_INFO pVBInfo) } */ } - +#endif /* --------------------------------------------------------------------- */ /* Function : XGINew_SetDRAMSize_340 */ @@ -1454,7 +1456,7 @@ void XGINew_SetDRAMSize_XG45( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ - +/* void XGINew_SetDRAMModeRegister340(PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo) { @@ -1480,7 +1482,7 @@ void XGINew_SetDRAMModeRegister340(PXGI_HW_DEVICE_INFO HwDeviceExtension, XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4 , 0x1B , 0x03 ) ; } - + */ /* --------------------------------------------------------------------- */ /* Function : XGINew_DisableRefresh */ @@ -1488,6 +1490,7 @@ void XGINew_SetDRAMModeRegister340(PXGI_HW_DEVICE_INFO HwDeviceExtension, /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ +/* void XGINew_DisableRefresh( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_INFO pVBInfo) { USHORT data ; @@ -1498,7 +1501,7 @@ void XGINew_DisableRefresh( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_I XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4 , 0x1B , data ) ; } - + */ /* --------------------------------------------------------------------- */ /* Function : XGINew_EnableRefresh */ @@ -1506,13 +1509,13 @@ void XGINew_DisableRefresh( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_I /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ +#if 0 void XGINew_EnableRefresh( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_INFO pVBInfo) { XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4 , 0x1B , pVBInfo->SR15[ 3 ][ XGINew_RAMType ] ) ; /* SR1B */ - - } +#endif /* --------------------------------------------------------------------- */ @@ -1521,6 +1524,7 @@ void XGINew_EnableRefresh( PXGI_HW_DEVICE_INFO HwDeviceExtension , PVB_DEVICE_IN /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ +/* void XGINew_DisableChannelInterleaving(int index, const USHORT XGINew_DDRDRAM_TYPE[][5], PVB_DEVICE_INFO pVBInfo) @@ -1549,7 +1553,7 @@ void XGINew_DisableChannelInterleaving(int index, } XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4 , 0x15 , data ) ; } - + */ /* --------------------------------------------------------------------- */ /* Function : XGINew_SetDRAMSizingType */ @@ -1574,6 +1578,7 @@ void XGINew_SetDRAMSizingType(int index , const USHORT DRAMTYPE_TABLE[][5], /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ +#if 0 int XGINew_SetRank(int index, UCHAR RankNo, UCHAR XGINew_ChannelAB, const USHORT DRAMTYPE_TABLE[][5], PVB_DEVICE_INFO pVBInfo) { @@ -1604,7 +1609,7 @@ int XGINew_SetRank(int index, UCHAR RankNo, UCHAR XGINew_ChannelAB, else return( 0 ) ; } - +#endif /* --------------------------------------------------------------------- */ /* Function : XGINew_SetDDRChannel */ @@ -1612,6 +1617,7 @@ int XGINew_SetRank(int index, UCHAR RankNo, UCHAR XGINew_ChannelAB, /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ +#if 0 int XGINew_SetDDRChannel(int index, UCHAR ChannelNo, UCHAR XGINew_ChannelAB, const USHORT DRAMTYPE_TABLE[][5], PVB_DEVICE_INFO pVBInfo) @@ -1642,7 +1648,7 @@ int XGINew_SetDDRChannel(int index, UCHAR ChannelNo, UCHAR XGINew_ChannelAB, else return( 0 ) ; } - +#endif /* --------------------------------------------------------------------- */ /* Function : XGINew_CheckColumn */ @@ -1650,6 +1656,7 @@ int XGINew_SetDDRChannel(int index, UCHAR ChannelNo, UCHAR XGINew_ChannelAB, /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ +#if 0 int XGINew_CheckColumn(int index, const USHORT DRAMTYPE_TABLE[][5], PVB_DEVICE_INFO pVBInfo) { @@ -1674,7 +1681,7 @@ int XGINew_CheckColumn(int index, const USHORT DRAMTYPE_TABLE[][5], } return( 1 ) ; } - +#endif /* --------------------------------------------------------------------- */ /* Function : XGINew_CheckBanks */ @@ -1682,6 +1689,7 @@ int XGINew_CheckColumn(int index, const USHORT DRAMTYPE_TABLE[][5], /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ +#if 0 int XGINew_CheckBanks(int index, const USHORT DRAMTYPE_TABLE[][5], PVB_DEVICE_INFO pVBInfo) { @@ -1706,7 +1714,7 @@ int XGINew_CheckBanks(int index, const USHORT DRAMTYPE_TABLE[][5], } return( 1 ) ; } - +#endif /* --------------------------------------------------------------------- */ /* Function : XGINew_CheckRank */ @@ -1714,6 +1722,7 @@ int XGINew_CheckBanks(int index, const USHORT DRAMTYPE_TABLE[][5], /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ +#if 0 int XGINew_CheckRank(int RankNo, int index, const USHORT DRAMTYPE_TABLE[][5], PVB_DEVICE_INFO pVBInfo) { @@ -1741,7 +1750,7 @@ int XGINew_CheckRank(int RankNo, int index, const USHORT DRAMTYPE_TABLE[][5], } return( 1 ); } - +#endif /* --------------------------------------------------------------------- */ /* Function : XGINew_CheckDDRRank */ @@ -1749,6 +1758,7 @@ int XGINew_CheckRank(int RankNo, int index, const USHORT DRAMTYPE_TABLE[][5], /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ +/* int XGINew_CheckDDRRank(int RankNo, int index, const USHORT DRAMTYPE_TABLE[][5], PVB_DEVICE_INFO pVBInfo) @@ -1785,7 +1795,7 @@ int XGINew_CheckDDRRank(int RankNo, int index, return( 1 ) ; } - + */ /* --------------------------------------------------------------------- */ /* Function : XGINew_CheckRanks */ @@ -1793,6 +1803,7 @@ int XGINew_CheckDDRRank(int RankNo, int index, /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ +/* int XGINew_CheckRanks(int RankNo, int index, const USHORT DRAMTYPE_TABLE[][5], PVB_DEVICE_INFO pVBInfo) { @@ -1812,7 +1823,7 @@ int XGINew_CheckRanks(int RankNo, int index, const USHORT DRAMTYPE_TABLE[][5], return( 1 ) ; } - + */ /* --------------------------------------------------------------------- */ /* Function : XGINew_CheckDDRRanks */ @@ -1820,6 +1831,7 @@ int XGINew_CheckRanks(int RankNo, int index, const USHORT DRAMTYPE_TABLE[][5], /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ +/* int XGINew_CheckDDRRanks(int RankNo, int index, const USHORT DRAMTYPE_TABLE[][5], PVB_DEVICE_INFO pVBInfo) @@ -1840,7 +1852,7 @@ int XGINew_CheckDDRRanks(int RankNo, int index, return( 1 ) ; } - + */ /* --------------------------------------------------------------------- */ /* Function : */ @@ -1848,7 +1860,8 @@ int XGINew_CheckDDRRanks(int RankNo, int index, /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -int XGINew_SDRSizing(PVB_DEVICE_INFO pVBInfo) +/* +static int XGINew_SDRSizing(PVB_DEVICE_INFO pVBInfo) { int i ; UCHAR j ; @@ -1870,6 +1883,7 @@ int XGINew_SDRSizing(PVB_DEVICE_INFO pVBInfo) } return( 0 ) ; } + */ /* --------------------------------------------------------------------- */ @@ -2409,6 +2423,7 @@ int XGINew_DDRSizingXG45( PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ +/* int XGINew_DDRSizing(PVB_DEVICE_INFO pVBInfo) { int i ; @@ -2432,6 +2447,7 @@ int XGINew_DDRSizing(PVB_DEVICE_INFO pVBInfo) } return( 0 ) ; } + */ /* --------------------------------------------------------------------- */ /* Function : XGINew_SetMemoryClock */ @@ -2511,8 +2527,8 @@ void XGINew_InitVBIOSData(PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO /* ULONG ROMAddr = (ULONG)HwDeviceExtension->pjVirtualRomBase; */ pVBInfo->ROMAddr = HwDeviceExtension->pjVirtualRomBase ; pVBInfo->FBAddr = HwDeviceExtension->pjVideoMemoryAddress ; - pVBInfo->BaseAddr = ( USHORT )HwDeviceExtension->pjIOAddress ; - pVBInfo->RelIO = HwDeviceExtension->pjIOAddress - 0x30; + pVBInfo->BaseAddr = ( USHORT )(unsigned long)HwDeviceExtension->pjIOAddress ; + pVBInfo->RelIO = (unsigned long)(HwDeviceExtension->pjIOAddress - 0x30); pVBInfo->ISXPDOS = 0 ; pVBInfo->P3c4 = pVBInfo->BaseAddr + 0x14 ; @@ -2786,6 +2802,7 @@ void XGINew_DDR1x_MRS_XG20( USHORT P3c4 , PVB_DEVICE_INFO pVBInfo) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ +/* void XGINew_SetDRAMModeRegister_XG20(PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo) { @@ -2802,6 +2819,7 @@ void XGINew_SetDRAMModeRegister_XG20(PXGI_HW_DEVICE_INFO HwDeviceExtension, XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4 , 0x1B , 0x03 ) ; } + */ /* -------------------------------------------------------- */ /* Function : XGINew_ChkSenseStatus */ diff --git a/src/vb_setmode.c b/src/vb_setmode.c index 11431ce..027672c 100644 --- a/src/vb_setmode.c +++ b/src/vb_setmode.c @@ -70,6 +70,9 @@ BOOLEAN XGI_AjustCRT2Rate(USHORT ModeNo, USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo); BOOLEAN XGI_GetLCDInfo(USHORT ModeNo, USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo); +/* static BOOLEAN XGINew_CheckMemorySize(PXGI_HW_DEVICE_INFO HwDeviceExtension, + USHORT ModeNo, USHORT ModeIdIndex, + PVB_DEVICE_INFO pVBInfo); */ BOOLEAN XGI_BridgeIsOn(PVB_DEVICE_INFO pVBInfo); USHORT XGI_GetOffset(USHORT ModeNo, USHORT ModeIdIndex, USHORT RefreshRateTableIndex, @@ -151,6 +154,7 @@ void XGI_SetCRT1VCLK(USHORT ModeNo, USHORT ModeIdIndex, USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo); void XGI_SetCRT1FIFO(USHORT ModeNo, PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo); +static void XGI_SetCRT2FIFO(PVB_DEVICE_INFO pVBInfo); void XGI_SetCRT1ModeRegs(PXGI_HW_DEVICE_INFO HwDeviceExtension, USHORT ModeNo, USHORT ModeIdIndex, USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo); @@ -220,6 +224,10 @@ void XGI_SetCRT1Offset(USHORT ModeNo, USHORT ModeIdIndex, USHORT RefreshRateTableIndex, PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo); +static void XGI_SetCRT2Offset(USHORT ModeNo, USHORT ModeIdIndex, + USHORT RefreshRateTableIndex, + PXGI_HW_DEVICE_INFO HwDeviceExtension, + PVB_DEVICE_INFO pVBInfo); static void XGI_GetLCDVCLKPtr(UCHAR *di, PVB_DEVICE_INFO pVBInfo); static unsigned XGI_GetVCLKPtr(USHORT RefreshRateTableIndex, USHORT ModeNo, USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo); @@ -307,8 +315,8 @@ InitTo330Pointer(UCHAR ChipType, PVB_DEVICE_INFO pVBInfo) (void) memcpy(pVBInfo->ECLKData, XGI330_ECLKData, sizeof(XGI330_ECLKData)); } - pVBInfo->VCLKData = XGI_VCLKData; - pVBInfo->VBVCLKData = XGI_VBVCLKData; + pVBInfo->VCLKData = (const XGI_VCLKDataStruct *)XGI_VCLKData; + pVBInfo->VBVCLKData = (const XGI_VBVCLKDataStruct *)XGI_VBVCLKData; pVBInfo->ScreenOffset = XGI330_ScreenOffset; pVBInfo->StResInfo = XGI330_StResInfo; pVBInfo->ModeResInfo = XGI330_ModeResInfo; @@ -2919,7 +2927,8 @@ XGI_GetLCDInfo(USHORT ModeNo, USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -BOOLEAN +#if 0 +static BOOLEAN XGINew_CheckMemorySize(PXGI_HW_DEVICE_INFO HwDeviceExtension, USHORT ModeNo, USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo) { @@ -2975,7 +2984,7 @@ XGINew_CheckMemorySize(PXGI_HW_DEVICE_INFO HwDeviceExtension, USHORT ModeNo, else return (TRUE); } - +#endif /* --------------------------------------------------------------------- */ /* Function : XGI_DisplayOn */ @@ -3176,7 +3185,7 @@ SetDualChipRegs(PXGI_HW_DEVICE_INFO HwDeviceExtension, USHORT XGINew_2ndP3C4 = BaseAddr2nd + SEQ_ADDRESS_PORT; USHORT XGINew_2ndP3C2 = BaseAddr2nd + MISC_OUTPUT_REG_WRITE_PORT; UCHAR tempal, i; - pVBInfo->BaseAddr = (USHORT) HwDeviceExtension->pjIOAddress; + pVBInfo->BaseAddr = (USHORT) (unsigned long)HwDeviceExtension->pjIOAddress; for (i = 0x00; i <= 0x04; i++) { /* SR0 - SR4 */ tempal = (UCHAR) XGI_GetReg((XGIIOADDRESS) pVBInfo->P3c4, i); XGI_SetReg((XGIIOADDRESS) XGINew_2ndP3C4, i, tempal); @@ -3751,7 +3760,7 @@ XGI_GetVCLKLen(unsigned vclkindex, UCHAR *di, PVB_DEVICE_INFO pVBInfo) /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void +static void XGI_SetCRT2Offset(USHORT ModeNo, USHORT ModeIdIndex, USHORT RefreshRateTableIndex, PXGI_HW_DEVICE_INFO HwDeviceExtension, @@ -3821,7 +3830,7 @@ XGI_GetOffset(USHORT ModeNo, USHORT ModeIdIndex, USHORT RefreshRateTableIndex, /* Output : */ /* Description : */ /* --------------------------------------------------------------------- */ -void +static void XGI_SetCRT2FIFO(PVB_DEVICE_INFO pVBInfo) { XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x01, 0x3B); /* threshold high ,disable auto threshold */ @@ -7445,9 +7454,9 @@ XGI_GetTVPtrIndex2(USHORT * tempbx, UCHAR * tempcl, UCHAR * tempch, } if (pVBInfo-> - VBType & (VB_XGI301B | VB_XGI302B | VB_XGI301LV | VB_XGI302LV | - VB_XGI301C)) - *tempch++; + VBType & (VB_XGI301B | VB_XGI302B | VB_XGI301LV | VB_XGI302LV | + VB_XGI301C)) + ++*tempch; } diff --git a/src/xgi.h b/src/xgi.h index 0f016d2..3d7c7fb 100644 --- a/src/xgi.h +++ b/src/xgi.h @@ -120,6 +120,8 @@ #include "xgi_dri.h" #endif +#include + #ifdef XSERVER_LIBPCIACCESS #define VENDOR_ID(p) (p)->vendor_id #define DEVICE_ID(p) (p)->device_id @@ -587,7 +589,7 @@ typedef struct { unsigned int agpWantedPages; #ifdef XF86DRI - unsigned long agpHandle; + drm_handle_t agpHandle; unsigned long agpAddr; unsigned char *agpBase; unsigned int agpSize; @@ -846,7 +848,6 @@ Bool Volari_AccelInit(ScreenPtr pScreen) ; /* void XGI_LockCRT2(PXGI_HW_DEVICE_INFO,USHORT BaseAddr); */ /* void XGI_DisableBridge(PXGI_HW_DEVICE_INFO,USHORT BaseAddr); */ /* void XGI_EnableBridge(PXGI_HW_DEVICE_INFO,USHORT BaseAddr); */ -#endif extern USHORT XGI_GetModeID(ULONG VBFlags, int HDisplay, int VDisplay, int Depth, int LCDwith, int LCDheight); @@ -888,3 +889,5 @@ void XGIDumpRegs(ScrnInfoPtr pScrn); #else #define Newdebugcode(dbg_code) #endif + +#endif /* _XGI_H_ */ diff --git a/src/xgi_accel.h b/src/xgi_accel.h index 8f5d005..da1020a 100644 --- a/src/xgi_accel.h +++ b/src/xgi_accel.h @@ -962,5 +962,9 @@ extern void Volari_Idle(XGIPtr pXGI); \ } + +extern void Volari_DisableAccelerator(ScrnInfoPtr pScrn); +extern void Volari_InitializeAccelerator(ScrnInfoPtr pScrn); + #endif /* _XGI_315_ACCEL_H_ */ diff --git a/src/xgi_dri.c b/src/xgi_dri.c index b76ecbd..7d4a059 100644 --- a/src/xgi_dri.c +++ b/src/xgi_dri.c @@ -274,13 +274,13 @@ Bool XGIDRIScreenInit(ScreenPtr pScreen) } pXGI->pDRIInfo = pDRIInfo; - pDRIInfo->drmDriverName = XGIKernelDriverName; - pDRIInfo->clientDriverName = XGIClientDriverName; + pDRIInfo->drmDriverName = (char *)XGIKernelDriverName; + pDRIInfo->clientDriverName = (char *)XGIClientDriverName; pDRIInfo->busIdString = DRICreatePCIBusID(pXGI->PciInfo); pDRIInfo->ddxDriverMajorVersion = PACKAGE_VERSION_MAJOR; pDRIInfo->ddxDriverMinorVersion = PACKAGE_VERSION_MINOR; pDRIInfo->ddxDriverPatchVersion = PACKAGE_VERSION_PATCHLEVEL; - pDRIInfo->frameBufferPhysicalAddress = pXGI->FbAddress; + pDRIInfo->frameBufferPhysicalAddress = (void *)pXGI->FbAddress; pDRIInfo->frameBufferSize = pXGI->FbMapSize; /* ?? */ @@ -384,7 +384,7 @@ Bool XGIDRIScreenInit(ScreenPtr pScreen) drmCommandWrite(pXGI->drmSubFD, DRM_XGI_FB_INIT, &fb, sizeof(fb)); xf86DrvMsg(pScreen->myNum, X_INFO, "[dri] Video RAM memory heap: 0x%0x to 0x%0x (%dKB)\n", - pXGI->DRIheapstart, pXGI->DRIheapend, + (unsigned int)pXGI->DRIheapstart, (unsigned int)pXGI->DRIheapend, (int)((pXGI->DRIheapend - pXGI->DRIheapstart) >> 10)); diff --git a/src/xgi_driver.c b/src/xgi_driver.c index e36bcee..9449d5b 100644 --- a/src/xgi_driver.c +++ b/src/xgi_driver.c @@ -68,12 +68,14 @@ #include "mibstore.h" #include "xgi.h" +#include "init.h" #include "xgi_regs.h" #include "xgi_vb.h" #include "xgi_dac.h" #include "vb_def.h" #include "xgi_driver.h" #include "valid_mode.h" +#include "xgi_accel.h" #define _XF86DGA_SERVER_ #include @@ -189,11 +191,13 @@ static SymTabRec XGIChipsets[] = { {-1, NULL} }; +#ifndef XSERVER_LIBPCIACCESS static PciChipsets XGIPciChipsets[] = { {PCI_CHIP_XGIXG40, PCI_CHIP_XGIXG40, RES_SHARED_VGA}, {PCI_CHIP_XGIXG20, PCI_CHIP_XGIXG20, RES_SHARED_VGA}, {-1, -1, RES_UNDEFINED} }; +#endif static const char *xaaSymbols[] = { "XAACopyROP", @@ -2601,7 +2605,7 @@ XGIPreInit(ScrnInfoPtr pScrn, int flags) (pXGI->PciInfo->ioBase[2] & 0xFFFC) #endif ); - pXGI->xgi_HwDevExt.pjIOAddress = (XGIIOADDRESS) (pXGI->RelIO + 0x30); + pXGI->xgi_HwDevExt.pjIOAddress = (PUCHAR)(XGIIOADDRESS) (pXGI->RelIO + 0x30); xf86DrvMsg(pScrn->scrnIndex, from, "Relocated IO registers at 0x%lX\n", (unsigned long) pXGI->RelIO); @@ -5981,10 +5985,10 @@ XGIDumpMMIO(ScrnInfoPtr pScrn) } #endif /* DEBUG */ +#ifdef DEBUG void XGIDumpRegs(ScrnInfoPtr pScrn) { -#ifdef DEBUG XGIPtr pXGI = XGIPTR(pScrn); @@ -6001,10 +6005,8 @@ XGIDumpRegs(ScrnInfoPtr pScrn) XGIDumpPart3(pScrn); XGIDumpPart4(pScrn); } - -#endif /* DEBUG */ } - +#endif /* DEBUG */ void XGIDumpPalette(ScrnInfoPtr pScrn) diff --git a/src/xgi_setup.c b/src/xgi_setup.c index a06916b..5d947ec 100644 --- a/src/xgi_setup.c +++ b/src/xgi_setup.c @@ -48,6 +48,7 @@ #include "xf86cmap.h" #include "xgi.h" +#include "init.h" #include "xgi_regs.h" #include "xgi_dac.h" /* #include "valid_mode.h" */ @@ -64,8 +65,6 @@ extern int FbDevExist; static Bool bAccessVGAPCIInfo(PXGI_HW_DEVICE_INFO pHwDevInfo, ULONG ulOffset, ULONG ulSet, ULONG *pulValue); -static Bool bAccessNBridgePCIInfo(PXGI_HW_DEVICE_INFO pHwDevInfo, - ULONG ulOffset, ULONG ulSet, ULONG *pulValue); static Bool XGI_IsXG21(ScrnInfoPtr pScrn); static void XGI_InitHwDevInfo(ScrnInfoPtr pScrn); @@ -317,7 +316,7 @@ XGI_InitHwDevInfo(ScrnInfoPtr pScrn) PDEBUG(ErrorF("pXGI->FbBase = 0x%08lx\n",(ULONG)(pXGI->FbBase))) ; PDEBUG(ErrorF("pHwDevInfo->pjVideoMemoryAddress = 0x%08lx\n",(ULONG)(pHwDevInfo->pjVideoMemoryAddress))) ; pHwDevInfo->ulVideoMemorySize = pXGI->FbMapSize ; - pHwDevInfo->pjIOAddress = pXGI->RelIO + 0x30 ; + pHwDevInfo->pjIOAddress = (PUCHAR)(pXGI->RelIO + 0x30); switch (pXGI->Chipset) { case PCI_CHIP_XGIXG40: @@ -402,7 +401,7 @@ bAccessVGAPCIInfo(PXGI_HW_DEVICE_INFO pHwDevInfo, ULONG ulOffset, ULONG ulSet, U err = pci_device_cfg_write_u32(pXGI->PciInfo, *pulValue, ulOffset & ~3); } else { - err = pci_device_cfg_write_u32(pXGI->PciInfo, pulValue, + err = pci_device_cfg_write_u32(pXGI->PciInfo, (ULONG)pulValue, ulOffset & ~3); } diff --git a/src/xgi_video.c b/src/xgi_video.c index 8c6be6b..90e0899 100644 --- a/src/xgi_video.c +++ b/src/xgi_video.c @@ -51,11 +51,11 @@ #include #include #include -#include -#include /* for __u32,__s32....*/ +#include +#include /* for __u32,__s32....*/ #include -#include /* for open flags*/ +#include /* for open flags*/ #include # endif //VC @@ -94,7 +94,8 @@ static void XGIQueryBestSize(ScrnInfoPtr, Bool, short, short, short, short, unsigned int *, unsigned int *, pointer); static int XGIPutImage( ScrnInfoPtr, short, short, short, short, short, short, short, short, - int, unsigned char*, short, short, Bool, RegionPtr, pointer); + int, unsigned char*, short, short, Bool, RegionPtr, + pointer, DrawablePtr); static int XGIQueryImageAttributes(ScrnInfoPtr, int, unsigned short *, unsigned short *, int *, int *); @@ -104,7 +105,7 @@ static void XGIStopVideo(ScrnInfoPtr, pointer, Bool); #ifdef VC static int XGIPutVideo( ScrnInfoPtr, short, short, short, short, short, short, short, short, - RegionPtr, pointer); + RegionPtr, pointer, DrawablePtr); static struct v4l2_input XGIToV4lInput(XGIPortPrivPtr pPriv, int encoding); static struct v4l2_standard XGIToV4lStandard(XGIPortPrivPtr pPriv, int encoding); @@ -112,11 +113,12 @@ static int XGIOpenV4l(XGIPortPrivPtr pPriv); static void XGICloseV4l(XGIPortPrivPtr pPriv); #endif //VC -extern void SetSRRegMask(XGIPtr, CARD8, CARD8, CARD8); -extern void XGIUpdateXvGamma(XGIPtr, XGIPortPrivPtr); +static void set_scale_factor(XGIOverlayPtr pOverlay); +static void set_contrast_factor(XGIPtr pXGI, XGIOverlayPtr pOverlay); + #define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, TRUE) -static Atom xvBrightness, xvContrast, xvColorKey, xvSaturation, xvHue, xvmcUncompressIndex, xvMode, xvSubpicture, xvEncoding/*::::for capture*/; +static Atom /*xvBrightness, xvContrast, xvColorKey, xvSaturation, xvHue, xvmcUncompressIndex, xvMode, xvSubpicture,*/ xvEncoding/*::::for capture*/; void XGIInitVideo(ScreenPtr pScreen) { @@ -585,8 +587,8 @@ XGISetPortAttribute( { INT32 temp; struct v4l2_standard standard; - - ErrorF("Giwas: XGISetPortAttribute--xvEncoding %d\n", value); + + ErrorF("Giwas: XGISetPortAttribute--xvEncoding %d\n", (int)value); if (value == 0 || value >= sizeof(InputVideoEncodings)/sizeof(InputVideoEncodings[0])) @@ -599,12 +601,12 @@ XGISetPortAttribute( { if (XGIOpenV4l(pPriv)) { - ErrorF("Giwas: In xvEncoding XGIOpenV4l success %d\n", value); + ErrorF("Giwas: In xvEncoding XGIOpenV4l success %d\n", (int)value); pPriv->encoding = temp; pPriv->update_flags &= ~UPDATE_VIDEO; return Success; } - ErrorF("Giwas: XGIToV4lStandard %d\n",value); + ErrorF("Giwas: XGIToV4lStandard %d\n", (int)value); standard = XGIToV4lStandard(pPriv,value); if (ioctl(pPriv->fd, VIDIOC_S_STD, standard.index)<0) { @@ -690,7 +692,7 @@ XGIQueryBestSize( } -void +static void set_scale_factor(XGIOverlayPtr pOverlay) { float f_temp; @@ -810,7 +812,7 @@ set_scale_factor(XGIOverlayPtr pOverlay) pOverlay->pitch = (CARD16)(NewPitch); } -void +static void set_contrast_factor(XGIPtr pXGI, XGIOverlayPtr pOverlay) { ScrnInfoPtr pScrn = pXGI->pScrn; @@ -1058,7 +1060,7 @@ XGIStopVideo(ScrnInfoPtr pScrn, pointer data, Bool exit) } } - +/*ARGSUSED*/ static int XGIPutImage( ScrnInfoPtr pScrn, @@ -1069,7 +1071,8 @@ XGIPutImage( int id, unsigned char* buf, short width, short height, Bool sync, - RegionPtr clipBoxes, pointer data + RegionPtr clipBoxes, pointer data, + DrawablePtr pDraw ){ XGIPtr pXGI = XGIPTR(pScrn); XGIPortPrivPtr pPriv = (XGIPortPrivPtr)data; @@ -1634,6 +1637,7 @@ XGIQueryImageAttributes( } # ifdef VC +/*ARGSUSED*/ static int XGIPutVideo( ScrnInfoPtr pScrn, @@ -1641,7 +1645,8 @@ XGIPutVideo( short drw_x, short drw_y, short src_w, short src_h, short drw_w, short drw_h, - RegionPtr clipBoxes, pointer data) + RegionPtr clipBoxes, pointer data, + DrawablePtr pDraw) { /* XGIPtr pXGI = XGIPTR(pScrn); */ XGIPortPrivPtr pPriv = (XGIPortPrivPtr)data; diff --git a/src/xgi_videohw.c b/src/xgi_videohw.c index b050f92..d66a0c8 100644 --- a/src/xgi_videohw.c +++ b/src/xgi_videohw.c @@ -40,6 +40,15 @@ #include "fourcc.h" #define CAPTURE_340A1 + + +#ifdef CAPTURE_340A1 +static void SetEnableCaptureReg(XGIPtr pXGI, Bool bEnable, Bool bFlip); +#endif +static VOID SetDDAReg (XGIPtr pXGI, float scale); +static void SetMergeLineBufReg(XGIPtr pXGI, Bool enable); +static void SetVideoFormatReg(XGIPtr pXGI, int format); + /* static CARD32 _XGIRead(XGIPtr pXGI, CARD32 reg) { @@ -150,7 +159,7 @@ static float tap_dda_func(float x) /* ----------------T05_EnableCapture()---------------- */ #ifdef CAPTURE_340A1 -void SetEnableCaptureReg(XGIPtr pXGI, Bool bEnable, Bool bFlip) +static void SetEnableCaptureReg(XGIPtr pXGI, Bool bEnable, Bool bFlip) { if (bEnable) { @@ -248,7 +257,7 @@ XGIUpdateXvGamma(XGIPtr pXGI, XGIPortPrivPtr pPriv) } /* ----------------SetDDAReg()------------------------------------ */ -VOID SetDDAReg (XGIPtr pXGI, float scale) +static VOID SetDDAReg (XGIPtr pXGI, float scale) { float WW, W[4], tempW[4]; int i, j, w, WeightMat[16][4]; @@ -487,7 +496,7 @@ XGIResetVideo(ScrnInfoPtr pScrn) SetVideoRegMask(pXGI, Index_VI_Hue, Default_Hue, 0x07); } -void +static void SetMergeLineBufReg(XGIPtr pXGI, Bool enable) { if (enable) { @@ -504,7 +513,7 @@ SetMergeLineBufReg(XGIPtr pXGI, Bool enable) } } -void +static void SetVideoFormatReg(XGIPtr pXGI, int format) { CARD8 fmt; diff --git a/src/xgi_videohw.h b/src/xgi_videohw.h index 12e9faa..440cd07 100644 --- a/src/xgi_videohw.h +++ b/src/xgi_videohw.h @@ -354,5 +354,9 @@ void SetVideoSaturationReg(XGIPtr, INT32); void SetVideoHueReg(XGIPtr, INT32); void EnableCaptureAutoFlip(XGIPtr, Bool); + +void SetSRRegMask(XGIPtr pXGI, CARD8 reg, CARD8 data, CARD8 mask); +void XGIUpdateXvGamma(XGIPtr pXGI, XGIPortPrivPtr pPriv); + #endif /* _XGI_VIDEOHW_H_ */ -- 1.5.4.3