2011-03-08 20:16:13

by Aaro Koskinen

[permalink] [raw]
Subject: [PATCH 00/15] staging: xgifb: misc cleanups

Hello,

Here's again some miscellaneous xgifb cleanups mainly to remove unused
code.

No compilation warnings from GCC 4.5.2, also checked that framebuffer
console works with Z9 on ARM.

Aaro Koskinen (15):
staging: xgifb: delete HW cursor memory allocation
staging: xgifb: delete command queue selection/init
staging: xgifb: delete offscreen memory management
staging: xgifb: delete unused fields from xgi_hw_device_info
staging: xgifb: delete bSkipSense
staging: xgifb: delete bIntegratedMMEnabled
staging: xgifb: delete nomax module parameter
staging: xgifb: vb_setmode: make internal functions static
staging: xgifb: vb_setmode: include the .h file
staging: xgifb: vb_ext: delete redundant declarations
staging: xgifb: vb_ext: delete unused functions
staging: xgifb: vb_ext: make internal functions static
staging: xgifb: vb_init: delete redundant declarations
staging: xgifb: vb_init: delete unused functions
staging: xgifb: vb_init: make internal functions static

drivers/staging/xgifb/XGI_main.h | 104 ----
drivers/staging/xgifb/XGI_main_26.c | 573 ------------------
drivers/staging/xgifb/XGIfb.h | 1 -
drivers/staging/xgifb/vb_ext.c | 472 +--------------
drivers/staging/xgifb/vb_ext.h | 6 -
drivers/staging/xgifb/vb_init.c | 1135 ++---------------------------------
drivers/staging/xgifb/vb_setmode.c | 417 ++++++--------
drivers/staging/xgifb/vb_setmode.h | 4 -
drivers/staging/xgifb/vgatypes.h | 33 -
9 files changed, 235 insertions(+), 2510 deletions(-)


2011-03-08 20:16:29

by Aaro Koskinen

[permalink] [raw]
Subject: [PATCH 10/15] staging: xgifb: vb_ext: delete redundant declarations

Delete redundant declarations.

Signed-off-by: Aaro Koskinen <[email protected]>
---
drivers/staging/xgifb/vb_ext.c | 17 -----------------
1 files changed, 0 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/xgifb/vb_ext.c b/drivers/staging/xgifb/vb_ext.c
index 80c7818..e1f9188 100644
--- a/drivers/staging/xgifb/vb_ext.c
+++ b/drivers/staging/xgifb/vb_ext.c
@@ -9,25 +9,12 @@
#include "vb_util.h"
#include "vb_setmode.h"
#include "vb_ext.h"
-extern unsigned char XGI330_SoftSetting;
-extern unsigned char XGI330_OutputSelect;
-extern unsigned short XGI330_RGBSenseData2;
-extern unsigned short XGI330_YCSenseData2;
-extern unsigned short XGI330_VideoSenseData2;
-void XGI_GetSenseStatus(struct xgi_hw_device_info *HwDeviceExtension,
- struct vb_device_info *pVBInfo);
unsigned char XGINew_GetPanelID(struct vb_device_info *pVBInfo);
-unsigned short XGINew_SenseLCD(struct xgi_hw_device_info *,
- struct vb_device_info *pVBInfo);
unsigned char XGINew_GetLCDDDCInfo(
struct xgi_hw_device_info *HwDeviceExtension,
struct vb_device_info *pVBInfo);
-void XGISetDPMS(struct xgi_hw_device_info *pXGIHWDE,
- unsigned long VESA_POWER_STATE);
unsigned char XGINew_BridgeIsEnable(struct xgi_hw_device_info *,
struct vb_device_info *pVBInfo);
-unsigned char XGINew_Sense(unsigned short tempbx, unsigned short tempcx,
- struct vb_device_info *pVBInfo);
unsigned char XGINew_SenseHiTV(struct xgi_hw_device_info *HwDeviceExtension,
struct vb_device_info *pVBInfo);

@@ -35,10 +22,6 @@ unsigned char XGINew_SenseHiTV(struct xgi_hw_device_info *HwDeviceExtension,
*********************** Dynamic Sense ************************
*************************************************************/

-void XGI_WaitDisplay(void);
-unsigned char XGI_Is301C(struct vb_device_info *);
-unsigned char XGI_Is301LV(struct vb_device_info *);
-
static unsigned char XGINew_Is301B(struct vb_device_info *pVBInfo)
{
unsigned short flag;
--
1.5.6.5

2011-03-08 20:16:33

by Aaro Koskinen

[permalink] [raw]
Subject: [PATCH 08/15] staging: xgifb: vb_setmode: make internal functions static

Make internal functions static and remove unneeded forward declarations.

Signed-off-by: Aaro Koskinen <[email protected]>
---
drivers/staging/xgifb/vb_setmode.c | 372 +++++++++++++++++-------------------
drivers/staging/xgifb/vb_setmode.h | 4 -
2 files changed, 176 insertions(+), 200 deletions(-)

diff --git a/drivers/staging/xgifb/vb_setmode.c b/drivers/staging/xgifb/vb_setmode.c
index fa2cf96..0f37c80 100644
--- a/drivers/staging/xgifb/vb_setmode.c
+++ b/drivers/staging/xgifb/vb_setmode.c
@@ -21,16 +21,11 @@



-unsigned char XGI_IsLCDDualLink(struct vb_device_info *pVBInfo);
unsigned char XGI_SetCRT2Group301(unsigned short ModeNo,
struct xgi_hw_device_info *HwDeviceExtension,
struct vb_device_info *pVBInfo);
-unsigned char XGI_BacklightByDrv(struct vb_device_info *pVBInfo);

-unsigned char XGI_IsLCDON(struct vb_device_info *pVBInfo);
-unsigned char XGI_DisableChISLCD(struct vb_device_info *pVBInfo);
-unsigned char XGI_EnableChISLCD(struct vb_device_info *pVBInfo);
-unsigned char XGI_AjustCRT2Rate(unsigned short ModeNo,
+static unsigned char XGI_AjustCRT2Rate(unsigned short ModeNo,
unsigned short ModeIdIndex,
unsigned short RefreshRateTableIndex,
unsigned short *i, struct vb_device_info *pVBInfo);
@@ -43,10 +38,10 @@ unsigned char XGI_GetLCDInfo(unsigned short ModeNo,
unsigned char XGISetModeNew(struct xgi_hw_device_info *HwDeviceExtension,
unsigned short ModeNo);
unsigned char XGI_BridgeIsOn(struct vb_device_info *pVBInfo);
-unsigned char XGI_GetModePtr(unsigned short ModeNo,
+static unsigned char XGI_GetModePtr(unsigned short ModeNo,
unsigned short ModeIdIndex,
struct vb_device_info *pVBInfo);
-unsigned short XGI_GetOffset(unsigned short ModeNo,
+static unsigned short XGI_GetOffset(unsigned short ModeNo,
unsigned short ModeIdIndex,
unsigned short RefreshRateTableIndex,
struct xgi_hw_device_info *HwDeviceExtension,
@@ -58,139 +53,124 @@ unsigned short XGI_GetRatePtrCRT2(struct xgi_hw_device_info *pXGIHWDE,
unsigned short XGI_GetResInfo(unsigned short ModeNo,
unsigned short ModeIdIndex,
struct vb_device_info *pVBInfo);
-unsigned short XGI_GetColorDepth(unsigned short ModeNo,
+static unsigned short XGI_GetColorDepth(unsigned short ModeNo,
unsigned short ModeIdIndex,
struct vb_device_info *pVBInfo);
-unsigned short XGI_GetVGAHT2(struct vb_device_info *pVBInfo);
-unsigned short XGI_GetVCLK2Ptr(unsigned short ModeNo,
+static unsigned short XGI_GetVGAHT2(struct vb_device_info *pVBInfo);
+static unsigned short XGI_GetVCLK2Ptr(unsigned short ModeNo,
unsigned short ModeIdIndex,
unsigned short RefreshRateTableIndex,
struct xgi_hw_device_info *HwDeviceExtension,
struct vb_device_info *pVBInfo);
-void XGI_VBLongWait(struct vb_device_info *pVBInfo);
-void XGI_SaveCRT2Info(unsigned short ModeNo, struct vb_device_info *pVBInfo);
-void XGI_GetCRT2Data(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo);
-void XGI_GetCRT2ResInfo(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo);
-void XGI_PreSetGroup1(unsigned short ModeNo, unsigned short ModeIdIndex, struct xgi_hw_device_info *HwDeviceExtension, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo);
-void XGI_SetGroup1(unsigned short ModeNo, unsigned short ModeIdIndex, struct xgi_hw_device_info *HwDeviceExtension, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo);
-void XGI_SetLockRegs(unsigned short ModeNo, unsigned short ModeIdIndex, struct xgi_hw_device_info *HwDeviceExtension, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo);
-void XGI_SetLCDRegs(unsigned short ModeNo, unsigned short ModeIdIndex, struct xgi_hw_device_info *HwDeviceExtension, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo);
-void XGI_SetGroup2(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo);
-void XGI_SetGroup3(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo);
-void XGI_SetGroup4(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo);
-void XGI_SetGroup5(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo);
-void *XGI_GetLcdPtr(unsigned short BX, unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo);
-void *XGI_GetTVPtr(unsigned short BX, unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo);
-void XGI_FirePWDEnable(struct vb_device_info *pVBInfo);
-void XGI_EnableGatingCRT(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo);
-void XGI_DisableGatingCRT(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo);
-void XGI_SetPanelDelay(unsigned short tempbl, struct vb_device_info *pVBInfo);
-void XGI_SetPanelPower(unsigned short tempah, unsigned short tempbl, struct vb_device_info *pVBInfo);
-void XGI_EnablePWD(struct vb_device_info *pVBInfo);
-void XGI_DisablePWD(struct vb_device_info *pVBInfo);
-void XGI_AutoThreshold(struct vb_device_info *pVBInfo);
-void XGI_SetTap4Regs(struct vb_device_info *pVBInfo);
+static void XGI_VBLongWait(struct vb_device_info *pVBInfo);
+static void XGI_SaveCRT2Info(unsigned short ModeNo, struct vb_device_info *pVBInfo);
+static void XGI_GetCRT2Data(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo);
+static void XGI_GetCRT2ResInfo(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo);
+static void XGI_PreSetGroup1(unsigned short ModeNo, unsigned short ModeIdIndex, struct xgi_hw_device_info *HwDeviceExtension, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo);
+static void XGI_SetGroup1(unsigned short ModeNo, unsigned short ModeIdIndex, struct xgi_hw_device_info *HwDeviceExtension, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo);
+static void XGI_SetLockRegs(unsigned short ModeNo, unsigned short ModeIdIndex, struct xgi_hw_device_info *HwDeviceExtension, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo);
+static void XGI_SetLCDRegs(unsigned short ModeNo, unsigned short ModeIdIndex, struct xgi_hw_device_info *HwDeviceExtension, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo);
+static void XGI_SetGroup2(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo);
+static void XGI_SetGroup3(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo);
+static void XGI_SetGroup4(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo);
+static void XGI_SetGroup5(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo);
+static void *XGI_GetLcdPtr(unsigned short BX, unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo);
+static void *XGI_GetTVPtr(unsigned short BX, unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo);
+static void XGI_AutoThreshold(struct vb_device_info *pVBInfo);
+static void XGI_SetTap4Regs(struct vb_device_info *pVBInfo);

void XGI_DisplayOn(struct xgi_hw_device_info *, struct vb_device_info *pVBInfo);
void XGI_DisplayOff(struct xgi_hw_device_info *, struct vb_device_info *pVBInfo);
-void XGI_SetCRT1Group(struct xgi_hw_device_info *HwDeviceExtension, unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo);
-void XGI_SetXG21CRTC(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo);
-void XGI_SetXG21LCD(struct vb_device_info *pVBInfo, unsigned short RefreshRateTableIndex, unsigned short ModeNo);
-void XGI_SetXG27CRTC(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo);
-void XGI_SetXG27LCD(struct vb_device_info *pVBInfo, unsigned short RefreshRateTableIndex, unsigned short ModeNo);
-void XGI_UpdateXG21CRTC(unsigned short ModeNo, struct vb_device_info *pVBInfo, unsigned short RefreshRateTableIndex);
-void XGI_WaitDisply(struct vb_device_info *pVBInfo);
+static void XGI_SetCRT1Group(struct xgi_hw_device_info *HwDeviceExtension, unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo);
+static void XGI_SetXG21CRTC(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo);
+static void XGI_SetXG21LCD(struct vb_device_info *pVBInfo, unsigned short RefreshRateTableIndex, unsigned short ModeNo);
+static void XGI_SetXG27CRTC(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo);
+static void XGI_SetXG27LCD(struct vb_device_info *pVBInfo, unsigned short RefreshRateTableIndex, unsigned short ModeNo);
+static void XGI_UpdateXG21CRTC(unsigned short ModeNo, struct vb_device_info *pVBInfo, unsigned short RefreshRateTableIndex);
void XGI_SenseCRT1(struct vb_device_info *pVBInfo);
-void XGI_SetSeqRegs(unsigned short ModeNo, unsigned short StandTableIndex, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo);
-void XGI_SetMiscRegs(unsigned short StandTableIndex, struct vb_device_info *pVBInfo);
-void XGI_SetCRTCRegs(struct xgi_hw_device_info *HwDeviceExtension, unsigned short StandTableIndex, struct vb_device_info *pVBInfo);
-void XGI_SetATTRegs(unsigned short ModeNo, unsigned short StandTableIndex, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo);
-void XGI_SetGRCRegs(unsigned short StandTableIndex, struct vb_device_info *pVBInfo);
-void XGI_ClearExt1Regs(struct vb_device_info *pVBInfo);
-
-void XGI_SetSync(unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo);
-void XGI_SetCRT1CRTC(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo, struct xgi_hw_device_info *HwDeviceExtension);
-void XGI_SetCRT1Timing_H(struct vb_device_info *pVBInfo, struct xgi_hw_device_info *HwDeviceExtension);
-void XGI_SetCRT1Timing_V(unsigned short ModeIdIndex, unsigned short ModeNo, struct vb_device_info *pVBInfo);
-void XGI_SetCRT1DE(struct xgi_hw_device_info *HwDeviceExtension, unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo);
-void XGI_SetCRT1VCLK(unsigned short ModeNo, unsigned short ModeIdIndex, struct xgi_hw_device_info *HwDeviceExtension, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo);
-void XGI_SetCRT1FIFO(unsigned short ModeNo, struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo);
-void XGI_SetCRT1ModeRegs(struct xgi_hw_device_info *HwDeviceExtension, unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo);
-void XGI_SetVCLKState(struct xgi_hw_device_info *HwDeviceExtension, unsigned short ModeNo, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo);
-
-void XGI_LoadDAC(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo);
-void XGI_WriteDAC(unsigned short dl, unsigned short ah, unsigned short al, unsigned short dh, struct vb_device_info *pVBInfo);
+static void XGI_SetSeqRegs(unsigned short ModeNo, unsigned short StandTableIndex, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo);
+static void XGI_SetMiscRegs(unsigned short StandTableIndex, struct vb_device_info *pVBInfo);
+static void XGI_SetCRTCRegs(struct xgi_hw_device_info *HwDeviceExtension, unsigned short StandTableIndex, struct vb_device_info *pVBInfo);
+static void XGI_SetATTRegs(unsigned short ModeNo, unsigned short StandTableIndex, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo);
+static void XGI_SetGRCRegs(unsigned short StandTableIndex, struct vb_device_info *pVBInfo);
+static void XGI_ClearExt1Regs(struct vb_device_info *pVBInfo);
+
+static void XGI_SetSync(unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo);
+static void XGI_SetCRT1CRTC(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo, struct xgi_hw_device_info *HwDeviceExtension);
+static void XGI_SetCRT1Timing_H(struct vb_device_info *pVBInfo, struct xgi_hw_device_info *HwDeviceExtension);
+static void XGI_SetCRT1Timing_V(unsigned short ModeIdIndex, unsigned short ModeNo, struct vb_device_info *pVBInfo);
+static void XGI_SetCRT1DE(struct xgi_hw_device_info *HwDeviceExtension, unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo);
+static void XGI_SetCRT1VCLK(unsigned short ModeNo, unsigned short ModeIdIndex, struct xgi_hw_device_info *HwDeviceExtension, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo);
+static void XGI_SetCRT1FIFO(unsigned short ModeNo, struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo);
+static void XGI_SetCRT1ModeRegs(struct xgi_hw_device_info *HwDeviceExtension, unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo);
+static void XGI_SetVCLKState(struct xgi_hw_device_info *HwDeviceExtension, unsigned short ModeNo, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo);
+
+static void XGI_LoadDAC(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo);
+static void XGI_WriteDAC(unsigned short dl, unsigned short ah, unsigned short al, unsigned short dh, struct vb_device_info *pVBInfo);
/*void XGI_ClearBuffer(struct xgi_hw_device_info *HwDeviceExtension, unsigned short ModeNo, struct vb_device_info *pVBInfo);*/
-void XGI_SetLCDAGroup(unsigned short ModeNo, unsigned short ModeIdIndex, struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo);
-void XGI_GetLVDSResInfo(unsigned short ModeNo, unsigned short ModeIdIndex,
+static void XGI_SetLCDAGroup(unsigned short ModeNo, unsigned short ModeIdIndex, struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo);
+static void XGI_GetLVDSResInfo(unsigned short ModeNo, unsigned short ModeIdIndex,
struct vb_device_info *pVBInfo);
-void XGI_GetLVDSData(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo);
+static void XGI_GetLVDSData(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo);
unsigned short XGI_GetLVDSOEMTableIndex(struct vb_device_info *pVBInfo);
-void XGI_ModCRT1Regs(unsigned short ModeNo, unsigned short ModeIdIndex,
+static void XGI_ModCRT1Regs(unsigned short ModeNo, unsigned short ModeIdIndex,
unsigned short RefreshRateTableIndex,
struct xgi_hw_device_info *HwDeviceExtension,
struct vb_device_info *pVBInfo);
-void XGI_SetLVDSRegs(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo);
-void XGI_UpdateModeInfo(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo);
+static void XGI_SetLVDSRegs(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo);
+static void XGI_UpdateModeInfo(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo);
void XGI_GetVGAType(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo);
void XGI_GetVBType(struct vb_device_info *pVBInfo);
void XGI_GetVBInfo(unsigned short ModeNo, unsigned short ModeIdIndex, struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo);
void XGI_GetTVInfo(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo);
-void XGI_SetCRT2ECLK(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo);
+static void XGI_SetCRT2ECLK(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo);
void InitTo330Pointer(unsigned char, struct vb_device_info *pVBInfo);
-void XGI_GetLCDSync(unsigned short *HSyncWidth, unsigned short *VSyncWidth, struct vb_device_info *pVBInfo);
+static void XGI_GetLCDSync(unsigned short *HSyncWidth, unsigned short *VSyncWidth, struct vb_device_info *pVBInfo);
void XGI_DisableBridge(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo);
void XGI_EnableBridge(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo);
-void XGI_SetCRT2VCLK(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo);
-void XGI_OEM310Setting(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo);
-void XGI_SetDelayComp(struct vb_device_info *pVBInfo);
-void XGI_SetLCDCap(struct vb_device_info *pVBInfo);
-void XGI_SetLCDCap_A(unsigned short tempcx, struct vb_device_info *pVBInfo);
-void XGI_SetLCDCap_B(unsigned short tempcx, struct vb_device_info *pVBInfo);
-void SetSpectrum(struct vb_device_info *pVBInfo);
-void XGI_SetAntiFlicker(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo);
-void XGI_SetEdgeEnhance(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo);
-void XGI_SetPhaseIncr(struct vb_device_info *pVBInfo);
-void XGI_SetYFilter(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo);
-void XGI_GetTVPtrIndex2(unsigned short *tempbx, unsigned char* tempcl,
+static void XGI_SetCRT2VCLK(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo);
+static void XGI_OEM310Setting(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo);
+static void XGI_SetDelayComp(struct vb_device_info *pVBInfo);
+static void XGI_SetLCDCap(struct vb_device_info *pVBInfo);
+static void XGI_SetLCDCap_A(unsigned short tempcx, struct vb_device_info *pVBInfo);
+static void XGI_SetLCDCap_B(unsigned short tempcx, struct vb_device_info *pVBInfo);
+static void SetSpectrum(struct vb_device_info *pVBInfo);
+static void XGI_SetAntiFlicker(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo);
+static void XGI_SetEdgeEnhance(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo);
+static void XGI_SetPhaseIncr(struct vb_device_info *pVBInfo);
+static void XGI_SetYFilter(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo);
+static void XGI_GetTVPtrIndex2(unsigned short *tempbx, unsigned char* tempcl,
unsigned char *tempch, struct vb_device_info *pVBInfo);
-unsigned short XGI_GetTVPtrIndex(struct vb_device_info *pVBInfo);
void XGI_SetCRT2ModeRegs(unsigned short ModeNo, struct xgi_hw_device_info *, struct vb_device_info *pVBInfo);
-void XGI_CloseCRTC(struct xgi_hw_device_info *, struct vb_device_info *pVBInfo);
-void XGI_OpenCRTC(struct xgi_hw_device_info *, struct vb_device_info *pVBInfo);
-void XGI_GetRAMDAC2DATA(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo);
+static void XGI_CloseCRTC(struct xgi_hw_device_info *, struct vb_device_info *pVBInfo);
+static void XGI_GetRAMDAC2DATA(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo);
void XGI_UnLockCRT2(struct xgi_hw_device_info *, struct vb_device_info *pVBInfo);
void XGI_LockCRT2(struct xgi_hw_device_info *, struct vb_device_info *pVBInfo);
-void XGINew_EnableCRT2(struct vb_device_info *pVBInfo);
+static void XGINew_EnableCRT2(struct vb_device_info *pVBInfo);
void XGI_LongWait(struct vb_device_info *pVBInfo);
-void XGI_SetCRT1Offset(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo);
-void XGI_GetLCDVCLKPtr(unsigned char *di_0, unsigned char *di_1,
+static void XGI_SetCRT1Offset(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo);
+static void XGI_GetLCDVCLKPtr(unsigned char *di_0, unsigned char *di_1,
struct vb_device_info *pVBInfo);
-unsigned char XGI_GetVCLKPtr(unsigned short RefreshRateTableIndex,
+static unsigned char XGI_GetVCLKPtr(unsigned short RefreshRateTableIndex,
unsigned short ModeNo,
unsigned short ModeIdIndex,
struct vb_device_info *pVBInfo);
-void XGI_GetVCLKLen(unsigned char tempal, unsigned char *di_0,
+static void XGI_GetVCLKLen(unsigned char tempal, unsigned char *di_0,
unsigned char *di_1, struct vb_device_info *pVBInfo);
-unsigned short XGI_GetLCDCapPtr(struct vb_device_info *pVBInfo);
-unsigned short XGI_GetLCDCapPtr1(struct vb_device_info *pVBInfo);
-struct XGI301C_Tap4TimingStruct *XGI_GetTap4Ptr(unsigned short tempcx, struct vb_device_info *pVBInfo);
+static unsigned short XGI_GetLCDCapPtr(struct vb_device_info *pVBInfo);
+static unsigned short XGI_GetLCDCapPtr1(struct vb_device_info *pVBInfo);
+static struct XGI301C_Tap4TimingStruct *XGI_GetTap4Ptr(unsigned short tempcx, struct vb_device_info *pVBInfo);
void XGI_SetXG21FPBits(struct vb_device_info *pVBInfo);
void XGI_SetXG27FPBits(struct vb_device_info *pVBInfo);
-unsigned char XGI_XG21GetPSCValue(struct vb_device_info *pVBInfo);
-unsigned char XGI_XG27GetPSCValue(struct vb_device_info *pVBInfo);
+static unsigned char XGI_XG21GetPSCValue(struct vb_device_info *pVBInfo);
+static unsigned char XGI_XG27GetPSCValue(struct vb_device_info *pVBInfo);
void XGI_XG21BLSignalVDD(unsigned short tempbh, unsigned short tempbl, struct vb_device_info *pVBInfo);
void XGI_XG27BLSignalVDD(unsigned short tempbh, unsigned short tempbl, struct vb_device_info *pVBInfo);
void XGI_XG21SetPanelDelay(unsigned short tempbl, struct vb_device_info *pVBInfo);
unsigned char XGI_XG21CheckLVDSMode(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo);
-void XGI_SetXG21LVDSPara(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo);
-void XGI_SetXG27LVDSPara(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo);
-unsigned char XGI_SetDefaultVCLK(struct vb_device_info *pVBInfo);
-
-extern void ReadVBIOSTablData(unsigned char ChipType, struct vb_device_info *pVBInfo);
-
-/* unsigned short XGINew_flag_clearbuffer; 0: no clear frame buffer 1:clear frame buffer */
-
+static void XGI_SetXG21LVDSPara(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo);
+static void XGI_SetXG27LVDSPara(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo);
+static unsigned char XGI_SetDefaultVCLK(struct vb_device_info *pVBInfo);

static unsigned short XGINew_MDA_DAC[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -566,7 +546,7 @@ unsigned char XGISetModeNew(struct xgi_hw_device_info *HwDeviceExtension,
return 1;
}

-void XGI_SetCRT1Group(struct xgi_hw_device_info *HwDeviceExtension,
+static void XGI_SetCRT1Group(struct xgi_hw_device_info *HwDeviceExtension,
unsigned short ModeNo, unsigned short ModeIdIndex,
struct vb_device_info *pVBInfo)
{
@@ -680,7 +660,7 @@ void XGI_SetCRT1Group(struct xgi_hw_device_info *HwDeviceExtension,
/* XGI_ClearBuffer(HwDeviceExtension, ModeNo, pVBInfo); */
}

-unsigned char XGI_GetModePtr(unsigned short ModeNo, unsigned short ModeIdIndex,
+static unsigned char XGI_GetModePtr(unsigned short ModeNo, unsigned short ModeIdIndex,
struct vb_device_info *pVBInfo)
{
unsigned char index;
@@ -707,7 +687,7 @@ unsigned char XGI_SetBIOSData(unsigned short ModeNo, unsigned short ModeIdIndex)
}
*/

-void XGI_SetSeqRegs(unsigned short ModeNo, unsigned short StandTableIndex,
+static void XGI_SetSeqRegs(unsigned short ModeNo, unsigned short StandTableIndex,
unsigned short ModeIdIndex, struct vb_device_info *pVBInfo)
{
unsigned char tempah, SRdata;
@@ -741,7 +721,7 @@ void XGI_SetSeqRegs(unsigned short ModeNo, unsigned short StandTableIndex,
}
}

-void XGI_SetMiscRegs(unsigned short StandTableIndex,
+static void XGI_SetMiscRegs(unsigned short StandTableIndex,
struct vb_device_info *pVBInfo)
{
unsigned char Miscdata;
@@ -758,7 +738,7 @@ void XGI_SetMiscRegs(unsigned short StandTableIndex,
XGINew_SetReg3(pVBInfo->P3c2, Miscdata); /* Set Misc(3c2) */
}

-void XGI_SetCRTCRegs(struct xgi_hw_device_info *HwDeviceExtension,
+static void XGI_SetCRTCRegs(struct xgi_hw_device_info *HwDeviceExtension,
unsigned short StandTableIndex, struct vb_device_info *pVBInfo)
{
unsigned char CRTCdata;
@@ -783,7 +763,7 @@ void XGI_SetCRTCRegs(struct xgi_hw_device_info *HwDeviceExtension,
*/
}

-void XGI_SetATTRegs(unsigned short ModeNo, unsigned short StandTableIndex,
+static void XGI_SetATTRegs(unsigned short ModeNo, unsigned short StandTableIndex,
unsigned short ModeIdIndex, struct vb_device_info *pVBInfo)
{
unsigned char ARdata;
@@ -823,7 +803,7 @@ void XGI_SetATTRegs(unsigned short ModeNo, unsigned short StandTableIndex,
XGINew_SetReg3(pVBInfo->P3c0, 0x20);
}

-void XGI_SetGRCRegs(unsigned short StandTableIndex,
+static void XGI_SetGRCRegs(unsigned short StandTableIndex,
struct vb_device_info *pVBInfo)
{
unsigned char GRdata;
@@ -841,7 +821,7 @@ void XGI_SetGRCRegs(unsigned short StandTableIndex,
}
}

-void XGI_ClearExt1Regs(struct vb_device_info *pVBInfo)
+static void XGI_ClearExt1Regs(struct vb_device_info *pVBInfo)
{
unsigned short i;

@@ -849,7 +829,7 @@ void XGI_ClearExt1Regs(struct vb_device_info *pVBInfo)
XGINew_SetReg1(pVBInfo->P3c4, i, 0x00); /* Clear SR0A-SR0E */
}

-unsigned char XGI_SetDefaultVCLK(struct vb_device_info *pVBInfo)
+static unsigned char XGI_SetDefaultVCLK(struct vb_device_info *pVBInfo)
{

XGINew_SetRegANDOR(pVBInfo->P3c4, 0x31, ~0x30, 0x20);
@@ -983,7 +963,7 @@ unsigned short XGI_GetRatePtrCRT2(struct xgi_hw_device_info *pXGIHWDE,
return RefreshRateTableIndex + i; /* return (0x01 | (temp1<<1)); */
}

-unsigned char XGI_AjustCRT2Rate(unsigned short ModeNo,
+static unsigned char XGI_AjustCRT2Rate(unsigned short ModeNo,
unsigned short ModeIdIndex,
unsigned short RefreshRateTableIndex, unsigned short *i,
struct vb_device_info *pVBInfo)
@@ -1125,7 +1105,7 @@ unsigned char XGI_AjustCRT2Rate(unsigned short ModeNo,
return 1;
}

-void XGI_SetSync(unsigned short RefreshRateTableIndex,
+static void XGI_SetSync(unsigned short RefreshRateTableIndex,
struct vb_device_info *pVBInfo)
{
unsigned short sync, temp;
@@ -1137,7 +1117,7 @@ void XGI_SetSync(unsigned short RefreshRateTableIndex,
XGINew_SetReg3(pVBInfo->P3c2, temp); /* Set Misc(3c2) */
}

-void XGI_SetCRT1CRTC(unsigned short ModeNo, unsigned short ModeIdIndex,
+static void XGI_SetCRT1CRTC(unsigned short ModeNo, unsigned short ModeIdIndex,
unsigned short RefreshRateTableIndex,
struct vb_device_info *pVBInfo,
struct xgi_hw_device_info *HwDeviceExtension)
@@ -1168,7 +1148,7 @@ void XGI_SetCRT1CRTC(unsigned short ModeNo, unsigned short ModeIdIndex,
XGINew_SetReg1(pVBInfo->P3d4, 0x14, 0x4F);
}

-void XGI_SetCRT1Timing_H(struct vb_device_info *pVBInfo,
+static void XGI_SetCRT1Timing_H(struct vb_device_info *pVBInfo,
struct xgi_hw_device_info *HwDeviceExtension)
{
unsigned char data, data1, pushax;
@@ -1231,7 +1211,7 @@ void XGI_SetCRT1Timing_H(struct vb_device_info *pVBInfo,
}
}

-void XGI_SetCRT1Timing_V(unsigned short ModeIdIndex, unsigned short ModeNo,
+static void XGI_SetCRT1Timing_V(unsigned short ModeIdIndex, unsigned short ModeNo,
struct vb_device_info *pVBInfo)
{
unsigned char data;
@@ -1288,7 +1268,7 @@ void XGI_SetCRT1Timing_V(unsigned short ModeIdIndex, unsigned short ModeNo,
/* Output : Fill CRT Hsync/Vsync to SR2E/SR2F/SR30/SR33/SR34/SR3F */
/* Description : Set LCD timing */
/* --------------------------------------------------------------------- */
-void XGI_SetXG21CRTC(unsigned short ModeNo, unsigned short ModeIdIndex,
+static void XGI_SetXG21CRTC(unsigned short ModeNo, unsigned short ModeIdIndex,
unsigned short RefreshRateTableIndex,
struct vb_device_info *pVBInfo)
{
@@ -1426,7 +1406,7 @@ void XGI_SetXG21CRTC(unsigned short ModeNo, unsigned short ModeIdIndex,
}
}

-void XGI_SetXG27CRTC(unsigned short ModeNo, unsigned short ModeIdIndex,
+static void XGI_SetXG27CRTC(unsigned short ModeNo, unsigned short ModeIdIndex,
unsigned short RefreshRateTableIndex,
struct vb_device_info *pVBInfo)
{
@@ -1545,7 +1525,7 @@ void XGI_SetXG27CRTC(unsigned short ModeNo, unsigned short ModeIdIndex,
/* Output : FCLK duty cycle, FCLK delay compensation */
/* Description : All values set zero */
/* --------------------------------------------------------------------- */
-void XGI_SetXG21LCD(struct vb_device_info *pVBInfo,
+static void XGI_SetXG21LCD(struct vb_device_info *pVBInfo,
unsigned short RefreshRateTableIndex, unsigned short ModeNo)
{
unsigned short Data, Temp, b3CC;
@@ -1591,7 +1571,7 @@ void XGI_SetXG21LCD(struct vb_device_info *pVBInfo,
}
}

-void XGI_SetXG27LCD(struct vb_device_info *pVBInfo,
+static void XGI_SetXG27LCD(struct vb_device_info *pVBInfo,
unsigned short RefreshRateTableIndex, unsigned short ModeNo)
{
unsigned short Data, Temp, b3CC;
@@ -1645,7 +1625,7 @@ void XGI_SetXG27LCD(struct vb_device_info *pVBInfo,
/* Output : CRT1 CRTC */
/* Description : Modify CRT1 Hsync/Vsync to fix LCD mode timing */
/* --------------------------------------------------------------------- */
-void XGI_UpdateXG21CRTC(unsigned short ModeNo, struct vb_device_info *pVBInfo,
+static void XGI_UpdateXG21CRTC(unsigned short ModeNo, struct vb_device_info *pVBInfo,
unsigned short RefreshRateTableIndex)
{
int i, index = -1;
@@ -1685,7 +1665,7 @@ void XGI_UpdateXG21CRTC(unsigned short ModeNo, struct vb_device_info *pVBInfo,
}
}

-void XGI_SetCRT1DE(struct xgi_hw_device_info *HwDeviceExtension,
+static void XGI_SetCRT1DE(struct xgi_hw_device_info *HwDeviceExtension,
unsigned short ModeNo, unsigned short ModeIdIndex,
unsigned short RefreshRateTableIndex,
struct vb_device_info *pVBInfo)
@@ -1772,7 +1752,7 @@ unsigned short XGI_GetResInfo(unsigned short ModeNo,
return resindex;
}

-void XGI_SetCRT1Offset(unsigned short ModeNo, unsigned short ModeIdIndex,
+static void XGI_SetCRT1Offset(unsigned short ModeNo, unsigned short ModeIdIndex,
unsigned short RefreshRateTableIndex,
struct xgi_hw_device_info *HwDeviceExtension,
struct vb_device_info *pVBInfo)
@@ -1855,7 +1835,7 @@ void XGI_SetCRT1Offset(unsigned short ModeNo, unsigned short ModeIdIndex,
XGINew_SetReg1(pVBInfo->P3c4, 0x10, ah);
}

-void XGI_SetCRT1VCLK(unsigned short ModeNo, unsigned short ModeIdIndex,
+static void XGI_SetCRT1VCLK(unsigned short ModeNo, unsigned short ModeIdIndex,
struct xgi_hw_device_info *HwDeviceExtension,
unsigned short RefreshRateTableIndex,
struct vb_device_info *pVBInfo)
@@ -1912,7 +1892,7 @@ void XGI_SetCRT1VCLK(unsigned short ModeNo, unsigned short ModeIdIndex,
}
}

-void XGI_SetCRT1FIFO(unsigned short ModeNo,
+static void XGI_SetCRT1FIFO(unsigned short ModeNo,
struct xgi_hw_device_info *HwDeviceExtension,
struct vb_device_info *pVBInfo)
{
@@ -1948,7 +1928,7 @@ void XGI_SetCRT1FIFO(unsigned short ModeNo,
XGI_SetXG21FPBits(pVBInfo); /* Fix SR9[7:6] can't read back */
}

-void XGI_SetCRT1ModeRegs(struct xgi_hw_device_info *HwDeviceExtension,
+static void XGI_SetCRT1ModeRegs(struct xgi_hw_device_info *HwDeviceExtension,
unsigned short ModeNo, unsigned short ModeIdIndex,
unsigned short RefreshRateTableIndex,
struct vb_device_info *pVBInfo)
@@ -2063,7 +2043,7 @@ void XGI_SetCRT1ModeRegs(struct xgi_hw_device_info *HwDeviceExtension,

}

-void XGI_SetVCLKState(struct xgi_hw_device_info *HwDeviceExtension,
+static void XGI_SetVCLKState(struct xgi_hw_device_info *HwDeviceExtension,
unsigned short ModeNo, unsigned short RefreshRateTableIndex,
struct vb_device_info *pVBInfo)
{
@@ -2149,7 +2129,7 @@ void XGI_VesaLowResolution(unsigned short ModeNo, unsigned short ModeIdIndex, st
}
*/

-void XGI_LoadDAC(unsigned short ModeNo, unsigned short ModeIdIndex,
+static void XGI_LoadDAC(unsigned short ModeNo, unsigned short ModeIdIndex,
struct vb_device_info *pVBInfo)
{
unsigned short data, data2, time, i, j, k, m, n, o, si, di, bx, dl, al,
@@ -2241,7 +2221,7 @@ void XGI_LoadDAC(unsigned short ModeNo, unsigned short ModeIdIndex,
}
}

-void XGI_WriteDAC(unsigned short dl, unsigned short ah, unsigned short al,
+static void XGI_WriteDAC(unsigned short dl, unsigned short ah, unsigned short al,
unsigned short dh, struct vb_device_info *pVBInfo)
{
unsigned short temp, bh, bl;
@@ -2268,7 +2248,7 @@ void XGI_WriteDAC(unsigned short dl, unsigned short ah, unsigned short al,
XGINew_SetReg3(pVBInfo->P3c9, (unsigned short) bl);
}

-void XGI_SetLCDAGroup(unsigned short ModeNo, unsigned short ModeIdIndex,
+static void XGI_SetLCDAGroup(unsigned short ModeNo, unsigned short ModeIdIndex,
struct xgi_hw_device_info *HwDeviceExtension,
struct vb_device_info *pVBInfo)
{
@@ -2288,7 +2268,7 @@ void XGI_SetLCDAGroup(unsigned short ModeNo, unsigned short ModeIdIndex,
XGI_SetCRT2ECLK(ModeNo, ModeIdIndex, RefreshRateTableIndex, pVBInfo);
}

-void XGI_GetLVDSResInfo(unsigned short ModeNo, unsigned short ModeIdIndex,
+static void XGI_GetLVDSResInfo(unsigned short ModeNo, unsigned short ModeIdIndex,
struct vb_device_info *pVBInfo)
{
unsigned short resindex, xres, yres, modeflag;
@@ -2337,7 +2317,7 @@ void XGI_GetLVDSResInfo(unsigned short ModeNo, unsigned short ModeIdIndex,
pVBInfo->VDE = yres;
}

-void XGI_GetLVDSData(unsigned short ModeNo, unsigned short ModeIdIndex,
+static void XGI_GetLVDSData(unsigned short ModeNo, unsigned short ModeIdIndex,
unsigned short RefreshRateTableIndex,
struct vb_device_info *pVBInfo)
{
@@ -2392,7 +2372,7 @@ void XGI_GetLVDSData(unsigned short ModeNo, unsigned short ModeIdIndex,
}
}

-void XGI_ModCRT1Regs(unsigned short ModeNo, unsigned short ModeIdIndex,
+static void XGI_ModCRT1Regs(unsigned short ModeNo, unsigned short ModeIdIndex,
unsigned short RefreshRateTableIndex,
struct xgi_hw_device_info *HwDeviceExtension,
struct vb_device_info *pVBInfo)
@@ -2507,7 +2487,7 @@ void XGI_ModCRT1Regs(unsigned short ModeNo, unsigned short ModeIdIndex,
}
}

-void XGI_SetLVDSRegs(unsigned short ModeNo, unsigned short ModeIdIndex,
+static void XGI_SetLVDSRegs(unsigned short ModeNo, unsigned short ModeIdIndex,
unsigned short RefreshRateTableIndex,
struct vb_device_info *pVBInfo)
{
@@ -2802,7 +2782,7 @@ void XGI_SetLVDSRegs(unsigned short ModeNo, unsigned short ModeIdIndex,
}
}

-void XGI_SetCRT2ECLK(unsigned short ModeNo, unsigned short ModeIdIndex,
+static void XGI_SetCRT2ECLK(unsigned short ModeNo, unsigned short ModeIdIndex,
unsigned short RefreshRateTableIndex,
struct vb_device_info *pVBInfo)
{
@@ -2831,7 +2811,7 @@ void XGI_SetCRT2ECLK(unsigned short ModeNo, unsigned short ModeIdIndex,
}
}

-void XGI_UpdateModeInfo(struct xgi_hw_device_info *HwDeviceExtension,
+static void XGI_UpdateModeInfo(struct xgi_hw_device_info *HwDeviceExtension,
struct vb_device_info *pVBInfo)
{
unsigned short tempcl, tempch, temp, tempbl, tempax;
@@ -3702,7 +3682,7 @@ void XGI_DisplayOff(struct xgi_hw_device_info *pXGIHWDE,
XGINew_SetRegANDOR(pVBInfo->P3c4, 0x01, 0xDF, 0x20);
}

-void XGI_WaitDisply(struct vb_device_info *pVBInfo)
+static void XGI_WaitDisply(struct vb_device_info *pVBInfo)
{
while ((XGINew_GetReg2(pVBInfo->P3da) & 0x01))
break;
@@ -3860,13 +3840,13 @@ unsigned char XGI_SetCRT2Group301(unsigned short ModeNo,
return 1;
}

-void XGI_AutoThreshold(struct vb_device_info *pVBInfo)
+static void XGI_AutoThreshold(struct vb_device_info *pVBInfo)
{
if (!(pVBInfo->SetFlag & Win9xDOSMode))
XGINew_SetRegOR(pVBInfo->Part1Port, 0x01, 0x40);
}

-void XGI_SaveCRT2Info(unsigned short ModeNo, struct vb_device_info *pVBInfo)
+static void XGI_SaveCRT2Info(unsigned short ModeNo, struct vb_device_info *pVBInfo)
{
unsigned short temp1, temp2;

@@ -3876,7 +3856,7 @@ void XGI_SaveCRT2Info(unsigned short ModeNo, struct vb_device_info *pVBInfo)
XGINew_SetRegANDOR(pVBInfo->P3d4, 0x31, temp2, temp1);
}

-void XGI_GetCRT2ResInfo(unsigned short ModeNo, unsigned short ModeIdIndex,
+static void XGI_GetCRT2ResInfo(unsigned short ModeNo, unsigned short ModeIdIndex,
struct vb_device_info *pVBInfo)
{
unsigned short xres, yres, modeflag, resindex;
@@ -3951,7 +3931,7 @@ void XGI_GetCRT2ResInfo(unsigned short ModeNo, unsigned short ModeIdIndex,
pVBInfo->VDE = yres;
}

-unsigned char XGI_IsLCDDualLink(struct vb_device_info *pVBInfo)
+static unsigned char XGI_IsLCDDualLink(struct vb_device_info *pVBInfo)
{

if ((pVBInfo->VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) &&
@@ -3961,7 +3941,7 @@ unsigned char XGI_IsLCDDualLink(struct vb_device_info *pVBInfo)
return 0;
}

-void XGI_GetCRT2Data(unsigned short ModeNo, unsigned short ModeIdIndex,
+static void XGI_GetCRT2Data(unsigned short ModeNo, unsigned short ModeIdIndex,
unsigned short RefreshRateTableIndex,
struct vb_device_info *pVBInfo)
{
@@ -4147,7 +4127,7 @@ void XGI_GetCRT2Data(unsigned short ModeNo, unsigned short ModeIdIndex,
}
}

-void XGI_SetCRT2VCLK(unsigned short ModeNo, unsigned short ModeIdIndex,
+static void XGI_SetCRT2VCLK(unsigned short ModeNo, unsigned short ModeIdIndex,
unsigned short RefreshRateTableIndex,
struct vb_device_info *pVBInfo)
{
@@ -4182,7 +4162,7 @@ void XGI_SetCRT2VCLK(unsigned short ModeNo, unsigned short ModeIdIndex,
/* Output : al -> VCLK Index */
/* Description : */
/* --------------------------------------------------------------------- */
-void XGI_GetLCDVCLKPtr(unsigned char *di_0, unsigned char *di_1,
+static void XGI_GetLCDVCLKPtr(unsigned char *di_0, unsigned char *di_1,
struct vb_device_info *pVBInfo)
{
unsigned short index;
@@ -4207,7 +4187,7 @@ void XGI_GetLCDVCLKPtr(unsigned char *di_0, unsigned char *di_1,
return;
}

-unsigned char XGI_GetVCLKPtr(unsigned short RefreshRateTableIndex,
+static unsigned char XGI_GetVCLKPtr(unsigned short RefreshRateTableIndex,
unsigned short ModeNo, unsigned short ModeIdIndex,
struct vb_device_info *pVBInfo)
{
@@ -4364,7 +4344,7 @@ unsigned char XGI_GetVCLKPtr(unsigned short RefreshRateTableIndex,
return tempal;
}

-void XGI_GetVCLKLen(unsigned char tempal, unsigned char *di_0,
+static void XGI_GetVCLKLen(unsigned char tempal, unsigned char *di_0,
unsigned char *di_1, struct vb_device_info *pVBInfo)
{
if (pVBInfo->IF_DEF_CH7007 == 1) { /* [Billy] 2007/05/16 */
@@ -4406,7 +4386,7 @@ static void XGI_SetCRT2Offset(unsigned short ModeNo,
XGINew_SetReg1(pVBInfo->Part1Port, 0x03, temp);
}

-unsigned short XGI_GetOffset(unsigned short ModeNo, unsigned short ModeIdIndex,
+static unsigned short XGI_GetOffset(unsigned short ModeNo, unsigned short ModeIdIndex,
unsigned short RefreshRateTableIndex,
struct xgi_hw_device_info *HwDeviceExtension,
struct vb_device_info *pVBInfo)
@@ -4447,7 +4427,7 @@ static void XGI_SetCRT2FIFO(struct vb_device_info *pVBInfo)
XGINew_SetRegANDOR(pVBInfo->Part1Port, 0x02, ~(0x3F), 0x04); /* threshold low default 04h */
}

-void XGI_PreSetGroup1(unsigned short ModeNo, unsigned short ModeIdIndex,
+static void XGI_PreSetGroup1(unsigned short ModeNo, unsigned short ModeIdIndex,
struct xgi_hw_device_info *HwDeviceExtension,
unsigned short RefreshRateTableIndex,
struct vb_device_info *pVBInfo)
@@ -4472,7 +4452,7 @@ void XGI_PreSetGroup1(unsigned short ModeNo, unsigned short ModeIdIndex,
XGINew_SetReg1(pVBInfo->Part1Port, 0x02, 0x44); /* temp 0206 */
}

-void XGI_SetGroup1(unsigned short ModeNo, unsigned short ModeIdIndex,
+static void XGI_SetGroup1(unsigned short ModeNo, unsigned short ModeIdIndex,
struct xgi_hw_device_info *HwDeviceExtension,
unsigned short RefreshRateTableIndex,
struct vb_device_info *pVBInfo)
@@ -4625,7 +4605,7 @@ void XGI_SetGroup1(unsigned short ModeNo, unsigned short ModeIdIndex,
XGINew_SetRegANDOR(pVBInfo->Part1Port, 0x2C, ~0x0C0, tempax);
}

-void XGI_SetLockRegs(unsigned short ModeNo, unsigned short ModeIdIndex,
+static void XGI_SetLockRegs(unsigned short ModeNo, unsigned short ModeIdIndex,
struct xgi_hw_device_info *HwDeviceExtension,
unsigned short RefreshRateTableIndex,
struct vb_device_info *pVBInfo)
@@ -5004,7 +4984,7 @@ void XGI_SetLockRegs(unsigned short ModeNo, unsigned short ModeIdIndex,
return;
}

-void XGI_SetGroup2(unsigned short ModeNo, unsigned short ModeIdIndex,
+static void XGI_SetGroup2(unsigned short ModeNo, unsigned short ModeIdIndex,
unsigned short RefreshRateTableIndex,
struct xgi_hw_device_info *HwDeviceExtension,
struct vb_device_info *pVBInfo)
@@ -5451,7 +5431,7 @@ void XGI_SetGroup2(unsigned short ModeNo, unsigned short ModeIdIndex,
return;
}

-void XGI_SetLCDRegs(unsigned short ModeNo, unsigned short ModeIdIndex,
+static void XGI_SetLCDRegs(unsigned short ModeNo, unsigned short ModeIdIndex,
struct xgi_hw_device_info *HwDeviceExtension,
unsigned short RefreshRateTableIndex,
struct vb_device_info *pVBInfo)
@@ -5676,7 +5656,7 @@ void XGI_SetLCDRegs(unsigned short ModeNo, unsigned short ModeIdIndex,
/* Output : di -> Tap4 Reg. Setting Pointer */
/* Description : */
/* --------------------------------------------------------------------- */
-struct XGI301C_Tap4TimingStruct *XGI_GetTap4Ptr(unsigned short tempcx,
+static struct XGI301C_Tap4TimingStruct *XGI_GetTap4Ptr(unsigned short tempcx,
struct vb_device_info *pVBInfo)
{
unsigned short tempax, tempbx, i;
@@ -5722,7 +5702,7 @@ struct XGI301C_Tap4TimingStruct *XGI_GetTap4Ptr(unsigned short tempcx,
return &Tap4TimingPtr[i];
}

-void XGI_SetTap4Regs(struct vb_device_info *pVBInfo)
+static void XGI_SetTap4Regs(struct vb_device_info *pVBInfo)
{
unsigned short i, j;

@@ -5752,7 +5732,7 @@ void XGI_SetTap4Regs(struct vb_device_info *pVBInfo)
#endif
}

-void XGI_SetGroup3(unsigned short ModeNo, unsigned short ModeIdIndex,
+static void XGI_SetGroup3(unsigned short ModeNo, unsigned short ModeIdIndex,
struct vb_device_info *pVBInfo)
{
unsigned short i;
@@ -5811,7 +5791,7 @@ void XGI_SetGroup3(unsigned short ModeNo, unsigned short ModeIdIndex,
return;
} /* {end of XGI_SetGroup3} */

-void XGI_SetGroup4(unsigned short ModeNo, unsigned short ModeIdIndex,
+static void XGI_SetGroup4(unsigned short ModeNo, unsigned short ModeIdIndex,
unsigned short RefreshRateTableIndex,
struct xgi_hw_device_info *HwDeviceExtension,
struct vb_device_info *pVBInfo)
@@ -6014,7 +5994,7 @@ void XGI_SetGroup4(unsigned short ModeNo, unsigned short ModeIdIndex,
pVBInfo);
}

-void XGI_SetGroup5(unsigned short ModeNo, unsigned short ModeIdIndex,
+static void XGI_SetGroup5(unsigned short ModeNo, unsigned short ModeIdIndex,
struct vb_device_info *pVBInfo)
{
unsigned short Pindex, Pdata;
@@ -6031,7 +6011,7 @@ void XGI_SetGroup5(unsigned short ModeNo, unsigned short ModeIdIndex,
return;
}

-void *XGI_GetLcdPtr(unsigned short BX, unsigned short ModeNo,
+static void *XGI_GetLcdPtr(unsigned short BX, unsigned short ModeNo,
unsigned short ModeIdIndex,
unsigned short RefreshRateTableIndex,
struct vb_device_info *pVBInfo)
@@ -6502,7 +6482,7 @@ void *XGI_GetLcdPtr(unsigned short BX, unsigned short ModeNo,
return NULL;
}

-void *XGI_GetTVPtr(unsigned short BX, unsigned short ModeNo,
+static void *XGI_GetTVPtr(unsigned short BX, unsigned short ModeNo,
unsigned short ModeIdIndex,
unsigned short RefreshRateTableIndex,
struct vb_device_info *pVBInfo)
@@ -6651,7 +6631,7 @@ void *XGI_GetTVPtr(unsigned short BX, unsigned short ModeNo,
/* Output : 1 -> Skip backlight control */
/* Description : */
/* --------------------------------------------------------------------- */
-unsigned char XGI_BacklightByDrv(struct vb_device_info *pVBInfo)
+static unsigned char XGI_BacklightByDrv(struct vb_device_info *pVBInfo)
{
unsigned char tempah;

@@ -6681,18 +6661,18 @@ void XGI_FirePWDDisable(struct vb_device_info *pVBInfo)
/* Output : */
/* Description : Turn on VDD & Backlight : Fire enable procedure */
/* --------------------------------------------------------------------- */
-void XGI_FirePWDEnable(struct vb_device_info *pVBInfo)
+static void XGI_FirePWDEnable(struct vb_device_info *pVBInfo)
{
XGINew_SetRegANDOR(pVBInfo->Part1Port, 0x26, 0x03, 0xFC);
}

-void XGI_EnableGatingCRT(struct xgi_hw_device_info *HwDeviceExtension,
+static void XGI_EnableGatingCRT(struct xgi_hw_device_info *HwDeviceExtension,
struct vb_device_info *pVBInfo)
{
XGINew_SetRegANDOR(pVBInfo->P3d4, 0x63, 0xBF, 0x40);
}

-void XGI_DisableGatingCRT(struct xgi_hw_device_info *HwDeviceExtension,
+static void XGI_DisableGatingCRT(struct xgi_hw_device_info *HwDeviceExtension,
struct vb_device_info *pVBInfo)
{

@@ -6709,7 +6689,7 @@ void XGI_DisableGatingCRT(struct xgi_hw_device_info *HwDeviceExtension,
/* : bl : 3 ; T3 : the duration between CPL off and signal off */
/* : bl : 4 ; T4 : the duration signal off and Vdd off */
/* --------------------------------------------------------------------- */
-void XGI_SetPanelDelay(unsigned short tempbl, struct vb_device_info *pVBInfo)
+static void XGI_SetPanelDelay(unsigned short tempbl, struct vb_device_info *pVBInfo)
{
unsigned short index;

@@ -6738,7 +6718,7 @@ void XGI_SetPanelDelay(unsigned short tempbl, struct vb_device_info *pVBInfo)
/* = 1011b = 0Bh ; Backlight off, Power on */
/* = 1111b = 0Fh ; Backlight off, Power off */
/* --------------------------------------------------------------------- */
-void XGI_SetPanelPower(unsigned short tempah, unsigned short tempbl,
+static void XGI_SetPanelPower(unsigned short tempah, unsigned short tempbl,
struct vb_device_info *pVBInfo)
{
if (pVBInfo->VBType & (VB_XGI301LV | VB_XGI302LV | VB_XGI301C))
@@ -6767,7 +6747,7 @@ static unsigned char XG21GPIODataTransfer(unsigned char ujDate)
/* bl[1] : LVDS backlight */
/* bl[0] : LVDS VDD */
/*----------------------------------------------------------------------------*/
-unsigned char XGI_XG21GetPSCValue(struct vb_device_info *pVBInfo)
+static unsigned char XGI_XG21GetPSCValue(struct vb_device_info *pVBInfo)
{
unsigned char CR4A, temp;

@@ -6788,7 +6768,7 @@ unsigned char XGI_XG21GetPSCValue(struct vb_device_info *pVBInfo)
/* bl[1] : LVDS backlight */
/* bl[0] : LVDS VDD */
/*----------------------------------------------------------------------------*/
-unsigned char XGI_XG27GetPSCValue(struct vb_device_info *pVBInfo)
+static unsigned char XGI_XG27GetPSCValue(struct vb_device_info *pVBInfo)
{
unsigned char CR4A, CRB4, temp;

@@ -6984,7 +6964,7 @@ void XGI_SetXG27FPBits(struct vb_device_info *pVBInfo)

}

-void XGI_SetXG21LVDSPara(unsigned short ModeNo, unsigned short ModeIdIndex,
+static void XGI_SetXG21LVDSPara(unsigned short ModeNo, unsigned short ModeIdIndex,
struct vb_device_info *pVBInfo)
{
unsigned char temp, Miscdata;
@@ -7170,7 +7150,7 @@ void XGI_SetXG21LVDSPara(unsigned short ModeNo, unsigned short ModeIdIndex,
}

/* no shadow case */
-void XGI_SetXG27LVDSPara(unsigned short ModeNo, unsigned short ModeIdIndex,
+static void XGI_SetXG27LVDSPara(unsigned short ModeNo, unsigned short ModeIdIndex,
struct vb_device_info *pVBInfo)
{
unsigned char temp, Miscdata;
@@ -7360,7 +7340,7 @@ void XGI_SetXG27LVDSPara(unsigned short ModeNo, unsigned short ModeIdIndex,
/* 1: Disable PSC */
/* Description : */
/* --------------------------------------------------------------------- */
-unsigned char XGI_IsLCDON(struct vb_device_info *pVBInfo)
+static unsigned char XGI_IsLCDON(struct vb_device_info *pVBInfo)
{
unsigned short tempax;

@@ -7373,7 +7353,7 @@ unsigned char XGI_IsLCDON(struct vb_device_info *pVBInfo)
return 0;
}

-void XGI_EnablePWD(struct vb_device_info *pVBInfo)
+static void XGI_EnablePWD(struct vb_device_info *pVBInfo)
{
unsigned short index, temp;

@@ -7391,7 +7371,7 @@ void XGI_EnablePWD(struct vb_device_info *pVBInfo)
XGINew_SetRegOR(pVBInfo->Part4Port, 0x27, 0x80); /* enable PWD */
}

-void XGI_DisablePWD(struct vb_device_info *pVBInfo)
+static void XGI_DisablePWD(struct vb_device_info *pVBInfo)
{
XGINew_SetRegAND(pVBInfo->Part4Port, 0x27, 0x7F); /* disable PWD */
}
@@ -7402,7 +7382,7 @@ void XGI_DisablePWD(struct vb_device_info *pVBInfo)
/* Output : 0 -> Not LCD Mode */
/* Description : */
/* --------------------------------------------------------------------- */
-unsigned char XGI_DisableChISLCD(struct vb_device_info *pVBInfo)
+static unsigned char XGI_DisableChISLCD(struct vb_device_info *pVBInfo)
{
unsigned short tempbx, tempah;

@@ -7429,7 +7409,7 @@ unsigned char XGI_DisableChISLCD(struct vb_device_info *pVBInfo)
/* Output : 0 -> Not LCD mode */
/* Description : */
/* --------------------------------------------------------------------- */
-unsigned char XGI_EnableChISLCD(struct vb_device_info *pVBInfo)
+static unsigned char XGI_EnableChISLCD(struct vb_device_info *pVBInfo)
{
unsigned short tempbx, tempah;

@@ -7450,7 +7430,7 @@ unsigned char XGI_EnableChISLCD(struct vb_device_info *pVBInfo)
return 0;
}

-unsigned short XGI_GetLCDCapPtr(struct vb_device_info *pVBInfo)
+static unsigned short XGI_GetLCDCapPtr(struct vb_device_info *pVBInfo)
{
unsigned char tempal, tempah, tempbl, i;

@@ -7477,7 +7457,7 @@ unsigned short XGI_GetLCDCapPtr(struct vb_device_info *pVBInfo)
return i;
}

-unsigned short XGI_GetLCDCapPtr1(struct vb_device_info *pVBInfo)
+static unsigned short XGI_GetLCDCapPtr1(struct vb_device_info *pVBInfo)
{
unsigned short tempah, tempal, tempbl, i;

@@ -7509,7 +7489,7 @@ unsigned short XGI_GetLCDCapPtr1(struct vb_device_info *pVBInfo)
return i;
}

-void XGI_GetLCDSync(unsigned short *HSyncWidth, unsigned short *VSyncWidth,
+static void XGI_GetLCDSync(unsigned short *HSyncWidth, unsigned short *VSyncWidth,
struct vb_device_info *pVBInfo)
{
unsigned short Index;
@@ -7876,7 +7856,7 @@ void XGI_DisableBridge(struct xgi_hw_device_info *HwDeviceExtension,
/* A : Ext750p */
/* B : St750p */
/* --------------------------------------------------------------------- */
-unsigned short XGI_GetTVPtrIndex(struct vb_device_info *pVBInfo)
+static unsigned short XGI_GetTVPtrIndex(struct vb_device_info *pVBInfo)
{
unsigned short tempbx = 0;

@@ -7902,7 +7882,7 @@ unsigned short XGI_GetTVPtrIndex(struct vb_device_info *pVBInfo)
/* Output : */
/* Description : Customized Param. for 301 */
/* --------------------------------------------------------------------- */
-void XGI_OEM310Setting(unsigned short ModeNo, unsigned short ModeIdIndex,
+static void XGI_OEM310Setting(unsigned short ModeNo, unsigned short ModeIdIndex,
struct vb_device_info *pVBInfo)
{
if (pVBInfo->SetFlag & Win9xDOSMode)
@@ -7925,7 +7905,7 @@ void XGI_OEM310Setting(unsigned short ModeNo, unsigned short ModeIdIndex,
}
}

-void XGI_SetDelayComp(struct vb_device_info *pVBInfo)
+static void XGI_SetDelayComp(struct vb_device_info *pVBInfo)
{
unsigned short index;

@@ -7993,7 +7973,7 @@ void XGI_SetDelayComp(struct vb_device_info *pVBInfo)
}
}

-void XGI_SetLCDCap(struct vb_device_info *pVBInfo)
+static void XGI_SetLCDCap(struct vb_device_info *pVBInfo)
{
unsigned short tempcx;

@@ -8030,7 +8010,7 @@ void XGI_SetLCDCap(struct vb_device_info *pVBInfo)
}
}

-void XGI_SetLCDCap_A(unsigned short tempcx, struct vb_device_info *pVBInfo)
+static void XGI_SetLCDCap_A(unsigned short tempcx, struct vb_device_info *pVBInfo)
{
unsigned short temp;

@@ -8063,7 +8043,7 @@ void XGI_SetLCDCap_A(unsigned short tempcx, struct vb_device_info *pVBInfo)
/* Output : */
/* Description : */
/* --------------------------------------------------------------------- */
-void XGI_SetLCDCap_B(unsigned short tempcx, struct vb_device_info *pVBInfo)
+static void XGI_SetLCDCap_B(unsigned short tempcx, struct vb_device_info *pVBInfo)
{
if (tempcx & EnableLCD24bpp) /* 24bits */
XGINew_SetRegANDOR(pVBInfo->Part2Port, 0x1A, 0xE0,
@@ -8075,7 +8055,7 @@ void XGI_SetLCDCap_B(unsigned short tempcx, struct vb_device_info *pVBInfo)
| 0x18)); /* Enable Dither */
}

-void SetSpectrum(struct vb_device_info *pVBInfo)
+static void SetSpectrum(struct vb_device_info *pVBInfo)
{
unsigned short index;

@@ -8104,7 +8084,7 @@ void SetSpectrum(struct vb_device_info *pVBInfo)
/* Output : */
/* Description : Set TV Customized Param. */
/* --------------------------------------------------------------------- */
-void XGI_SetAntiFlicker(unsigned short ModeNo, unsigned short ModeIdIndex,
+static void XGI_SetAntiFlicker(unsigned short ModeNo, unsigned short ModeIdIndex,
struct vb_device_info *pVBInfo)
{
unsigned short tempbx, index;
@@ -8129,7 +8109,7 @@ void XGI_SetAntiFlicker(unsigned short ModeNo, unsigned short ModeIdIndex,
XGINew_SetRegANDOR(pVBInfo->Part2Port, 0x0A, 0x8F, tempah);
}

-void XGI_SetEdgeEnhance(unsigned short ModeNo, unsigned short ModeIdIndex,
+static void XGI_SetEdgeEnhance(unsigned short ModeNo, unsigned short ModeIdIndex,
struct vb_device_info *pVBInfo)
{
unsigned short tempbx, index;
@@ -8151,7 +8131,7 @@ void XGI_SetEdgeEnhance(unsigned short ModeNo, unsigned short ModeIdIndex,
XGINew_SetRegANDOR(pVBInfo->Part2Port, 0x3A, 0x1F, tempah);
}

-void XGI_SetPhaseIncr(struct vb_device_info *pVBInfo)
+static void XGI_SetPhaseIncr(struct vb_device_info *pVBInfo)
{
unsigned short tempbx;

@@ -8172,7 +8152,7 @@ void XGI_SetPhaseIncr(struct vb_device_info *pVBInfo)
& 0xFF000000) >> 24));
}

-void XGI_SetYFilter(unsigned short ModeNo, unsigned short ModeIdIndex,
+static void XGI_SetYFilter(unsigned short ModeNo, unsigned short ModeIdIndex,
struct vb_device_info *pVBInfo)
{
unsigned short tempbx, index;
@@ -8269,7 +8249,7 @@ void XGI_SetYFilter(unsigned short ModeNo, unsigned short ModeIdIndex,
/* 1 : 301B/302B/301LV/302LV */
/* Description : */
/* --------------------------------------------------------------------- */
-void XGI_GetTVPtrIndex2(unsigned short *tempbx, unsigned char *tempcl,
+static void XGI_GetTVPtrIndex2(unsigned short *tempbx, unsigned char *tempcl,
unsigned char *tempch, struct vb_device_info *pVBInfo)
{
*tempbx = 0;
@@ -8516,7 +8496,7 @@ void XGI_SetCRT2ModeRegs(unsigned short ModeNo,
}
}

-void XGI_CloseCRTC(struct xgi_hw_device_info *HwDeviceExtension,
+static void XGI_CloseCRTC(struct xgi_hw_device_info *HwDeviceExtension,
struct vb_device_info *pVBInfo)
{
unsigned short tempbx;
@@ -8535,7 +8515,7 @@ void XGI_OpenCRTC(struct xgi_hw_device_info *HwDeviceExtension,
tempbx = 0;
}

-void XGI_GetRAMDAC2DATA(unsigned short ModeNo, unsigned short ModeIdIndex,
+static void XGI_GetRAMDAC2DATA(unsigned short ModeNo, unsigned short ModeIdIndex,
unsigned short RefreshRateTableIndex,
struct vb_device_info *pVBInfo)
{
@@ -8592,7 +8572,7 @@ void XGI_GetRAMDAC2DATA(unsigned short ModeNo, unsigned short ModeIdIndex,
pVBInfo->VT = tempbx;
}

-unsigned short XGI_GetColorDepth(unsigned short ModeNo,
+static unsigned short XGI_GetColorDepth(unsigned short ModeNo,
unsigned short ModeIdIndex, struct vb_device_info *pVBInfo)
{
unsigned short ColorDepth[6] = { 1, 2, 4, 4, 6, 8 };
@@ -8628,7 +8608,7 @@ void XGI_LockCRT2(struct xgi_hw_device_info *HwDeviceExtension,

}

-void XGINew_EnableCRT2(struct vb_device_info *pVBInfo)
+static void XGINew_EnableCRT2(struct vb_device_info *pVBInfo)
{
XGINew_SetRegANDOR(pVBInfo->P3c4, 0x1E, 0xFF, 0x20);
}
@@ -8667,7 +8647,7 @@ void XGI_LongWait(struct vb_device_info *pVBInfo)
}
}

-void XGI_VBLongWait(struct vb_device_info *pVBInfo)
+static void XGI_VBLongWait(struct vb_device_info *pVBInfo)
{
unsigned short tempal, temp, i, j;
return;
@@ -8699,7 +8679,7 @@ void XGI_VBLongWait(struct vb_device_info *pVBInfo)
return;
}

-unsigned short XGI_GetVGAHT2(struct vb_device_info *pVBInfo)
+static unsigned short XGI_GetVGAHT2(struct vb_device_info *pVBInfo)
{
unsigned long tempax, tempbx;

@@ -8711,7 +8691,7 @@ unsigned short XGI_GetVGAHT2(struct vb_device_info *pVBInfo)
return (unsigned short) tempax;
}

-unsigned short XGI_GetVCLK2Ptr(unsigned short ModeNo,
+static unsigned short XGI_GetVCLK2Ptr(unsigned short ModeNo,
unsigned short ModeIdIndex,
unsigned short RefreshRateTableIndex,
struct xgi_hw_device_info *HwDeviceExtension,
diff --git a/drivers/staging/xgifb/vb_setmode.h b/drivers/staging/xgifb/vb_setmode.h
index 0dcc297..7a2e564 100644
--- a/drivers/staging/xgifb/vb_setmode.h
+++ b/drivers/staging/xgifb/vb_setmode.h
@@ -17,9 +17,6 @@ extern void XGI_SenseCRT1(struct vb_device_info *);
extern void XGI_GetVGAType(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *);
extern void XGI_GetVBInfo(unsigned short ModeNo, unsigned short ModeIdIndex, struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *);
extern void XGI_GetTVInfo(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *);
-extern void XGI_SetCRT1Offset(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *);
-extern void XGI_SetLCDAGroup(unsigned short ModeNo, unsigned short ModeIdIndex, struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *);
-extern void XGI_WaitDisply(struct vb_device_info *);
extern unsigned short XGI_GetResInfo(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo);

extern unsigned char XGISetModeNew(struct xgi_hw_device_info *HwDeviceExtension, unsigned short ModeNo) ;
@@ -36,7 +33,6 @@ extern void XGI_XG21BLSignalVDD(unsigned short tempbh, unsigned short temp
extern void XGI_XG27BLSignalVDD(unsigned short tempbh, unsigned short tempbl, struct vb_device_info *pVBInfo);
extern void XGI_XG21SetPanelDelay(unsigned short tempbl, struct vb_device_info *pVBInfo);
extern unsigned char XGI_XG21CheckLVDSMode(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo);
-extern void XGI_SetXG21LVDSPara(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo);
extern unsigned short XGI_GetLVDSOEMTableIndex(struct vb_device_info *pVBInfo);

#endif
--
1.5.6.5

2011-03-08 20:16:35

by Aaro Koskinen

[permalink] [raw]
Subject: [PATCH 15/15] staging: xgifb: vb_init: make internal functions static

Make some internal functions static.

Signed-off-by: Aaro Koskinen <[email protected]>
---
drivers/staging/xgifb/vb_ext.h | 3 --
drivers/staging/xgifb/vb_init.c | 51 ++++++++++++++++++++-------------------
2 files changed, 26 insertions(+), 28 deletions(-)

diff --git a/drivers/staging/xgifb/vb_ext.h b/drivers/staging/xgifb/vb_ext.h
index 6824525..cabe365 100644
--- a/drivers/staging/xgifb/vb_ext.h
+++ b/drivers/staging/xgifb/vb_ext.h
@@ -22,9 +22,6 @@ typedef union _X86_REGS {
} X86_REGS, *PX86_REGS;

extern void XGI_GetSenseStatus(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo);
-extern void XGINew_SetModeScratch(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) ;
-extern void ReadVBIOSTablData(unsigned char ChipType,
- struct vb_device_info *pVBInfo);
extern unsigned short XGINew_SenseLCD(struct xgi_hw_device_info *,
struct vb_device_info *pVBInfo);

diff --git a/drivers/staging/xgifb/vb_init.c b/drivers/staging/xgifb/vb_init.c
index 2cf50dd..4bbcff6 100644
--- a/drivers/staging/xgifb/vb_init.c
+++ b/drivers/staging/xgifb/vb_init.c
@@ -37,22 +37,23 @@ static unsigned short XGINew_DDRDRAM_TYPE20[12][5] = {
{ 2, 12, 9, 8, 0x35},
{ 2, 12, 8, 4, 0x31} };

-void XGINew_SetDRAMSize_340(struct xgi_hw_device_info *, struct vb_device_info *);
-void XGINew_SetMemoryClock(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *);
-void XGINew_SetDRAMDefaultRegister340(struct xgi_hw_device_info *HwDeviceExtension,
+static void XGINew_SetDRAMSize_340(struct xgi_hw_device_info *, struct vb_device_info *);
+static void XGINew_SetMemoryClock(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *);
+static void XGINew_SetDRAMDefaultRegister340(struct xgi_hw_device_info *HwDeviceExtension,
unsigned long, struct vb_device_info *);
-unsigned char XGINew_GetXG20DRAMType(struct xgi_hw_device_info *HwDeviceExtension,
+static unsigned char XGINew_GetXG20DRAMType(struct xgi_hw_device_info *HwDeviceExtension,
struct vb_device_info *pVBInfo);

-int XGINew_DDRSizing340(struct xgi_hw_device_info *, struct vb_device_info *);
+static int XGINew_DDRSizing340(struct xgi_hw_device_info *, struct vb_device_info *);
static int XGINew_RAMType; /*int ModeIDOffset,StandTable,CRT1Table,ScreenOffset,REFIndex;*/
-void ReadVBIOSTablData(unsigned char ChipType, struct vb_device_info *pVBInfo);
-void XGINew_DDR1x_MRS_XG20(unsigned long P3c4, struct vb_device_info *pVBInfo);
-void XGINew_ChkSenseStatus(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) ;
-void XGINew_GetXG21Sense(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) ;
-unsigned char GetXG21FPBits(struct vb_device_info *pVBInfo);
-void XGINew_GetXG27Sense(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) ;
-unsigned char GetXG27FPBits(struct vb_device_info *pVBInfo);
+static void ReadVBIOSTablData(unsigned char ChipType, struct vb_device_info *pVBInfo);
+static void XGINew_DDR1x_MRS_XG20(unsigned long P3c4, struct vb_device_info *pVBInfo);
+static void XGINew_ChkSenseStatus(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) ;
+static void XGINew_GetXG21Sense(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) ;
+static unsigned char GetXG21FPBits(struct vb_device_info *pVBInfo);
+static void XGINew_GetXG27Sense(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) ;
+static unsigned char GetXG27FPBits(struct vb_device_info *pVBInfo);
+static void XGINew_SetModeScratch(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) ;

static void DelayUS(unsigned long MicroSeconds)
{
@@ -419,7 +420,7 @@ unsigned char XGIInitNew(struct xgi_hw_device_info *HwDeviceExtension)

/* ============== alan ====================== */

-unsigned char XGINew_GetXG20DRAMType(struct xgi_hw_device_info *HwDeviceExtension,
+static unsigned char XGINew_GetXG20DRAMType(struct xgi_hw_device_info *HwDeviceExtension,
struct vb_device_info *pVBInfo)
{
unsigned char data, temp;
@@ -705,7 +706,7 @@ static void XGINew_DDR2_DefaultRegister(
XGINew_DDR2_MRS_XG20(HwDeviceExtension, P3c4, pVBInfo);
}

-void XGINew_SetDRAMDefaultRegister340(
+static void XGINew_SetDRAMDefaultRegister340(
struct xgi_hw_device_info *HwDeviceExtension,
unsigned long Port, struct vb_device_info *pVBInfo)
{
@@ -834,7 +835,7 @@ void XGINew_SetDRAMDefaultRegister340(
XGINew_SetReg1(P3c4, 0x1B, pVBInfo->SR15[3][XGINew_RAMType]); /* SR1B */
}

-void XGINew_SetDRAMSize_340(struct xgi_hw_device_info *HwDeviceExtension,
+static void XGINew_SetDRAMSize_340(struct xgi_hw_device_info *HwDeviceExtension,
struct vb_device_info *pVBInfo)
{
unsigned short data;
@@ -1246,7 +1247,7 @@ static void XGINew_CheckChannel(struct xgi_hw_device_info *HwDeviceExtension,
}
}

-int XGINew_DDRSizing340(struct xgi_hw_device_info *HwDeviceExtension,
+static int XGINew_DDRSizing340(struct xgi_hw_device_info *HwDeviceExtension,
struct vb_device_info *pVBInfo)
{
int i;
@@ -1289,7 +1290,7 @@ int XGINew_DDRSizing340(struct xgi_hw_device_info *HwDeviceExtension,
return 0;
}

-void XGINew_SetMemoryClock(struct xgi_hw_device_info *HwDeviceExtension,
+static void XGINew_SetMemoryClock(struct xgi_hw_device_info *HwDeviceExtension,
struct vb_device_info *pVBInfo)
{

@@ -1314,7 +1315,7 @@ void XGINew_SetMemoryClock(struct xgi_hw_device_info *HwDeviceExtension,
}
}

-void ReadVBIOSTablData(unsigned char ChipType, struct vb_device_info *pVBInfo)
+static void ReadVBIOSTablData(unsigned char ChipType, struct vb_device_info *pVBInfo)
{
volatile unsigned char *pVideoMemory = (unsigned char *) pVBInfo->ROMAddr;
unsigned long i;
@@ -1404,7 +1405,7 @@ void ReadVBIOSTablData(unsigned char ChipType, struct vb_device_info *pVBInfo)
}
}

-void XGINew_DDR1x_MRS_XG20(unsigned long P3c4, struct vb_device_info *pVBInfo)
+static void XGINew_DDR1x_MRS_XG20(unsigned long P3c4, struct vb_device_info *pVBInfo)
{

XGINew_SetReg1(P3c4, 0x18, 0x01);
@@ -1434,7 +1435,7 @@ void XGINew_DDR1x_MRS_XG20(unsigned long P3c4, struct vb_device_info *pVBInfo)
XGINew_SetReg1(P3c4, 0x1B, 0x00);
}

-void XGINew_ChkSenseStatus(struct xgi_hw_device_info *HwDeviceExtension,
+static void XGINew_ChkSenseStatus(struct xgi_hw_device_info *HwDeviceExtension,
struct vb_device_info *pVBInfo)
{
unsigned short tempbx = 0, temp, tempcx, CR3CData;
@@ -1482,7 +1483,7 @@ void XGINew_ChkSenseStatus(struct xgi_hw_device_info *HwDeviceExtension,
XGINew_SetReg1(pVBInfo->P3d4, 0x3e, ((tempbx & 0xFF00) >> 8));
}

-void XGINew_SetModeScratch(struct xgi_hw_device_info *HwDeviceExtension,
+static void XGINew_SetModeScratch(struct xgi_hw_device_info *HwDeviceExtension,
struct vb_device_info *pVBInfo)
{
unsigned short temp, tempcl = 0, tempch = 0, CR31Data, CR38Data;
@@ -1564,7 +1565,7 @@ void XGINew_SetModeScratch(struct xgi_hw_device_info *HwDeviceExtension,

}

-void XGINew_GetXG21Sense(struct xgi_hw_device_info *HwDeviceExtension,
+static void XGINew_GetXG21Sense(struct xgi_hw_device_info *HwDeviceExtension,
struct vb_device_info *pVBInfo)
{
unsigned char Temp;
@@ -1598,7 +1599,7 @@ void XGINew_GetXG21Sense(struct xgi_hw_device_info *HwDeviceExtension,
#endif
}

-void XGINew_GetXG27Sense(struct xgi_hw_device_info *HwDeviceExtension,
+static void XGINew_GetXG27Sense(struct xgi_hw_device_info *HwDeviceExtension,
struct vb_device_info *pVBInfo)
{
unsigned char Temp, bCR4A;
@@ -1620,7 +1621,7 @@ void XGINew_GetXG27Sense(struct xgi_hw_device_info *HwDeviceExtension,

}

-unsigned char GetXG21FPBits(struct vb_device_info *pVBInfo)
+static unsigned char GetXG21FPBits(struct vb_device_info *pVBInfo)
{
unsigned char CR38, CR4A, temp;

@@ -1639,7 +1640,7 @@ unsigned char GetXG21FPBits(struct vb_device_info *pVBInfo)
return temp;
}

-unsigned char GetXG27FPBits(struct vb_device_info *pVBInfo)
+static unsigned char GetXG27FPBits(struct vb_device_info *pVBInfo)
{
unsigned char CR4A, temp;

--
1.5.6.5

2011-03-08 20:16:23

by Aaro Koskinen

[permalink] [raw]
Subject: [PATCH 04/15] staging: xgifb: delete unused fields from xgi_hw_device_info

Delete unused fields from xgi_hw_device_info.

Signed-off-by: Aaro Koskinen <[email protected]>
---
drivers/staging/xgifb/XGI_main_26.c | 4 ----
drivers/staging/xgifb/vgatypes.h | 29 -----------------------------
2 files changed, 0 insertions(+), 33 deletions(-)

diff --git a/drivers/staging/xgifb/XGI_main_26.c b/drivers/staging/xgifb/XGI_main_26.c
index aeccdee..fa30a26 100644
--- a/drivers/staging/xgifb/XGI_main_26.c
+++ b/drivers/staging/xgifb/XGI_main_26.c
@@ -2287,7 +2287,6 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
break;
}

- XGIhw_ext.pDevice = NULL;
if ((xgi_video_info.chip == XG21) || (XGIfb_userom)) {
XGIhw_ext.pjVirtualRomBase = xgifb_copy_rom(pdev);
if (XGIhw_ext.pjVirtualRomBase)
@@ -2298,10 +2297,7 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
XGIhw_ext.pjVirtualRomBase = NULL;
printk(KERN_INFO "XGIfb: Video ROM usage disabled\n");
}
- XGIhw_ext.pjCustomizedROMImage = NULL;
XGIhw_ext.pQueryVGAConfigSpace = &XGIfb_query_VGA_config_space;
- /* XGIhw_ext.pQueryNorthBridgeSpace = &XGIfb_query_north_bridge_space; */
- strcpy(XGIhw_ext.szVBIOSVer, "0.84");

if (!XGIvga_enabled) {
/* Mapping Max FB Size for 315 Init */
diff --git a/drivers/staging/xgifb/vgatypes.h b/drivers/staging/xgifb/vgatypes.h
index dacdac3..13c02be 100644
--- a/drivers/staging/xgifb/vgatypes.h
+++ b/drivers/staging/xgifb/vgatypes.h
@@ -4,10 +4,6 @@

#include <linux/ioctl.h>

-#ifndef VBIOS_VER_MAX_LENGTH
-#define VBIOS_VER_MAX_LENGTH 5
-#endif
-
#ifndef XGI_VB_CHIP_TYPE
enum XGI_VB_CHIP_TYPE {
VB_CHIP_Legacy = 0,
@@ -65,10 +61,6 @@ struct xgi_hw_device_info

unsigned char *pjVirtualRomBase; /* ROM image */

- unsigned char UseROM; /* Use the ROM image if provided */
-
- void *pDevice;
-
unsigned char *pjVideoMemoryAddress;/* base virtual memory address */
/* of Linear VGA memory */

@@ -76,12 +68,6 @@ struct xgi_hw_device_info

unsigned char *pjIOAddress; /* base I/O address of VGA ports (0x3B0) */

- unsigned char *pjCustomizedROMImage;
-
- unsigned char *pj2ndVideoMemoryAddress;
- unsigned long ul2ndVideoMemorySize;
-
- unsigned char *pj2ndIOAddress;
unsigned char jChipType; /* Used to Identify Graphics Chip */
/* defined in the data structure type */
/* "XGI_CHIP_TYPE" */
@@ -92,30 +78,15 @@ struct xgi_hw_device_info
/* defined in the data structure type */
/* "XGI_VB_CHIP_TYPE" */

- unsigned char bNewScratch;
-
unsigned long ulCRT2LCDType; /* defined in the data structure type */

- unsigned long usExternalChip; /* NO VB or other video bridge (other than */
- /* video bridge) */
-
unsigned char bIntegratedMMEnabled;/* supporting integration MM enable */

unsigned char bSkipSense;

- unsigned char bIsPowerSaving; /* True: XGIInit() is invoked by power management,
- otherwise by 2nd adapter's initialzation */
-
unsigned char(*pQueryVGAConfigSpace)(struct xgi_hw_device_info *,
unsigned long, unsigned long,
unsigned long *);
-
- unsigned char(*pQueryNorthBridgeSpace)(struct xgi_hw_device_info *,
- unsigned long, unsigned long,
- unsigned long *);
-
- unsigned char szVBIOSVer[VBIOS_VER_MAX_LENGTH];
-
};

/* Addtional IOCTL for communication xgifb <> X driver */
--
1.5.6.5

2011-03-08 20:16:26

by Aaro Koskinen

[permalink] [raw]
Subject: [PATCH 02/15] staging: xgifb: delete command queue selection/init

The driver does not utilize HW command queue in any way, so the code
can be dropped. The support for the default mode (MMIO) and AGP have
been disabled already anyway.

Signed-off-by: Aaro Koskinen <[email protected]>
---
drivers/staging/xgifb/XGI_main.h | 49 --------
drivers/staging/xgifb/XGI_main_26.c | 209 -----------------------------------
2 files changed, 0 insertions(+), 258 deletions(-)

diff --git a/drivers/staging/xgifb/XGI_main.h b/drivers/staging/xgifb/XGI_main.h
index 88d15c8..2c55faa 100644
--- a/drivers/staging/xgifb/XGI_main.h
+++ b/drivers/staging/xgifb/XGI_main.h
@@ -10,7 +10,6 @@
#include "vb_def.h"

//#define LINUXBIOS /* turn this on when compiling for LINUXBIOS */
-#define AGPOFF /* default is turn off AGP */

#define XGIFAIL(x) do { printk(x "\n"); return -EINVAL; } while(0)

@@ -66,19 +65,6 @@ MODULE_DEVICE_TABLE(pci, xgifb_pci_table);

#define MAX_ROM_SCAN 0x10000

-#define TURBO_QUEUE_CAP 0x40
-#define AGP_CMD_QUEUE_CAP 0x20
-#define VM_CMD_QUEUE_CAP 0x10
-#define MMIO_CMD_QUEUE_CAP 0x08
-
-
-
-/* For 315 series */
-
-#define COMMAND_QUEUE_AREA_SIZE 0x80000 /* 512K */
-#define COMMAND_QUEUE_THRESHOLD 0x1F
-
-
#define OH_ALLOC_SIZE 4000
#define SENTINEL 0x7fffffff

@@ -190,16 +176,6 @@ MODULE_DEVICE_TABLE(pci, xgifb_pci_table);
#define XGI_MEM_MAP_IO_ENABLE 0x01 /* SR20 */
#define XGI_PCI_ADDR_ENABLE 0x80

-#define XGI_AGP_CMDQUEUE_ENABLE 0x80 /* 315/650/740 SR26 */
-#define XGI_VRAM_CMDQUEUE_ENABLE 0x40
-#define XGI_MMIO_CMD_ENABLE 0x20
-#define XGI_CMD_QUEUE_SIZE_512k 0x00
-#define XGI_CMD_QUEUE_SIZE_1M 0x04
-#define XGI_CMD_QUEUE_SIZE_2M 0x08
-#define XGI_CMD_QUEUE_SIZE_4M 0x0C
-#define XGI_CMD_QUEUE_RESET 0x01
-#define XGI_CMD_AUTO_CORR 0x02
-
#define XGI_SIMULTANEOUS_VIEW_ENABLE 0x01 /* CR30 */
#define XGI_MODE_SELECT_CRT2 0x02
#define XGI_VB_OUTPUT_COMPOSITE 0x04
@@ -350,8 +326,6 @@ static int XGIfb_CRT2_write_enable = 0;
static int XGIfb_crt2type = -1; /* TW: CRT2 type (for overriding autodetection) */
static int XGIfb_tvplug = -1; /* PR: Tv plug type (for overriding autodetection) */

-static int XGIfb_queuemode = -1; /* TW: Use MMIO queue mode by default (310/325 series only) */
-
static unsigned char XGIfb_detectedpdc = 0;

static unsigned char XGIfb_detectedlcda = 0xff;
@@ -368,15 +342,6 @@ static struct xgi_hw_device_info XGIhw_ext;
/* TW: XGI private structure */
static struct vb_device_info XGI_Pr;

-/* card parameters */
-static u8 XGIfb_caps = 0;
-
-typedef enum _XGI_CMDTYPE {
- MMIO_CMD = 0,
- AGP_CMD_QUEUE,
- VM_CMD_QUEUE,
-} XGI_CMDTYPE;
-
#define MD_XGI300 1
#define MD_XGI315 2

@@ -519,20 +484,6 @@ static const struct _XGI_crt2type {
{"\0", -1, -1}
};

-/* Queue mode selection for 310 series */
-static const struct _XGI_queuemode {
- char name[6];
- int type_no;
-} XGI_queuemode[] = {
- {"AGP", AGP_CMD_QUEUE},
- {"VRAM", VM_CMD_QUEUE},
- {"MMIO", MMIO_CMD},
- {"agp", AGP_CMD_QUEUE},
- {"vram", VM_CMD_QUEUE},
- {"mmio", MMIO_CMD},
- {"\0", -1}
-};
-
/* TV standard */
static const struct _XGI_tvtype {
char name[6];
diff --git a/drivers/staging/xgifb/XGI_main_26.c b/drivers/staging/xgifb/XGI_main_26.c
index 3998dd4..08551e9 100644
--- a/drivers/staging/xgifb/XGI_main_26.c
+++ b/drivers/staging/xgifb/XGI_main_26.c
@@ -898,24 +898,6 @@ static void XGIfb_search_crt2type(const char *name)
printk(KERN_INFO "XGIfb: Invalid CRT2 type: %s\n", name);
}

-static void XGIfb_search_queuemode(const char *name)
-{
- int i = 0;
-
- if (name == NULL)
- return;
-
- while (XGI_queuemode[i].type_no != -1) {
- if (!strcmp(name, XGI_queuemode[i].name)) {
- XGIfb_queuemode = XGI_queuemode[i].type_no;
- break;
- }
- i++;
- }
- if (XGIfb_queuemode < 0)
- printk(KERN_INFO "XGIfb: Invalid queuemode type: %s\n", name);
-}
-
static u8 XGIfb_search_refresh_rate(unsigned int rate)
{
u16 xres, yres;
@@ -1906,19 +1888,6 @@ void XGI_Sense30x(void)
static int XGIfb_heap_init(void)
{
XGI_OH *poh;
- u8 temp = 0;
-
- int agp_enabled = 1;
- u32 agp_size;
- unsigned long *cmdq_baseport = NULL;
- unsigned long *read_port = NULL;
- unsigned long *write_port = NULL;
- XGI_CMDTYPE cmd_type;
-#ifndef AGPOFF
- struct agp_kern_info *agp_info;
- struct agp_memory *agp;
- u32 agp_phys;
-#endif

/* TW: The heap start is either set manually using the "mem" parameter, or
* defaults as follows:
@@ -1950,178 +1919,6 @@ static int XGIfb_heap_init(void)
+ xgi_video_info.video_size;
XGIfb_heap_size = XGIfb_heap_end - XGIfb_heap_start;

- /* TW: Now initialize the 310 series' command queue mode.
- * On 310/325, there are three queue modes available which
- * are chosen by setting bits 7:5 in SR26:
- * 1. MMIO queue mode (bit 5, 0x20). The hardware will keep
- * track of the queue, the FIFO, command parsing and so
- * on. This is the one comparable to the 300 series.
- * 2. VRAM queue mode (bit 6, 0x40). In this case, one will
- * have to do queue management himself. Register 0x85c4 will
- * hold the location of the next free queue slot, 0x85c8
- * is the "queue read pointer" whose way of working is
- * unknown to me. Anyway, this mode would require a
- * translation of the MMIO commands to some kind of
- * accelerator assembly and writing these commands
- * to the memory location pointed to by 0x85c4.
- * We will not use this, as nobody knows how this
- * "assembly" works, and as it would require a complete
- * re-write of the accelerator code.
- * 3. AGP queue mode (bit 7, 0x80). Works as 2., but keeps the
- * queue in AGP memory space.
- *
- * SR26 bit 4 is called "Bypass H/W queue".
- * SR26 bit 1 is called "Enable Command Queue Auto Correction"
- * SR26 bit 0 resets the queue
- * Size of queue memory is encoded in bits 3:2 like this:
- * 00 (0x00) 512K
- * 01 (0x04) 1M
- * 10 (0x08) 2M
- * 11 (0x0C) 4M
- * The queue location is to be written to 0x85C0.
- *
- */
- cmdq_baseport = (unsigned long *) (xgi_video_info.mmio_vbase
- + MMIO_QUEUE_PHYBASE);
- write_port = (unsigned long *) (xgi_video_info.mmio_vbase
- + MMIO_QUEUE_WRITEPORT);
- read_port = (unsigned long *) (xgi_video_info.mmio_vbase
- + MMIO_QUEUE_READPORT);
-
- DPRINTK("AGP base: 0x%p, read: 0x%p, write: 0x%p\n", cmdq_baseport, read_port, write_port);
-
- agp_size = COMMAND_QUEUE_AREA_SIZE;
-
-#ifndef AGPOFF
- if (XGIfb_queuemode == AGP_CMD_QUEUE) {
- agp_info = vzalloc(sizeof(*agp_info));
- agp_copy_info(agp_info);
-
- agp_backend_acquire();
-
- agp = agp_allocate_memory(COMMAND_QUEUE_AREA_SIZE / PAGE_SIZE,
- AGP_NORMAL_MEMORY);
- if (agp == NULL) {
- DPRINTK("XGIfb: Allocating AGP buffer failed.\n");
- agp_enabled = 0;
- } else {
- if (agp_bind_memory(agp, agp->pg_start) != 0) {
- DPRINTK("XGIfb: AGP: Failed to bind memory\n");
- /* TODO: Free AGP memory here */
- agp_enabled = 0;
- } else {
- agp_enable(0);
- }
- }
- }
-#else
- agp_enabled = 0;
-#endif
-
- /* TW: Now select the queue mode */
-
- if ((agp_enabled) && (XGIfb_queuemode == AGP_CMD_QUEUE)) {
- cmd_type = AGP_CMD_QUEUE;
- printk(KERN_INFO "XGIfb: Using AGP queue mode\n");
- /* } else if (XGIfb_heap_size >= COMMAND_QUEUE_AREA_SIZE) */
- } else if (XGIfb_queuemode == VM_CMD_QUEUE) {
- cmd_type = VM_CMD_QUEUE;
- printk(KERN_INFO "XGIfb: Using VRAM queue mode\n");
- } else {
- printk(KERN_INFO "XGIfb: Using MMIO queue mode\n");
- cmd_type = MMIO_CMD;
- }
-
- switch (agp_size) {
- case 0x80000:
- temp = XGI_CMD_QUEUE_SIZE_512k;
- break;
- case 0x100000:
- temp = XGI_CMD_QUEUE_SIZE_1M;
- break;
- case 0x200000:
- temp = XGI_CMD_QUEUE_SIZE_2M;
- break;
- case 0x400000:
- temp = XGI_CMD_QUEUE_SIZE_4M;
- break;
- }
-
- switch (cmd_type) {
- case AGP_CMD_QUEUE:
-#ifndef AGPOFF
- DPRINTK("XGIfb: AGP buffer base = 0x%lx, offset = 0x%x, size = %dK\n",
- agp_info->aper_base, agp->physical, agp_size/1024);
-
- agp_phys = agp_info->aper_base + agp->physical;
-
- outXGIIDXREG(XGICR, IND_XGI_AGP_IO_PAD, 0);
- outXGIIDXREG(XGICR, IND_XGI_AGP_IO_PAD, XGI_AGP_2X);
-
- outXGIIDXREG(XGISR, IND_XGI_CMDQUEUE_THRESHOLD, COMMAND_QUEUE_THRESHOLD);
-
- outXGIIDXREG(XGISR, IND_XGI_CMDQUEUE_SET, XGI_CMD_QUEUE_RESET);
-
- *write_port = *read_port;
-
- temp |= XGI_AGP_CMDQUEUE_ENABLE;
- outXGIIDXREG(XGISR, IND_XGI_CMDQUEUE_SET, temp);
-
- *cmdq_baseport = agp_phys;
-
- XGIfb_caps |= AGP_CMD_QUEUE_CAP;
-#endif
- break;
-
- case VM_CMD_QUEUE:
- XGIfb_heap_end -= COMMAND_QUEUE_AREA_SIZE;
- XGIfb_heap_size -= COMMAND_QUEUE_AREA_SIZE;
-
- outXGIIDXREG(XGISR, IND_XGI_CMDQUEUE_THRESHOLD, COMMAND_QUEUE_THRESHOLD);
-
- outXGIIDXREG(XGISR, IND_XGI_CMDQUEUE_SET, XGI_CMD_QUEUE_RESET);
-
- *write_port = *read_port;
-
- temp |= XGI_VRAM_CMDQUEUE_ENABLE;
- outXGIIDXREG(XGISR, IND_XGI_CMDQUEUE_SET, temp);
-
- *cmdq_baseport = xgi_video_info.video_size - COMMAND_QUEUE_AREA_SIZE;
-
- XGIfb_caps |= VM_CMD_QUEUE_CAP;
-
- DPRINTK("XGIfb: VM Cmd Queue offset = 0x%lx, size is %dK\n",
- *cmdq_baseport, COMMAND_QUEUE_AREA_SIZE/1024);
- break;
-
- default: /* MMIO */
-
- /* printk("%s:%d - I'm here\n", __FUNCTION__, __LINE__); */
- /* TW: This previously only wrote XGI_MMIO_CMD_ENABLE
- * to IND_XGI_CMDQUEUE_SET. I doubt that this is
- * enough. Reserve memory in any way.
- */
- /* FIXME XGIfb_heap_end -= COMMAND_QUEUE_AREA_SIZE; */
- /* FIXME XGIfb_heap_size -= COMMAND_QUEUE_AREA_SIZE; */
- /* FIXME */
- /* FIXME outXGIIDXREG(XGISR, IND_XGI_CMDQUEUE_THRESHOLD, COMMAND_QUEUE_THRESHOLD); */
- /* FIXME outXGIIDXREG(XGISR, IND_XGI_CMDQUEUE_SET, XGI_CMD_QUEUE_RESET); */
- /* FIXME */
- /* FIXME *write_port = *read_port; */
- /* FIXME */
- /* FIXME *//* TW: Set Auto_Correction bit */
- /* FIXME temp |= (XGI_MMIO_CMD_ENABLE | XGI_CMD_AUTO_CORR); */
- /* FIXME outXGIIDXREG(XGISR, IND_XGI_CMDQUEUE_SET, temp); */
- /* FIXME */
- /* FIXME *cmdq_baseport = xgi_video_info.video_size - COMMAND_QUEUE_AREA_SIZE; */
- /* FIXME */
- /* FIXME XGIfb_caps |= MMIO_CMD_QUEUE_CAP; */
- /* FIXME */
- /* FIXME DPRINTK("XGIfb: MMIO Cmd Queue offset = 0x%lx, size is %dK\n", */
- /* FIXME *cmdq_baseport, COMMAND_QUEUE_AREA_SIZE/1024); */
- break;
-}
-
XGIfb_heap.poha_chain = NULL;
XGIfb_heap.poh_freelist = NULL;

@@ -2643,8 +2440,6 @@ XGIINITSTATIC int __init XGIfb_setup(char *options)
enable_dstn = 1;
/* TW: DSTN overrules forcecrt2type */
XGIfb_crt2type = DISPTYPE_LCD;
- } else if (!strncmp(this_opt, "queuemode:", 10)) {
- XGIfb_search_queuemode(this_opt + 10);
} else if (!strncmp(this_opt, "pdc:", 4)) {
XGIfb_pdc = simple_strtoul(this_opt + 4, NULL, 0);
if (XGIfb_pdc & ~0x3c) {
@@ -2662,10 +2457,6 @@ XGIINITSTATIC int __init XGIfb_setup(char *options)
/* printk(KERN_INFO "XGIfb: Invalid option %s\n", this_opt); */
}

- /* TW: Acceleration only with MMIO mode */
- if ((XGIfb_queuemode != -1) && (XGIfb_queuemode != MMIO_CMD)) {
- XGIfb_ypan = 0;
- }
/* TW: Panning only with acceleration */
XGIfb_ypan = 0;

--
1.5.6.5

2011-03-08 20:17:35

by Aaro Koskinen

[permalink] [raw]
Subject: [PATCH 14/15] staging: xgifb: vb_init: delete unused functions

Delete unused functions.

Signed-off-by: Aaro Koskinen <[email protected]>
---
drivers/staging/xgifb/vb_init.c | 1014 ---------------------------------------
1 files changed, 0 insertions(+), 1014 deletions(-)

diff --git a/drivers/staging/xgifb/vb_init.c b/drivers/staging/xgifb/vb_init.c
index 24dc00c..2cf50dd 100644
--- a/drivers/staging/xgifb/vb_init.c
+++ b/drivers/staging/xgifb/vb_init.c
@@ -17,27 +17,6 @@

static unsigned char XGINew_ChannelAB, XGINew_DataBusWidth;

-static unsigned short XGINew_SDRDRAM_TYPE[13][5] = {
- { 2, 12, 9, 64, 0x35},
- { 1, 13, 9, 64, 0x44},
- { 2, 12, 8, 32, 0x31},
- { 2, 11, 9, 32, 0x25},
- { 1, 12, 9, 32, 0x34},
- { 1, 13, 8, 32, 0x40},
- { 2, 11, 8, 16, 0x21},
- { 1, 12, 8, 16, 0x30},
- { 1, 11, 9, 16, 0x24},
- { 1, 11, 8, 8, 0x20},
- { 2, 9, 8, 4, 0x01},
- { 1, 10, 8, 4, 0x10},
- { 1, 9, 8, 2, 0x00} };
-
-static unsigned short XGINew_DDRDRAM_TYPE[4][5] = {
- { 2, 12, 9, 64, 0x35},
- { 2, 12, 8, 32, 0x31},
- { 2, 11, 8, 16, 0x21},
- { 2, 9, 8, 4, 0x01} };
-
static unsigned short XGINew_DDRDRAM_TYPE340[4][5] = {
{ 2, 13, 9, 64, 0x45},
{ 2, 12, 9, 32, 0x35},
@@ -59,23 +38,14 @@ static unsigned short XGINew_DDRDRAM_TYPE20[12][5] = {
{ 2, 12, 8, 4, 0x31} };

void XGINew_SetDRAMSize_340(struct xgi_hw_device_info *, struct vb_device_info *);
-void XGINew_SetDRAMSize_310(struct xgi_hw_device_info *, struct vb_device_info *);
void XGINew_SetMemoryClock(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *);
-void XGINew_SetDRAMModeRegister(struct vb_device_info *);
void XGINew_SetDRAMDefaultRegister340(struct xgi_hw_device_info *HwDeviceExtension,
unsigned long, struct vb_device_info *);
unsigned char XGINew_GetXG20DRAMType(struct xgi_hw_device_info *HwDeviceExtension,
struct vb_device_info *pVBInfo);

int XGINew_DDRSizing340(struct xgi_hw_device_info *, struct vb_device_info *);
-void XGINew_DisableRefresh(struct xgi_hw_device_info *, struct vb_device_info *) ;
-void XGINew_CheckBusWidth_310(struct vb_device_info *) ;
-int XGINew_SDRSizing(struct vb_device_info *);
-int XGINew_DDRSizing(struct vb_device_info *);
-void XGINew_EnableRefresh(struct xgi_hw_device_info *, struct vb_device_info *);
static int XGINew_RAMType; /*int ModeIDOffset,StandTable,CRT1Table,ScreenOffset,REFIndex;*/
-void SetPowerConsume(struct xgi_hw_device_info *HwDeviceExtension,
- unsigned long XGI_P3d4Port);
void ReadVBIOSTablData(unsigned char ChipType, struct vb_device_info *pVBInfo);
void XGINew_DDR1x_MRS_XG20(unsigned long P3c4, struct vb_device_info *pVBInfo);
void XGINew_ChkSenseStatus(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) ;
@@ -502,40 +472,6 @@ unsigned char XGINew_GetXG20DRAMType(struct xgi_hw_device_info *HwDeviceExtensio
}
}

-static unsigned char XGINew_Get310DRAMType(struct vb_device_info *pVBInfo)
-{
- unsigned char data;
-
- /* index = XGINew_GetReg1(pVBInfo->P3c4, 0x1A); */
- /* index &= 07; */
-
- if (*pVBInfo->pSoftSetting & SoftDRAMType)
- data = *pVBInfo->pSoftSetting & 0x03;
- else
- data = XGINew_GetReg1(pVBInfo->P3c4, 0x3a) & 0x03;
-
- return data;
-}
-
-/*
-void XGINew_Delay15us(unsigned long ulMicrsoSec)
-{
-}
-*/
-
-static void XGINew_SDR_MRS(struct vb_device_info *pVBInfo)
-{
- unsigned short data;
-
- data = XGINew_GetReg1(pVBInfo->P3c4, 0x16);
- data &= 0x3F; /* SR16 D7=0,D6=0 */
- XGINew_SetReg1(pVBInfo->P3c4, 0x16, data); /* enable mode register set(MRS) low */
- /* XGINew_Delay15us(0x100); */
- data |= 0x80; /* SR16 D7=1,D6=0 */
- XGINew_SetReg1(pVBInfo->P3c4, 0x16, data); /* enable mode register set(MRS) high */
- /* XGINew_Delay15us(0x100); */
-}
-
static void XGINew_DDR1x_MRS_340(unsigned long P3c4, struct vb_device_info *pVBInfo)
{
XGINew_SetReg1(P3c4, 0x18, 0x01);
@@ -566,29 +502,6 @@ static void XGINew_DDR1x_MRS_340(unsigned long P3c4, struct vb_device_info *pVBI
XGINew_SetReg1(P3c4, 0x1B, 0x00);
}

-static void XGINew_DDR2x_MRS_340(unsigned long P3c4, struct vb_device_info *pVBInfo)
-{
- XGINew_SetReg1(P3c4, 0x18, 0x00);
- XGINew_SetReg1(P3c4, 0x19, 0x20);
- XGINew_SetReg1(P3c4, 0x16, 0x00);
- XGINew_SetReg1(P3c4, 0x16, 0x80);
- DelayUS(60);
- XGINew_SetReg1(P3c4, 0x18, pVBInfo->SR15[2][XGINew_RAMType]); /* SR18 */
- /* XGINew_SetReg1(P3c4 ,0x18 ,0x31); */
- XGINew_SetReg1(P3c4, 0x19, 0x01);
- XGINew_SetReg1(P3c4, 0x16, 0x05);
- XGINew_SetReg1(P3c4, 0x16, 0x85);
- DelayUS(1000);
- XGINew_SetReg1(P3c4, 0x1B, 0x03);
- DelayUS(500);
- /* XGINew_SetReg1(P3c4, 0x18, 0x31); */
- XGINew_SetReg1(P3c4, 0x18, pVBInfo->SR15[2][XGINew_RAMType]); /* SR18 */
- XGINew_SetReg1(P3c4, 0x19, 0x00);
- XGINew_SetReg1(P3c4, 0x16, 0x05);
- XGINew_SetReg1(P3c4, 0x16, 0x85);
- XGINew_SetReg1(P3c4, 0x1B, 0x00);
-}
-
static void XGINew_DDRII_Bootup_XG27(
struct xgi_hw_device_info *HwDeviceExtension,
unsigned long P3c4, struct vb_device_info *pVBInfo)
@@ -710,79 +623,6 @@ static void XGINew_DDR2_MRS_XG20(struct xgi_hw_device_info *HwDeviceExtension,
DelayUS(200);
}

-#if 0
-static void XGINew_DDR2_MRS_XG27(struct xgi_hw_device_info *HwDeviceExtension,
- unsigned long P3c4, struct vb_device_info *pVBInfo)
-{
- unsigned long P3d4 = P3c4 + 0x10;
-
- XGINew_RAMType = (int) XGINew_GetXG20DRAMType(HwDeviceExtension, pVBInfo);
- XGINew_SetMemoryClock(HwDeviceExtension , pVBInfo);
-
- XGINew_SetReg1(P3d4, 0x97, 0x11); /* CR97 */
- DelayUS(200);
- XGINew_SetReg1(P3c4, 0x18, 0x00); /* EMRS2 */
- XGINew_SetReg1(P3c4, 0x19, 0x80);
-
- XGINew_SetReg1(P3c4, 0x16, 0x10);
- DelayUS(15); /* 06/11/23 XG27 A0 for CKE enable */
- XGINew_SetReg1(P3c4, 0x16, 0x90);
-
- XGINew_SetReg1(P3c4, 0x18, 0x00); /* EMRS3 */
- XGINew_SetReg1(P3c4, 0x19, 0xC0);
-
- XGINew_SetReg1(P3c4, 0x16, 0x00);
- DelayUS(15); /* 06/11/22 XG27 A0 */
- XGINew_SetReg1(P3c4, 0x16, 0x80);
-
- XGINew_SetReg1(P3c4, 0x18, 0x00); /* EMRS1 */
- XGINew_SetReg1(P3c4, 0x19, 0x40);
-
- XGINew_SetReg1(P3c4, 0x16, 0x00);
- DelayUS(15); /* 06/11/22 XG27 A0 */
- XGINew_SetReg1(P3c4, 0x16, 0x80);
-
- XGINew_SetReg1(P3c4, 0x18, 0x42); /* MRS1 */
- XGINew_SetReg1(P3c4, 0x19, 0x06); /* [Billy]06/11/22 DLL Reset for XG27 Hynix DRAM */
-
- XGINew_SetReg1(P3c4, 0x16, 0x00);
- DelayUS(15); /* 06/11/23 XG27 A0 */
- XGINew_SetReg1(P3c4, 0x16, 0x80);
-
- DelayUS(30); /* 06/11/23 XG27 A0 Start Auto-PreCharge */
- XGINew_SetReg1(P3c4, 0x1B, 0x04); /* SR1B */
- DelayUS(60);
- XGINew_SetReg1(P3c4, 0x1B, 0x00); /* SR1B */
-
- XGINew_SetReg1(P3c4, 0x18, 0x42); /* MRS1 */
- XGINew_SetReg1(P3c4, 0x19, 0x04); /* DLL without Reset for XG27 Hynix DRAM */
-
- XGINew_SetReg1(P3c4, 0x16, 0x00);
- DelayUS(30);
- XGINew_SetReg1(P3c4, 0x16, 0x80);
-
- XGINew_SetReg1(P3c4, 0x18, 0x80); /* XG27 OCD ON */
- XGINew_SetReg1(P3c4, 0x19, 0x46);
-
- XGINew_SetReg1(P3c4, 0x16, 0x00);
- DelayUS(30);
- XGINew_SetReg1(P3c4, 0x16, 0x80);
-
- XGINew_SetReg1(P3c4, 0x18, 0x00);
- XGINew_SetReg1(P3c4, 0x19, 0x40);
-
- XGINew_SetReg1(P3c4, 0x16, 0x00);
- DelayUS(30);
- XGINew_SetReg1(P3c4, 0x16, 0x80);
-
- DelayUS(15); /* Start Auto-PreCharge */
- XGINew_SetReg1(P3c4, 0x1B, 0x04); /* SR1B */
- DelayUS(200);
- XGINew_SetReg1(P3c4, 0x1B, 0x03); /* SR1B */
-
-}
-#endif
-
static void XGINew_DDR1x_DefaultRegister(
struct xgi_hw_device_info *HwDeviceExtension,
unsigned long Port, struct vb_device_info *pVBInfo)
@@ -833,51 +673,6 @@ static void XGINew_DDR1x_DefaultRegister(
}
}

-#if 0
-
-static void XGINew_DDR2x_DefaultRegister(
- struct xgi_hw_device_info *HwDeviceExtension,
- unsigned long Port, struct vb_device_info *pVBInfo)
-{
- unsigned long P3d4 = Port ,
- P3c4 = Port - 0x10;
-
- XGINew_SetMemoryClock(HwDeviceExtension, pVBInfo);
-
- /* 20040906 Hsuan modify CR82, CR85, CR86 for XG42 */
- switch (HwDeviceExtension->jChipType) {
- case XG41:
- case XG42:
- XGINew_SetReg1(P3d4, 0x82, pVBInfo->CR40[11][XGINew_RAMType]); /* CR82 */
- XGINew_SetReg1(P3d4, 0x85, pVBInfo->CR40[12][XGINew_RAMType]); /* CR85 */
- XGINew_SetReg1(P3d4, 0x86, pVBInfo->CR40[13][XGINew_RAMType]); /* CR86 */
- break;
- default:
- /* keep following setting sequence, each setting in the same reg insert idle */
- XGINew_SetReg1(P3d4, 0x82, 0x88);
- XGINew_SetReg1(P3d4, 0x86, 0x00);
- XGINew_GetReg1(P3d4, 0x86); /* Insert read command for delay */
- XGINew_SetReg1(P3d4, 0x86, 0x88);
- XGINew_SetReg1(P3d4, 0x82, 0x77);
- XGINew_SetReg1(P3d4, 0x85, 0x00);
- XGINew_GetReg1(P3d4, 0x85); /* Insert read command for delay */
- XGINew_SetReg1(P3d4, 0x85, 0x88);
- XGINew_GetReg1(P3d4, 0x85); /* Insert read command for delay */
- XGINew_SetReg1(P3d4, 0x85, pVBInfo->CR40[12][XGINew_RAMType]); /* CR85 */
- XGINew_SetReg1(P3d4, 0x82, pVBInfo->CR40[11][XGINew_RAMType]); /* CR82 */
- }
- XGINew_SetReg1(P3d4, 0x97, 0x11);
- if (HwDeviceExtension->jChipType == XG42)
- XGINew_SetReg1(P3d4, 0x98, 0x01);
- else
- XGINew_SetReg1(P3d4, 0x98, 0x03);
-
- XGINew_SetReg1(P3d4, 0x9A, 0x02);
-
- XGINew_DDR2x_MRS_340(P3c4, pVBInfo);
-}
-#endif
-
static void XGINew_DDR2_DefaultRegister(
struct xgi_hw_device_info *HwDeviceExtension,
unsigned long Port, struct vb_device_info *pVBInfo)
@@ -1039,95 +834,6 @@ void XGINew_SetDRAMDefaultRegister340(
XGINew_SetReg1(P3c4, 0x1B, pVBInfo->SR15[3][XGINew_RAMType]); /* SR1B */
}

-static void XGINew_DDR_MRS(struct vb_device_info *pVBInfo)
-{
- unsigned short data;
-
- volatile unsigned char *pVideoMemory = (unsigned char *) pVBInfo->ROMAddr;
-
- /* SR16 <- 1F,DF,2F,AF */
- /* yriver modified SR16 <- 0F,DF,0F,AF */
- /* enable DLL of DDR SD/SGRAM , SR16 D4=1 */
- data = pVideoMemory[0xFB];
- /* data = XGINew_GetReg1(pVBInfo->P3c4, 0x16); */
-
- data &= 0x0F;
- XGINew_SetReg1(pVBInfo->P3c4, 0x16, data);
- data |= 0xC0;
- XGINew_SetReg1(pVBInfo->P3c4, 0x16, data);
- data &= 0x0F;
- XGINew_SetReg1(pVBInfo->P3c4, 0x16, data);
- data |= 0x80;
- XGINew_SetReg1(pVBInfo->P3c4, 0x16, data);
- data &= 0x0F;
- XGINew_SetReg1(pVBInfo->P3c4, 0x16, data);
- data |= 0xD0;
- XGINew_SetReg1(pVBInfo->P3c4, 0x16, data);
- data &= 0x0F;
- XGINew_SetReg1(pVBInfo->P3c4, 0x16, data);
- data |= 0xA0;
- XGINew_SetReg1(pVBInfo->P3c4, 0x16, data);
- /*
- else {
- data &= 0x0F;
- data |= 0x10;
- XGINew_SetReg1(pVBInfo->P3c4,0x16,data);
-
- if (!(pVBInfo->SR15[1][XGINew_RAMType] & 0x10)) {
- data &= 0x0F;
- }
-
- data |= 0xC0;
- XGINew_SetReg1(pVBInfo->P3c4,0x16,data);
-
- data &= 0x0F;
- data |= 0x20;
- XGINew_SetReg1(pVBInfo->P3c4,0x16,data);
- if (!(pVBInfo->SR15[1][XGINew_RAMType] & 0x10)) {
- data &= 0x0F;
- }
-
- data |= 0x80;
- XGINew_SetReg1(pVBInfo->P3c4,0x16,data);
- }
- */
-}
-
-/* check if read cache pointer is correct */
-
-static void XGINew_VerifyMclk(struct xgi_hw_device_info *HwDeviceExtension,
- struct vb_device_info *pVBInfo)
-{
- unsigned char *pVideoMemory = pVBInfo->FBAddr;
- unsigned char i, j;
- unsigned short Temp, SR21;
-
- pVideoMemory[0] = 0xaa; /* alan */
- pVideoMemory[16] = 0x55; /* note: PCI read cache is off */
-
- if ((pVideoMemory[0] != 0xaa) || (pVideoMemory[16] != 0x55)) {
- for (i = 0, j = 16; i < 2; i++, j += 16) {
- SR21 = XGINew_GetReg1(pVBInfo->P3c4, 0x21);
- Temp = SR21 & 0xFB; /* disable PCI post write buffer empty gating */
- XGINew_SetReg1(pVBInfo->P3c4, 0x21, Temp);
-
- Temp = XGINew_GetReg1(pVBInfo->P3c4, 0x3C);
- Temp |= 0x01; /* MCLK reset */
-
- Temp = XGINew_GetReg1(pVBInfo->P3c4, 0x3C);
- Temp &= 0xFE; /* MCLK normal operation */
-
- XGINew_SetReg1(pVBInfo->P3c4, 0x21, SR21);
-
- pVideoMemory[16 + j] = j;
- if (pVideoMemory[16 + j] == j) {
- pVideoMemory[j] = j;
- break;
- }
- }
- }
-}
-
void XGINew_SetDRAMSize_340(struct xgi_hw_device_info *HwDeviceExtension,
struct vb_device_info *pVBInfo)
{
@@ -1150,155 +856,6 @@ void XGINew_SetDRAMSize_340(struct xgi_hw_device_info *HwDeviceExtension,
XGINew_SetReg1(pVBInfo->P3c4, 0x21, (unsigned short) (data | 0x20)); /* enable read cache */
}

-void XGINew_SetDRAMSize_310(struct xgi_hw_device_info *HwDeviceExtension,
- struct vb_device_info *pVBInfo)
-{
- unsigned short data;
- pVBInfo->ROMAddr = HwDeviceExtension->pjVirtualRomBase, pVBInfo->FBAddr
- = HwDeviceExtension->pjVideoMemoryAddress;
-#ifdef XGI301
- /* XGINew_SetReg1(pVBInfo->P3d4, 0x30, 0x40); */
-#endif
-
-#ifdef XGI302 /* alan,should change value */
- XGINew_SetReg1(pVBInfo->P3d4, 0x30, 0x4D);
- XGINew_SetReg1(pVBInfo->P3d4, 0x31, 0xc0);
- XGINew_SetReg1(pVBInfo->P3d4, 0x34, 0x3F);
-#endif
-
- XGISetModeNew(HwDeviceExtension, 0x2e);
-
- data = XGINew_GetReg1(pVBInfo->P3c4, 0x21);
- XGINew_SetReg1(pVBInfo->P3c4, 0x21, (unsigned short) (data & 0xDF)); /* disable read cache */
-
- data = XGINew_GetReg1(pVBInfo->P3c4, 0x1);
- data |= 0x20;
- XGINew_SetReg1(pVBInfo->P3c4, 0x01, data); /* Turn OFF Display */
-
- data = XGINew_GetReg1(pVBInfo->P3c4, 0x16);
-
- XGINew_SetReg1(pVBInfo->P3c4, 0x16, (unsigned short) (data | 0x0F)); /* assume lowest speed DRAM */
-
- XGINew_SetDRAMModeRegister(pVBInfo);
- XGINew_DisableRefresh(HwDeviceExtension, pVBInfo);
- XGINew_CheckBusWidth_310(pVBInfo);
- XGINew_VerifyMclk(HwDeviceExtension, pVBInfo); /* alan 2000/7/3 */
-
- if (XGINew_Get310DRAMType(pVBInfo) < 2)
- XGINew_SDRSizing(pVBInfo);
- else
- XGINew_DDRSizing(pVBInfo);
-
- XGINew_SetReg1(pVBInfo->P3c4, 0x16, pVBInfo->SR15[1][XGINew_RAMType]); /* restore SR16 */
-
- XGINew_EnableRefresh(HwDeviceExtension, pVBInfo);
- data = XGINew_GetReg1(pVBInfo->P3c4, 0x21);
- XGINew_SetReg1(pVBInfo->P3c4, 0x21, (unsigned short) (data | 0x20)); /* enable read cache */
-}
-
-void XGINew_SetDRAMModeRegister340(struct xgi_hw_device_info *HwDeviceExtension)
-{
- unsigned char data;
- struct vb_device_info VBINF;
- struct vb_device_info *pVBInfo = &VBINF;
- pVBInfo->ROMAddr = HwDeviceExtension->pjVirtualRomBase;
- pVBInfo->FBAddr = HwDeviceExtension->pjVideoMemoryAddress;
- pVBInfo->BaseAddr = (unsigned long) HwDeviceExtension->pjIOAddress;
- pVBInfo->ISXPDOS = 0;
-
- pVBInfo->P3c4 = pVBInfo->BaseAddr + 0x14;
- pVBInfo->P3d4 = pVBInfo->BaseAddr + 0x24;
- pVBInfo->P3c0 = pVBInfo->BaseAddr + 0x10;
- pVBInfo->P3ce = pVBInfo->BaseAddr + 0x1e;
- pVBInfo->P3c2 = pVBInfo->BaseAddr + 0x12;
- pVBInfo->P3ca = pVBInfo->BaseAddr + 0x1a;
- pVBInfo->P3c6 = pVBInfo->BaseAddr + 0x16;
- pVBInfo->P3c7 = pVBInfo->BaseAddr + 0x17;
- pVBInfo->P3c8 = pVBInfo->BaseAddr + 0x18;
- pVBInfo->P3c9 = pVBInfo->BaseAddr + 0x19;
- pVBInfo->P3da = pVBInfo->BaseAddr + 0x2A;
- pVBInfo->Part0Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_00;
- pVBInfo->Part1Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_04;
- pVBInfo->Part2Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_10;
- pVBInfo->Part3Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_12;
- pVBInfo->Part4Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_14;
- pVBInfo->Part5Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_14 + 2;
- if (HwDeviceExtension->jChipType < XG20) /* kuku 2004/06/25 */
- XGI_GetVBType(pVBInfo); /* Run XGI_GetVBType before InitTo330Pointer */
-
- InitTo330Pointer(HwDeviceExtension->jChipType, pVBInfo);
-
- ReadVBIOSTablData(HwDeviceExtension->jChipType, pVBInfo);
-
- if (XGINew_GetXG20DRAMType(HwDeviceExtension, pVBInfo) == 0) {
- data = (XGINew_GetReg1(pVBInfo->P3c4, 0x39) & 0x02) >> 1;
- if (data == 0x01)
- XGINew_DDR2x_MRS_340(pVBInfo->P3c4, pVBInfo);
- else
- XGINew_DDR1x_MRS_340(pVBInfo->P3c4, pVBInfo);
- } else {
- XGINew_DDR2_MRS_XG20(HwDeviceExtension, pVBInfo->P3c4, pVBInfo);
- }
- XGINew_SetReg1(pVBInfo->P3c4, 0x1B, 0x03);
-}
-
-void XGINew_SetDRAMModeRegister(struct vb_device_info *pVBInfo)
-{
- if (XGINew_Get310DRAMType(pVBInfo) < 2) {
- XGINew_SDR_MRS(pVBInfo);
- } else {
- /* SR16 <- 0F,CF,0F,8F */
- XGINew_DDR_MRS(pVBInfo);
- }
-}
-
-void XGINew_DisableRefresh(struct xgi_hw_device_info *HwDeviceExtension,
- struct vb_device_info *pVBInfo)
-{
- unsigned short data;
-
- data = XGINew_GetReg1(pVBInfo->P3c4, 0x1B);
- data &= 0xF8;
- XGINew_SetReg1(pVBInfo->P3c4, 0x1B, data);
-
-}
-
-void XGINew_EnableRefresh(struct xgi_hw_device_info *HwDeviceExtension,
- struct vb_device_info *pVBInfo)
-{
-
- XGINew_SetReg1(pVBInfo->P3c4, 0x1B, pVBInfo->SR15[3][XGINew_RAMType]); /* SR1B */
-
-}
-
-static void XGINew_DisableChannelInterleaving(int index,
- unsigned short XGINew_DDRDRAM_TYPE[][5],
- struct vb_device_info *pVBInfo)
-{
- unsigned short data;
-
- data = XGINew_GetReg1(pVBInfo->P3c4, 0x15);
- data &= 0x1F;
-
- switch (XGINew_DDRDRAM_TYPE[index][3]) {
- case 64:
- data |= 0;
- break;
- case 32:
- data |= 0x20;
- break;
- case 16:
- data |= 0x40;
- break;
- case 4:
- data |= 0x60;
- break;
- default:
- break;
- }
- XGINew_SetReg1(pVBInfo->P3c4, 0x15, data);
-}
-
static void XGINew_SetDRAMSizingType(int index,
unsigned short DRAMTYPE_TABLE[][5],
struct vb_device_info *pVBInfo)
@@ -1311,349 +868,6 @@ static void XGINew_SetDRAMSizingType(int index,
/* should delay 50 ns */
}

-void XGINew_CheckBusWidth_310(struct vb_device_info *pVBInfo)
-{
- unsigned short data;
- volatile unsigned long *pVideoMemory;
-
- pVideoMemory = (unsigned long *) pVBInfo->FBAddr;
-
- if (XGINew_Get310DRAMType(pVBInfo) < 2) {
- XGINew_SetReg1(pVBInfo->P3c4, 0x13, 0x00);
- XGINew_SetReg1(pVBInfo->P3c4, 0x14, 0x12);
- /* should delay */
- XGINew_SDR_MRS(pVBInfo);
-
- XGINew_ChannelAB = 0;
- XGINew_DataBusWidth = 128;
- pVideoMemory[0] = 0x01234567L;
- pVideoMemory[1] = 0x456789ABL;
- pVideoMemory[2] = 0x89ABCDEFL;
- pVideoMemory[3] = 0xCDEF0123L;
- pVideoMemory[4] = 0x55555555L;
- pVideoMemory[5] = 0x55555555L;
- pVideoMemory[6] = 0xFFFFFFFFL;
- pVideoMemory[7] = 0xFFFFFFFFL;
-
- if ((pVideoMemory[3] != 0xCDEF0123L) || (pVideoMemory[2]
- != 0x89ABCDEFL)) {
- /* ChannelA64Bit */
- XGINew_DataBusWidth = 64;
- XGINew_ChannelAB = 0;
- data = XGINew_GetReg1(pVBInfo->P3c4, 0x14);
- XGINew_SetReg1(pVBInfo->P3c4, 0x14,
- (unsigned short) (data & 0xFD));
- }
-
- if ((pVideoMemory[1] != 0x456789ABL) || (pVideoMemory[0]
- != 0x01234567L)) {
- /* ChannelB64Bit */
- XGINew_DataBusWidth = 64;
- XGINew_ChannelAB = 1;
- data = XGINew_GetReg1(pVBInfo->P3c4, 0x14);
- XGINew_SetReg1(pVBInfo->P3c4, 0x14,
- (unsigned short) ((data & 0xFD) | 0x01));
- }
-
- return;
- } else {
- /* DDR Dual channel */
- XGINew_SetReg1(pVBInfo->P3c4, 0x13, 0x00);
- XGINew_SetReg1(pVBInfo->P3c4, 0x14, 0x02); /* Channel A, 64bit */
- /* should delay */
- XGINew_DDR_MRS(pVBInfo);
-
- XGINew_ChannelAB = 0;
- XGINew_DataBusWidth = 64;
- pVideoMemory[0] = 0x01234567L;
- pVideoMemory[1] = 0x456789ABL;
- pVideoMemory[2] = 0x89ABCDEFL;
- pVideoMemory[3] = 0xCDEF0123L;
- pVideoMemory[4] = 0x55555555L;
- pVideoMemory[5] = 0x55555555L;
- pVideoMemory[6] = 0xAAAAAAAAL;
- pVideoMemory[7] = 0xAAAAAAAAL;
-
- if (pVideoMemory[1] == 0x456789ABL) {
- if (pVideoMemory[0] == 0x01234567L) {
- /* Channel A 64bit */
- return;
- }
- } else {
- if (pVideoMemory[0] == 0x01234567L) {
- /* Channel A 32bit */
- XGINew_DataBusWidth = 32;
- XGINew_SetReg1(pVBInfo->P3c4, 0x14, 0x00);
- return;
- }
- }
-
- XGINew_SetReg1(pVBInfo->P3c4, 0x14, 0x03); /* Channel B, 64bit */
- XGINew_DDR_MRS(pVBInfo);
-
- XGINew_ChannelAB = 1;
- XGINew_DataBusWidth = 64;
- pVideoMemory[0] = 0x01234567L;
- pVideoMemory[1] = 0x456789ABL;
- pVideoMemory[2] = 0x89ABCDEFL;
- pVideoMemory[3] = 0xCDEF0123L;
- pVideoMemory[4] = 0x55555555L;
- pVideoMemory[5] = 0x55555555L;
- pVideoMemory[6] = 0xAAAAAAAAL;
- pVideoMemory[7] = 0xAAAAAAAAL;
-
- if (pVideoMemory[1] == 0x456789ABL) {
- /* Channel B 64 */
- if (pVideoMemory[0] == 0x01234567L) {
- /* Channel B 64bit */
- return;
- } else {
- /* error */
- }
- } else {
- if (pVideoMemory[0] == 0x01234567L) {
- /* Channel B 32 */
- XGINew_DataBusWidth = 32;
- XGINew_SetReg1(pVBInfo->P3c4, 0x14, 0x01);
- } else {
- /* error */
- }
- }
- }
-}
-
-static int XGINew_SetRank(int index, unsigned char RankNo,
- unsigned char XGINew_ChannelAB,
- unsigned short DRAMTYPE_TABLE[][5],
- struct vb_device_info *pVBInfo)
-{
- unsigned short data;
- int RankSize;
-
- if ((RankNo == 2) && (DRAMTYPE_TABLE[index][0] == 2))
- return 0;
-
- RankSize = DRAMTYPE_TABLE[index][3] / 2 * XGINew_DataBusWidth / 32;
-
- if ((RankNo * RankSize) <= 128) {
- data = 0;
-
- while ((RankSize >>= 1) > 0)
- data += 0x10;
-
- data |= (RankNo - 1) << 2;
- data |= (XGINew_DataBusWidth / 64) & 2;
- data |= XGINew_ChannelAB;
- XGINew_SetReg1(pVBInfo->P3c4, 0x14, data);
- /* should delay */
- XGINew_SDR_MRS(pVBInfo);
- return 1;
- } else {
- return 0;
- }
-}
-
-static int XGINew_SetDDRChannel(int index, unsigned char ChannelNo,
- unsigned char XGINew_ChannelAB,
- unsigned short DRAMTYPE_TABLE[][5],
- struct vb_device_info *pVBInfo)
-{
- unsigned short data;
- int RankSize;
-
- RankSize = DRAMTYPE_TABLE[index][3] / 2 * XGINew_DataBusWidth / 32;
- /* RankSize = DRAMTYPE_TABLE[index][3]; */
- if (ChannelNo * RankSize <= 128) {
- data = 0;
- while ((RankSize >>= 1) > 0)
- data += 0x10;
-
- if (ChannelNo == 2)
- data |= 0x0C;
-
- data |= (XGINew_DataBusWidth / 32) & 2;
- data |= XGINew_ChannelAB;
- XGINew_SetReg1(pVBInfo->P3c4, 0x14, data);
- /* should delay */
- XGINew_DDR_MRS(pVBInfo);
- return 1;
- } else {
- return 0;
- }
-}
-
-static int XGINew_CheckColumn(int index, unsigned short DRAMTYPE_TABLE[][5],
- struct vb_device_info *pVBInfo)
-{
- int i;
- unsigned long Increment, Position;
-
- /* Increment = 1 << (DRAMTYPE_TABLE[index][2] + XGINew_DataBusWidth / 64 + 1); */
- Increment = 1 << (10 + XGINew_DataBusWidth / 64);
-
- for (i = 0, Position = 0; i < 2; i++) {
- *((unsigned long *) (pVBInfo->FBAddr + Position)) = Position;
- Position += Increment;
- }
-
- for (i = 0, Position = 0; i < 2; i++) {
- /* if ( pVBInfo->FBAddr[ Position ] != Position ) */
- if ((*(unsigned long *) (pVBInfo->FBAddr + Position)) != Position)
- return 0;
- Position += Increment;
- }
- return 1;
-}
-
-static int XGINew_CheckBanks(int index, unsigned short DRAMTYPE_TABLE[][5],
- struct vb_device_info *pVBInfo)
-{
- int i;
- unsigned long Increment, Position;
-
- Increment = 1 << (DRAMTYPE_TABLE[index][2] + XGINew_DataBusWidth / 64 + 2);
-
- for (i = 0, Position = 0; i < 4; i++) {
- /* pVBInfo->FBAddr[Position] = Position; */
- *((unsigned long *) (pVBInfo->FBAddr + Position)) = Position;
- Position += Increment;
- }
-
- for (i = 0, Position = 0; i < 4; i++) {
- /* if (pVBInfo->FBAddr[Position] != Position) */
- if ((*(unsigned long *) (pVBInfo->FBAddr + Position)) != Position)
- return 0;
- Position += Increment;
- }
- return 1;
-}
-
-static int XGINew_CheckRank(int RankNo, int index,
- unsigned short DRAMTYPE_TABLE[][5],
- struct vb_device_info *pVBInfo)
-{
- int i;
- unsigned long Increment, Position;
-
- Increment = 1 << (DRAMTYPE_TABLE[index][2] + DRAMTYPE_TABLE[index][1]
- + DRAMTYPE_TABLE[index][0] + XGINew_DataBusWidth / 64
- + RankNo);
-
- for (i = 0, Position = 0; i < 2; i++) {
- /* pVBInfo->FBAddr[Position] = Position; */
- /* *((unsigned long *)(pVBInfo->FBAddr)) = Position; */
- *((unsigned long *) (pVBInfo->FBAddr + Position)) = Position;
- Position += Increment;
- }
-
- for (i = 0, Position = 0; i < 2; i++) {
- /* if (pVBInfo->FBAddr[Position] != Position) */
- /* if ((*(unsigned long *)(pVBInfo->FBAddr)) != Position) */
- if ((*(unsigned long *) (pVBInfo->FBAddr + Position)) != Position)
- return 0;
- Position += Increment;
- }
- return 1;
-}
-
-static int XGINew_CheckDDRRank(int RankNo, int index,
- unsigned short DRAMTYPE_TABLE[][5],
- struct vb_device_info *pVBInfo)
-{
- unsigned long Increment, Position;
- unsigned short data;
-
- Increment = 1 << (DRAMTYPE_TABLE[index][2] + DRAMTYPE_TABLE[index][1]
- + DRAMTYPE_TABLE[index][0] + XGINew_DataBusWidth / 64
- + RankNo);
-
- Increment += Increment / 2;
-
- Position = 0;
- *((unsigned long *) (pVBInfo->FBAddr + Position + 0)) = 0x01234567;
- *((unsigned long *) (pVBInfo->FBAddr + Position + 1)) = 0x456789AB;
- *((unsigned long *) (pVBInfo->FBAddr + Position + 2)) = 0x55555555;
- *((unsigned long *) (pVBInfo->FBAddr + Position + 3)) = 0x55555555;
- *((unsigned long *) (pVBInfo->FBAddr + Position + 4)) = 0xAAAAAAAA;
- *((unsigned long *) (pVBInfo->FBAddr + Position + 5)) = 0xAAAAAAAA;
-
- if ((*(unsigned long *) (pVBInfo->FBAddr + 1)) == 0x456789AB)
- return 1;
-
- if ((*(unsigned long *) (pVBInfo->FBAddr + 0)) == 0x01234567)
- return 0;
-
- data = XGINew_GetReg1(pVBInfo->P3c4, 0x14);
- data &= 0xF3;
- data |= 0x0E;
- XGINew_SetReg1(pVBInfo->P3c4, 0x14, data);
- data = XGINew_GetReg1(pVBInfo->P3c4, 0x15);
- data += 0x20;
- XGINew_SetReg1(pVBInfo->P3c4, 0x15, data);
-
- return 1;
-}
-
-static int XGINew_CheckRanks(int RankNo, int index,
- unsigned short DRAMTYPE_TABLE[][5],
- struct vb_device_info *pVBInfo)
-{
- int r;
-
- for (r = RankNo; r >= 1; r--) {
- if (!XGINew_CheckRank(r, index, DRAMTYPE_TABLE, pVBInfo))
- return 0;
- }
-
- if (!XGINew_CheckBanks(index, DRAMTYPE_TABLE, pVBInfo))
- return 0;
-
- if (!XGINew_CheckColumn(index, DRAMTYPE_TABLE, pVBInfo))
- return 0;
-
- return 1;
-}
-
-static int XGINew_CheckDDRRanks(int RankNo, int index,
- unsigned short DRAMTYPE_TABLE[][5],
- struct vb_device_info *pVBInfo)
-{
- int r;
-
- for (r = RankNo; r >= 1; r--) {
- if (!XGINew_CheckDDRRank(r, index, DRAMTYPE_TABLE, pVBInfo))
- return 0;
- }
-
- if (!XGINew_CheckBanks(index, DRAMTYPE_TABLE, pVBInfo))
- return 0;
-
- if (!XGINew_CheckColumn(index, DRAMTYPE_TABLE, pVBInfo))
- return 0;
-
- return 1;
-}
-
-int XGINew_SDRSizing(struct vb_device_info *pVBInfo)
-{
- int i;
- unsigned char j;
-
- for (i = 0; i < 13; i++) {
- XGINew_SetDRAMSizingType(i, XGINew_SDRDRAM_TYPE, pVBInfo);
-
- for (j = 2; j > 0; j--) {
- if (!XGINew_SetRank(i, (unsigned char) j, XGINew_ChannelAB, XGINew_SDRDRAM_TYPE, pVBInfo)) {
- continue;
- } else {
- if (XGINew_CheckRanks(j, i, XGINew_SDRDRAM_TYPE, pVBInfo))
- return 1;
- }
- }
- }
- return 0;
-}
-
static unsigned short XGINew_SetDRAMSizeReg(int index,
unsigned short DRAMTYPE_TABLE[][5],
struct vb_device_info *pVBInfo)
@@ -2075,27 +1289,6 @@ int XGINew_DDRSizing340(struct xgi_hw_device_info *HwDeviceExtension,
return 0;
}

-int XGINew_DDRSizing(struct vb_device_info *pVBInfo)
-{
- int i;
- unsigned char j;
-
- for (i = 0; i < 4; i++) {
- XGINew_SetDRAMSizingType(i, XGINew_DDRDRAM_TYPE, pVBInfo);
- XGINew_DisableChannelInterleaving(i, XGINew_DDRDRAM_TYPE, pVBInfo);
- for (j = 2; j > 0; j--) {
- XGINew_SetDDRChannel(i, j, XGINew_ChannelAB, XGINew_DDRDRAM_TYPE, pVBInfo);
- if (!XGINew_SetRank(i, (unsigned char) j, XGINew_ChannelAB, XGINew_DDRDRAM_TYPE, pVBInfo)) {
- continue;
- } else {
- if (XGINew_CheckDDRRanks(j, i, XGINew_DDRDRAM_TYPE, pVBInfo))
- return 1;
- }
- }
- }
- return 0;
-}
-
void XGINew_SetMemoryClock(struct xgi_hw_device_info *HwDeviceExtension,
struct vb_device_info *pVBInfo)
{
@@ -2121,89 +1314,6 @@ void XGINew_SetMemoryClock(struct xgi_hw_device_info *HwDeviceExtension,
}
}

-unsigned char ChkLFB(struct vb_device_info *pVBInfo)
-{
- if (LFBDRAMTrap & XGINew_GetReg1(pVBInfo->P3d4, 0x78))
- return 1;
- else
- return 0;
-}
-
-/* --------------------------------------------------------------------- */
-/* input : dx ,valid value : CR or second chip's CR */
-/* */
-/* SetPowerConsume : */
-/* Description: reduce 40/43 power consumption in first chip or */
-/* in second chip, assume CR A1 D[6]="1" in this case */
-/* output : none */
-/* --------------------------------------------------------------------- */
-void SetPowerConsume(struct xgi_hw_device_info *HwDeviceExtension,
- unsigned long XGI_P3d4Port)
-{
- unsigned long lTemp;
- unsigned char bTemp;
-
- HwDeviceExtension->pQueryVGAConfigSpace(HwDeviceExtension, 0x08, 0, &lTemp); /* Get */
- if ((lTemp & 0xFF) == 0) {
- /* set CR58 D[5]=0 D[3]=0 */
- XGINew_SetRegAND(XGI_P3d4Port, 0x58, 0xD7);
- bTemp = (unsigned char) XGINew_GetReg1(XGI_P3d4Port, 0xCB);
- if (bTemp & 0x20) {
- if (!(bTemp & 0x10))
- XGINew_SetRegANDOR(XGI_P3d4Port, 0x58, 0xD7, 0x20); /* CR58 D[5]=1 D[3]=0 */
- else
- XGINew_SetRegANDOR(XGI_P3d4Port, 0x58, 0xD7, 0x08); /* CR58 D[5]=0 D[3]=1 */
-
- }
-
- }
-}
-
-#if 0
-static void XGINew_InitVBIOSData(struct xgi_hw_device_info *HwDeviceExtension,
- struct vb_device_info *pVBInfo)
-{
-
- /* unsigned long ROMAddr = (unsigned long) HwDeviceExtension->pjVirtualRomBase; */
- pVBInfo->ROMAddr = HwDeviceExtension->pjVirtualRomBase;
- pVBInfo->FBAddr = HwDeviceExtension->pjVideoMemoryAddress;
- pVBInfo->BaseAddr = (unsigned long) HwDeviceExtension->pjIOAddress;
- pVBInfo->ISXPDOS = 0;
-
- pVBInfo->P3c4 = pVBInfo->BaseAddr + 0x14;
- pVBInfo->P3d4 = pVBInfo->BaseAddr + 0x24;
- pVBInfo->P3c0 = pVBInfo->BaseAddr + 0x10;
- pVBInfo->P3ce = pVBInfo->BaseAddr + 0x1e;
- pVBInfo->P3c2 = pVBInfo->BaseAddr + 0x12;
- pVBInfo->P3ca = pVBInfo->BaseAddr + 0x1a;
- pVBInfo->P3c6 = pVBInfo->BaseAddr + 0x16;
- pVBInfo->P3c7 = pVBInfo->BaseAddr + 0x17;
- pVBInfo->P3c8 = pVBInfo->BaseAddr + 0x18;
- pVBInfo->P3c9 = pVBInfo->BaseAddr + 0x19;
- pVBInfo->P3da = pVBInfo->BaseAddr + 0x2A;
- pVBInfo->Part0Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_00;
- pVBInfo->Part1Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_04;
- pVBInfo->Part2Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_10;
- pVBInfo->Part3Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_12;
- pVBInfo->Part4Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_14;
- pVBInfo->Part5Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_14 + 2;
- if (HwDeviceExtension->jChipType < XG20) /* kuku 2004/06/25 */
- XGI_GetVBType(pVBInfo); /* Run XGI_GetVBType before InitTo330Pointer */
-
- switch (HwDeviceExtension->jChipType) {
- case XG40:
- case XG41:
- case XG42:
- case XG20:
- case XG21:
- default:
- InitTo330Pointer(HwDeviceExtension->jChipType, pVBInfo);
- return;
- }
-
-}
-#endif
-
void ReadVBIOSTablData(unsigned char ChipType, struct vb_device_info *pVBInfo)
{
volatile unsigned char *pVideoMemory = (unsigned char *) pVBInfo->ROMAddr;
@@ -2324,130 +1434,6 @@ void XGINew_DDR1x_MRS_XG20(unsigned long P3c4, struct vb_device_info *pVBInfo)
XGINew_SetReg1(P3c4, 0x1B, 0x00);
}

-void XGINew_SetDRAMModeRegister_XG20(struct xgi_hw_device_info *HwDeviceExtension)
-{
- struct vb_device_info VBINF;
- struct vb_device_info *pVBInfo = &VBINF;
- pVBInfo->ROMAddr = HwDeviceExtension->pjVirtualRomBase;
- pVBInfo->FBAddr = HwDeviceExtension->pjVideoMemoryAddress;
- pVBInfo->BaseAddr = (unsigned long) HwDeviceExtension->pjIOAddress;
- pVBInfo->ISXPDOS = 0;
-
- pVBInfo->P3c4 = pVBInfo->BaseAddr + 0x14;
- pVBInfo->P3d4 = pVBInfo->BaseAddr + 0x24;
- pVBInfo->P3c0 = pVBInfo->BaseAddr + 0x10;
- pVBInfo->P3ce = pVBInfo->BaseAddr + 0x1e;
- pVBInfo->P3c2 = pVBInfo->BaseAddr + 0x12;
- pVBInfo->P3ca = pVBInfo->BaseAddr + 0x1a;
- pVBInfo->P3c6 = pVBInfo->BaseAddr + 0x16;
- pVBInfo->P3c7 = pVBInfo->BaseAddr + 0x17;
- pVBInfo->P3c8 = pVBInfo->BaseAddr + 0x18;
- pVBInfo->P3c9 = pVBInfo->BaseAddr + 0x19;
- pVBInfo->P3da = pVBInfo->BaseAddr + 0x2A;
- pVBInfo->Part0Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_00;
- pVBInfo->Part1Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_04;
- pVBInfo->Part2Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_10;
- pVBInfo->Part3Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_12;
- pVBInfo->Part4Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_14;
- pVBInfo->Part5Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_14 + 2;
-
- InitTo330Pointer(HwDeviceExtension->jChipType, pVBInfo);
-
- ReadVBIOSTablData(HwDeviceExtension->jChipType, pVBInfo);
-
- if (XGINew_GetXG20DRAMType(HwDeviceExtension, pVBInfo) == 0)
- XGINew_DDR1x_MRS_XG20(pVBInfo->P3c4, pVBInfo);
- else
- XGINew_DDR2_MRS_XG20(HwDeviceExtension, pVBInfo->P3c4, pVBInfo);
-
- XGINew_SetReg1(pVBInfo->P3c4, 0x1B, 0x03);
-}
-
-void XGINew_SetDRAMModeRegister_XG27(
- struct xgi_hw_device_info *HwDeviceExtension)
-{
- struct vb_device_info VBINF;
- struct vb_device_info *pVBInfo = &VBINF;
- pVBInfo->ROMAddr = HwDeviceExtension->pjVirtualRomBase;
- pVBInfo->FBAddr = HwDeviceExtension->pjVideoMemoryAddress;
- pVBInfo->BaseAddr = (unsigned long) HwDeviceExtension->pjIOAddress;
- pVBInfo->ISXPDOS = 0;
-
- pVBInfo->P3c4 = pVBInfo->BaseAddr + 0x14;
- pVBInfo->P3d4 = pVBInfo->BaseAddr + 0x24;
- pVBInfo->P3c0 = pVBInfo->BaseAddr + 0x10;
- pVBInfo->P3ce = pVBInfo->BaseAddr + 0x1e;
- pVBInfo->P3c2 = pVBInfo->BaseAddr + 0x12;
- pVBInfo->P3ca = pVBInfo->BaseAddr + 0x1a;
- pVBInfo->P3c6 = pVBInfo->BaseAddr + 0x16;
- pVBInfo->P3c7 = pVBInfo->BaseAddr + 0x17;
- pVBInfo->P3c8 = pVBInfo->BaseAddr + 0x18;
- pVBInfo->P3c9 = pVBInfo->BaseAddr + 0x19;
- pVBInfo->P3da = pVBInfo->BaseAddr + 0x2A;
- pVBInfo->Part0Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_00;
- pVBInfo->Part1Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_04;
- pVBInfo->Part2Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_10;
- pVBInfo->Part3Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_12;
- pVBInfo->Part4Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_14;
- pVBInfo->Part5Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_14 + 2;
-
- InitTo330Pointer(HwDeviceExtension->jChipType, pVBInfo);
-
- ReadVBIOSTablData(HwDeviceExtension->jChipType, pVBInfo);
-
- if (XGINew_GetXG20DRAMType(HwDeviceExtension, pVBInfo) == 0)
- XGINew_DDR1x_MRS_XG20(pVBInfo->P3c4, pVBInfo);
- else
- /* XGINew_DDR2_MRS_XG27(HwDeviceExtension, pVBInfo->P3c4, pVBInfo); */
- XGINew_DDRII_Bootup_XG27(HwDeviceExtension, pVBInfo->P3c4, pVBInfo);
-
- /* XGINew_SetReg1(pVBInfo->P3c4, 0x1B, 0x03); */
- XGINew_SetReg1(pVBInfo->P3c4, 0x1B, pVBInfo->SR15[3][XGINew_RAMType]); /* SR1B */
-
-}
-
-/*
-void XGINew_SetDRAMModeRegister_XG27(struct xgi_hw_device_info *HwDeviceExtension)
-{
- unsigned char data;
- struct vb_device_info VBINF;
- struct vb_device_info *pVBInfo = &VBINF;
- pVBInfo->ROMAddr = HwDeviceExtension->pjVirtualRomBase;
- pVBInfo->FBAddr = HwDeviceExtension->pjVideoMemoryAddress;
- pVBInfo->BaseAddr = HwDeviceExtension->pjIOAddress;
- pVBInfo->ISXPDOS = 0;
-
- pVBInfo->P3c4 = pVBInfo->BaseAddr + 0x14;
- pVBInfo->P3d4 = pVBInfo->BaseAddr + 0x24;
- pVBInfo->P3c0 = pVBInfo->BaseAddr + 0x10;
- pVBInfo->P3ce = pVBInfo->BaseAddr + 0x1e;
- pVBInfo->P3c2 = pVBInfo->BaseAddr + 0x12;
- pVBInfo->P3ca = pVBInfo->BaseAddr + 0x1a;
- pVBInfo->P3c6 = pVBInfo->BaseAddr + 0x16;
- pVBInfo->P3c7 = pVBInfo->BaseAddr + 0x17;
- pVBInfo->P3c8 = pVBInfo->BaseAddr + 0x18;
- pVBInfo->P3c9 = pVBInfo->BaseAddr + 0x19;
- pVBInfo->P3da = pVBInfo->BaseAddr + 0x2A;
- pVBInfo->Part0Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_00;
- pVBInfo->Part1Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_04;
- pVBInfo->Part2Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_10;
- pVBInfo->Part3Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_12;
- pVBInfo->Part4Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_14;
- pVBInfo->Part5Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_14 + 2;
-
- InitTo330Pointer(HwDeviceExtension->jChipType,pVBInfo);
-
- ReadVBIOSTablData(HwDeviceExtension->jChipType , pVBInfo);
-
- if (XGINew_GetXG20DRAMType(HwDeviceExtension, pVBInfo) == 0)
- XGINew_DDR1x_MRS_XG20(pVBInfo->P3c4, pVBInfo);
- else
- XGINew_DDR2_MRS_XG27(HwDeviceExtension, pVBInfo->P3c4, pVBInfo);
-
- XGINew_SetReg1(pVBInfo->P3c4, 0x1B, 0x03);
-}
-*/
-
void XGINew_ChkSenseStatus(struct xgi_hw_device_info *HwDeviceExtension,
struct vb_device_info *pVBInfo)
{
--
1.5.6.5

2011-03-08 20:16:20

by Aaro Koskinen

[permalink] [raw]
Subject: [PATCH 05/15] staging: xgifb: delete bSkipSense

bSkipSense is always false, thus redundant.

Signed-off-by: Aaro Koskinen <[email protected]>
---
drivers/staging/xgifb/vb_init.c | 44 ++++++++++++++++++-------------------
drivers/staging/xgifb/vgatypes.h | 2 -
2 files changed, 21 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/xgifb/vb_init.c b/drivers/staging/xgifb/vb_init.c
index 9a5aa6c..e33259a 100644
--- a/drivers/staging/xgifb/vb_init.c
+++ b/drivers/staging/xgifb/vb_init.c
@@ -388,34 +388,32 @@ unsigned char XGIInitNew(struct xgi_hw_device_info *HwDeviceExtension)
XGINew_SetReg1(pVBInfo->P3d4, 0x83, 0x00);
printk("181");

- if (HwDeviceExtension->bSkipSense == 0) {
- printk("182");
+ printk("182");

- XGI_SenseCRT1(pVBInfo);
+ XGI_SenseCRT1(pVBInfo);

- printk("183");
- /* XGINew_DetectMonitor(HwDeviceExtension); */
- pVBInfo->IF_DEF_CH7007 = 0;
- if ((HwDeviceExtension->jChipType == XG21) && (pVBInfo->IF_DEF_CH7007)) {
- printk("184");
- XGI_GetSenseStatus(HwDeviceExtension, pVBInfo); /* sense CRT2 */
- printk("185");
+ printk("183");
+ /* XGINew_DetectMonitor(HwDeviceExtension); */
+ pVBInfo->IF_DEF_CH7007 = 0;
+ if ((HwDeviceExtension->jChipType == XG21) && (pVBInfo->IF_DEF_CH7007)) {
+ printk("184");
+ XGI_GetSenseStatus(HwDeviceExtension, pVBInfo); /* sense CRT2 */
+ printk("185");

- }
- if (HwDeviceExtension->jChipType == XG21) {
- printk("186");
+ }
+ if (HwDeviceExtension->jChipType == XG21) {
+ printk("186");

- XGINew_SetRegANDOR(pVBInfo->P3d4, 0x32, ~Monitor1Sense, Monitor1Sense); /* Z9 default has CRT */
- temp = GetXG21FPBits(pVBInfo);
- XGINew_SetRegANDOR(pVBInfo->P3d4, 0x37, ~0x01, temp);
- printk("187");
+ XGINew_SetRegANDOR(pVBInfo->P3d4, 0x32, ~Monitor1Sense, Monitor1Sense); /* Z9 default has CRT */
+ temp = GetXG21FPBits(pVBInfo);
+ XGINew_SetRegANDOR(pVBInfo->P3d4, 0x37, ~0x01, temp);
+ printk("187");

- }
- if (HwDeviceExtension->jChipType == XG27) {
- XGINew_SetRegANDOR(pVBInfo->P3d4, 0x32, ~Monitor1Sense, Monitor1Sense); /* Z9 default has CRT */
- temp = GetXG27FPBits(pVBInfo);
- XGINew_SetRegANDOR(pVBInfo->P3d4, 0x37, ~0x03, temp);
- }
+ }
+ if (HwDeviceExtension->jChipType == XG27) {
+ XGINew_SetRegANDOR(pVBInfo->P3d4, 0x32, ~Monitor1Sense, Monitor1Sense); /* Z9 default has CRT */
+ temp = GetXG27FPBits(pVBInfo);
+ XGINew_SetRegANDOR(pVBInfo->P3d4, 0x37, ~0x03, temp);
}
printk("19");

diff --git a/drivers/staging/xgifb/vgatypes.h b/drivers/staging/xgifb/vgatypes.h
index 13c02be..c4624cc 100644
--- a/drivers/staging/xgifb/vgatypes.h
+++ b/drivers/staging/xgifb/vgatypes.h
@@ -82,8 +82,6 @@ struct xgi_hw_device_info

unsigned char bIntegratedMMEnabled;/* supporting integration MM enable */

- unsigned char bSkipSense;
-
unsigned char(*pQueryVGAConfigSpace)(struct xgi_hw_device_info *,
unsigned long, unsigned long,
unsigned long *);
--
1.5.6.5

2011-03-08 20:17:57

by Aaro Koskinen

[permalink] [raw]
Subject: [PATCH 13/15] staging: xgifb: vb_init: delete redundant declarations

Delete redundant declarations.

Signed-off-by: Aaro Koskinen <[email protected]>
---
drivers/staging/xgifb/vb_init.c | 21 ---------------------
1 files changed, 0 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/xgifb/vb_init.c b/drivers/staging/xgifb/vb_init.c
index a16827e..24dc00c 100644
--- a/drivers/staging/xgifb/vb_init.c
+++ b/drivers/staging/xgifb/vb_init.c
@@ -17,17 +17,6 @@

static unsigned char XGINew_ChannelAB, XGINew_DataBusWidth;

-unsigned short XGINew_DRAMType[17][5] = {
- {0x0C, 0x0A, 0x02, 0x40, 0x39}, {0x0D, 0x0A, 0x01, 0x40, 0x48},
- {0x0C, 0x09, 0x02, 0x20, 0x35}, {0x0D, 0x09, 0x01, 0x20, 0x44},
- {0x0C, 0x08, 0x02, 0x10, 0x31}, {0x0D, 0x08, 0x01, 0x10, 0x40},
- {0x0C, 0x0A, 0x01, 0x20, 0x34}, {0x0C, 0x09, 0x01, 0x08, 0x32},
- {0x0B, 0x08, 0x02, 0x08, 0x21}, {0x0C, 0x08, 0x01, 0x08, 0x30},
- {0x0A, 0x08, 0x02, 0x04, 0x11}, {0x0B, 0x0A, 0x01, 0x10, 0x28},
- {0x09, 0x08, 0x02, 0x02, 0x01}, {0x0B, 0x09, 0x01, 0x08, 0x24},
- {0x0B, 0x08, 0x01, 0x04, 0x20}, {0x0A, 0x08, 0x01, 0x02, 0x10},
- {0x09, 0x08, 0x01, 0x01, 0x00} };
-
static unsigned short XGINew_SDRDRAM_TYPE[13][5] = {
{ 2, 12, 9, 64, 0x35},
{ 1, 13, 9, 64, 0x44},
@@ -73,12 +62,10 @@ void XGINew_SetDRAMSize_340(struct xgi_hw_device_info *, struct vb_device_in
void XGINew_SetDRAMSize_310(struct xgi_hw_device_info *, struct vb_device_info *);
void XGINew_SetMemoryClock(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *);
void XGINew_SetDRAMModeRegister(struct vb_device_info *);
-void XGINew_SetDRAMModeRegister340(struct xgi_hw_device_info *HwDeviceExtension);
void XGINew_SetDRAMDefaultRegister340(struct xgi_hw_device_info *HwDeviceExtension,
unsigned long, struct vb_device_info *);
unsigned char XGINew_GetXG20DRAMType(struct xgi_hw_device_info *HwDeviceExtension,
struct vb_device_info *pVBInfo);
-unsigned char XGIInitNew(struct xgi_hw_device_info *HwDeviceExtension);

int XGINew_DDRSizing340(struct xgi_hw_device_info *, struct vb_device_info *);
void XGINew_DisableRefresh(struct xgi_hw_device_info *, struct vb_device_info *) ;
@@ -87,19 +74,11 @@ int XGINew_SDRSizing(struct vb_device_info *);
int XGINew_DDRSizing(struct vb_device_info *);
void XGINew_EnableRefresh(struct xgi_hw_device_info *, struct vb_device_info *);
static int XGINew_RAMType; /*int ModeIDOffset,StandTable,CRT1Table,ScreenOffset,REFIndex;*/
-#if 0
-static unsigned long UNIROM;
-#endif
-unsigned char ChkLFB(struct vb_device_info *);
-void XGINew_Delay15us(unsigned long);
void SetPowerConsume(struct xgi_hw_device_info *HwDeviceExtension,
unsigned long XGI_P3d4Port);
void ReadVBIOSTablData(unsigned char ChipType, struct vb_device_info *pVBInfo);
void XGINew_DDR1x_MRS_XG20(unsigned long P3c4, struct vb_device_info *pVBInfo);
-void XGINew_SetDRAMModeRegister_XG20(struct xgi_hw_device_info *HwDeviceExtension);
-void XGINew_SetDRAMModeRegister_XG27(struct xgi_hw_device_info *HwDeviceExtension);
void XGINew_ChkSenseStatus(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) ;
-void XGINew_SetModeScratch(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) ;
void XGINew_GetXG21Sense(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) ;
unsigned char GetXG21FPBits(struct vb_device_info *pVBInfo);
void XGINew_GetXG27Sense(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) ;
--
1.5.6.5

2011-03-08 20:16:18

by Aaro Koskinen

[permalink] [raw]
Subject: [PATCH 07/15] staging: xgifb: delete nomax module parameter

The parameter is not used.

Signed-off-by: Aaro Koskinen <[email protected]>
---
drivers/staging/xgifb/XGI_main_26.c | 9 ---------
1 files changed, 0 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/xgifb/XGI_main_26.c b/drivers/staging/xgifb/XGI_main_26.c
index ce569af..ee80171 100644
--- a/drivers/staging/xgifb/XGI_main_26.c
+++ b/drivers/staging/xgifb/XGI_main_26.c
@@ -2707,7 +2707,6 @@ static int forcecrt1 = -1;
static int pdc = -1;
static int pdc1 = -1;
static int noypan = -1;
-static int nomax = -1;
static int userom = -1;
static int useoem = -1;
static char *tvstandard = NULL;
@@ -2727,7 +2726,6 @@ MODULE_AUTHOR("XGITECH , Others");

module_param(mem, int, 0);
module_param(noypan, int, 0);
-module_param(nomax, int, 0);
module_param(userom, int, 0);
module_param(useoem, int, 0);
module_param(mode, charp, 0);
@@ -2754,13 +2752,6 @@ MODULE_PARM_DESC(noypan,
"\nIf set to anything other than 0, y-panning will be disabled and scrolling\n"
"will be performed by redrawing the screen. (default: 0)\n");

-MODULE_PARM_DESC(nomax,
- "\nIf y-panning is enabled, xgifb will by default use the entire available video\n"
- "memory for the virtual screen in order to optimize scrolling performance. If\n"
- "this is set to anything other than 0, xgifb will not do this and thereby\n"
- "enable the user to positively specify a virtual Y size of the screen using\n"
- "fbset. (default: 0)\n");
-
MODULE_PARM_DESC(mode,
"\nSelects the desired default display mode in the format XxYxDepth,\n"
"eg. 1024x768x16. Other formats supported include XxY-Depth and\n"
--
1.5.6.5

2011-03-08 20:18:25

by Aaro Koskinen

[permalink] [raw]
Subject: [PATCH 12/15] staging: xgifb: vb_ext: make internal functions static

Make internal functions static.

Signed-off-by: Aaro Koskinen <[email protected]>
---
drivers/staging/xgifb/vb_ext.c | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/xgifb/vb_ext.c b/drivers/staging/xgifb/vb_ext.c
index cc78815..33a0635 100644
--- a/drivers/staging/xgifb/vb_ext.c
+++ b/drivers/staging/xgifb/vb_ext.c
@@ -9,13 +9,13 @@
#include "vb_util.h"
#include "vb_setmode.h"
#include "vb_ext.h"
-unsigned char XGINew_GetPanelID(struct vb_device_info *pVBInfo);
-unsigned char XGINew_GetLCDDDCInfo(
+static unsigned char XGINew_GetPanelID(struct vb_device_info *pVBInfo);
+static unsigned char XGINew_GetLCDDDCInfo(
struct xgi_hw_device_info *HwDeviceExtension,
struct vb_device_info *pVBInfo);
-unsigned char XGINew_BridgeIsEnable(struct xgi_hw_device_info *,
+static unsigned char XGINew_BridgeIsEnable(struct xgi_hw_device_info *,
struct vb_device_info *pVBInfo);
-unsigned char XGINew_SenseHiTV(struct xgi_hw_device_info *HwDeviceExtension,
+static unsigned char XGINew_SenseHiTV(struct xgi_hw_device_info *HwDeviceExtension,
struct vb_device_info *pVBInfo);

/**************************************************************
@@ -34,7 +34,7 @@ static unsigned char XGINew_Is301B(struct vb_device_info *pVBInfo)
return 1;
}

-unsigned char XGINew_Sense(unsigned short tempbx, unsigned short tempcx, struct vb_device_info *pVBInfo)
+static unsigned char XGINew_Sense(unsigned short tempbx, unsigned short tempcx, struct vb_device_info *pVBInfo)
{
unsigned short temp, i, tempch;

@@ -214,7 +214,7 @@ unsigned short XGINew_SenseLCD(struct xgi_hw_device_info *HwDeviceExtension, str
return temp;
}

-unsigned char XGINew_GetLCDDDCInfo(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo)
+static unsigned char XGINew_GetLCDDDCInfo(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo)
{
unsigned short temp;

@@ -256,7 +256,7 @@ unsigned char XGINew_GetLCDDDCInfo(struct xgi_hw_device_info *HwDeviceExtension,
}
}

-unsigned char XGINew_GetPanelID(struct vb_device_info *pVBInfo)
+static unsigned char XGINew_GetPanelID(struct vb_device_info *pVBInfo)
{
unsigned short PanelTypeTable[16] = { SyncNN | PanelRGB18Bit
| Panel800x600 | _PanelType00, SyncNN | PanelRGB18Bit
@@ -318,7 +318,7 @@ unsigned char XGINew_GetPanelID(struct vb_device_info *pVBInfo)
}
}

-unsigned char XGINew_BridgeIsEnable(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo)
+static unsigned char XGINew_BridgeIsEnable(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo)
{
unsigned short flag;

@@ -334,7 +334,7 @@ unsigned char XGINew_BridgeIsEnable(struct xgi_hw_device_info *HwDeviceExtension
return 0;
}

-unsigned char XGINew_SenseHiTV(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo)
+static unsigned char XGINew_SenseHiTV(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo)
{
unsigned short tempbx, tempcx, temp, i, tempch;

--
1.5.6.5

2011-03-08 20:18:52

by Aaro Koskinen

[permalink] [raw]
Subject: [PATCH 11/15] staging: xgifb: vb_ext: delete unused functions

Delete unused functions.

Signed-off-by: Aaro Koskinen <[email protected]>
---
drivers/staging/xgifb/vb_ext.c | 437 ----------------------------------------
drivers/staging/xgifb/vb_ext.h | 3 -
2 files changed, 0 insertions(+), 440 deletions(-)

diff --git a/drivers/staging/xgifb/vb_ext.c b/drivers/staging/xgifb/vb_ext.c
index e1f9188..cc78815 100644
--- a/drivers/staging/xgifb/vb_ext.c
+++ b/drivers/staging/xgifb/vb_ext.c
@@ -34,28 +34,6 @@ static unsigned char XGINew_Is301B(struct vb_device_info *pVBInfo)
return 1;
}

-unsigned char XGI_Is301C(struct vb_device_info *pVBInfo)
-{
- if ((XGINew_GetReg1(pVBInfo->Part4Port, 0x01) & 0xF0) == 0xC0)
- return 1;
-
- if (XGINew_GetReg1(pVBInfo->Part4Port, 0x01) >= 0xD0) {
- if (XGINew_GetReg1(pVBInfo->Part4Port, 0x39) == 0xE0)
- return 1;
- }
-
- return 0;
-}
-
-unsigned char XGI_Is301LV(struct vb_device_info *pVBInfo)
-{
- if (XGINew_GetReg1(pVBInfo->Part4Port, 0x01) >= 0xD0) {
- if (XGINew_GetReg1(pVBInfo->Part4Port, 0x39) == 0xFF)
- return 1;
- }
- return 0;
-}
-
unsigned char XGINew_Sense(unsigned short tempbx, unsigned short tempcx, struct vb_device_info *pVBInfo)
{
unsigned short temp, i, tempch;
@@ -80,190 +58,6 @@ unsigned char XGINew_Sense(unsigned short tempbx, unsigned short tempcx, struct
return 0;
}

-void XGISetDPMS(struct xgi_hw_device_info *pXGIHWDE, unsigned long VESA_POWER_STATE)
-{
- unsigned short ModeNo, ModeIdIndex;
- unsigned char temp;
- struct vb_device_info VBINF;
- struct vb_device_info *pVBInfo = &VBINF;
- pVBInfo->BaseAddr = (unsigned long) pXGIHWDE->pjIOAddress;
- pVBInfo->ROMAddr = pXGIHWDE->pjVirtualRomBase;
-
- pVBInfo->IF_DEF_LVDS = 0;
- pVBInfo->IF_DEF_CH7005 = 0;
- pVBInfo->IF_DEF_HiVision = 1;
- pVBInfo->IF_DEF_LCDA = 1;
- pVBInfo->IF_DEF_CH7017 = 0;
- pVBInfo->IF_DEF_YPbPr = 1;
- pVBInfo->IF_DEF_CRT2Monitor = 0;
- pVBInfo->IF_DEF_VideoCapture = 0;
- pVBInfo->IF_DEF_ScaleLCD = 0;
- pVBInfo->IF_DEF_OEMUtil = 0;
- pVBInfo->IF_DEF_PWD = 0;
-
- InitTo330Pointer(pXGIHWDE->jChipType, pVBInfo);
- ReadVBIOSTablData(pXGIHWDE->jChipType, pVBInfo);
-
- pVBInfo->P3c4 = pVBInfo->BaseAddr + 0x14;
- pVBInfo->P3d4 = pVBInfo->BaseAddr + 0x24;
- pVBInfo->P3c0 = pVBInfo->BaseAddr + 0x10;
- pVBInfo->P3ce = pVBInfo->BaseAddr + 0x1e;
- pVBInfo->P3c2 = pVBInfo->BaseAddr + 0x12;
- pVBInfo->P3ca = pVBInfo->BaseAddr + 0x1a;
- pVBInfo->P3c6 = pVBInfo->BaseAddr + 0x16;
- pVBInfo->P3c7 = pVBInfo->BaseAddr + 0x17;
- pVBInfo->P3c8 = pVBInfo->BaseAddr + 0x18;
- pVBInfo->P3c9 = pVBInfo->BaseAddr + 0x19;
- pVBInfo->P3da = pVBInfo->BaseAddr + 0x2A;
- pVBInfo->Part0Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_00;
- pVBInfo->Part1Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_04;
- pVBInfo->Part2Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_10;
- pVBInfo->Part3Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_12;
- pVBInfo->Part4Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_14;
- pVBInfo->Part5Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_14 + 2;
-
- if (pXGIHWDE->jChipType == XG27) {
- if ((XGINew_GetReg1(pVBInfo->P3d4, 0x38) & 0xE0) == 0xC0) {
- if (XGINew_GetReg1(pVBInfo->P3d4, 0x30) & 0x20)
- pVBInfo->IF_DEF_LVDS = 1;
- }
- }
-
- if (pVBInfo->IF_DEF_CH7007 == 0)
- XGINew_SetModeScratch(pXGIHWDE, pVBInfo);
-
- XGINew_SetReg1(pVBInfo->P3c4, 0x05, 0x86); /* 1.Openkey */
- XGI_UnLockCRT2(pXGIHWDE, pVBInfo);
- ModeNo = XGINew_GetReg1(pVBInfo->P3d4, 0x34);
- XGI_SearchModeID(ModeNo, &ModeIdIndex, pVBInfo);
- XGI_GetVGAType(pXGIHWDE, pVBInfo);
-
- if ((pXGIHWDE->ujVBChipID == VB_CHIP_301) || (pXGIHWDE->ujVBChipID == VB_CHIP_302) || (pVBInfo->IF_DEF_CH7007 == 1)) {
- XGI_GetVBType(pVBInfo);
- XGI_GetVBInfo(ModeNo, ModeIdIndex, pXGIHWDE, pVBInfo);
- XGI_GetTVInfo(ModeNo, ModeIdIndex, pVBInfo);
- XGI_GetLCDInfo(ModeNo, ModeIdIndex, pVBInfo);
- }
-
- if (VESA_POWER_STATE == 0x00000400)
- XGINew_SetReg1(pVBInfo->Part4Port, 0x31, (unsigned char) (XGINew_GetReg1(pVBInfo->Part4Port, 0x31) & 0xFE));
- else
- XGINew_SetReg1(pVBInfo->Part4Port, 0x31, (unsigned char) (XGINew_GetReg1(pVBInfo->Part4Port, 0x31) | 0x01));
-
- temp = (unsigned char) XGINew_GetReg1(pVBInfo->P3c4, 0x1f);
- temp &= 0x3f;
- switch (VESA_POWER_STATE) {
- case 0x00000000: /* on */
- if ((pXGIHWDE->ujVBChipID == VB_CHIP_301) || (pXGIHWDE->ujVBChipID == VB_CHIP_302)) {
- XGINew_SetReg1(pVBInfo->P3c4, 0x1f, (unsigned char) (temp | 0x00));
- XGI_EnableBridge(pXGIHWDE, pVBInfo);
- } else {
- if (pXGIHWDE->jChipType == XG21) {
- if (pVBInfo->IF_DEF_LVDS == 1) {
- XGI_XG21BLSignalVDD(0x01, 0x01, pVBInfo); /* LVDS VDD on */
- XGI_XG21SetPanelDelay(2, pVBInfo);
- }
- }
- if (pXGIHWDE->jChipType == XG27) {
- if (pVBInfo->IF_DEF_LVDS == 1) {
- XGI_XG27BLSignalVDD(0x01, 0x01, pVBInfo); /* LVDS VDD on */
- XGI_XG21SetPanelDelay(2, pVBInfo);
- }
- }
- XGINew_SetRegANDOR(pVBInfo->P3c4, 0x1F, ~0xC0, 0x00);
- XGINew_SetRegAND(pVBInfo->P3c4, 0x01, ~0x20); /* CRT on */
-
- if (pXGIHWDE->jChipType == XG21) {
- temp = XGINew_GetReg1(pVBInfo->P3d4, 0x38);
- if (temp & 0xE0) {
- XGINew_SetRegANDOR(pVBInfo->P3c4, 0x09, ~0x80, 0x80); /* DVO ON */
- XGI_SetXG21FPBits(pVBInfo);
- XGINew_SetRegAND(pVBInfo->P3d4, 0x4A, ~0x20); /* Enable write GPIOF */
- /* XGINew_SetRegANDOR(pVBInfo->P3d4, 0x48, ~0x20, 0x20); *//* LCD Display ON */
- }
- XGI_XG21BLSignalVDD(0x20, 0x20, pVBInfo); /* LVDS signal on */
- XGI_DisplayOn(pXGIHWDE, pVBInfo);
- }
- if (pXGIHWDE->jChipType == XG27) {
- temp = XGINew_GetReg1(pVBInfo->P3d4, 0x38);
- if (temp & 0xE0) {
- XGINew_SetRegANDOR(pVBInfo->P3c4, 0x09, ~0x80, 0x80); /* DVO ON */
- XGI_SetXG27FPBits(pVBInfo);
- XGINew_SetRegAND(pVBInfo->P3d4, 0x4A, ~0x20); /* Enable write GPIOF */
- /* XGINew_SetRegANDOR(pVBInfo->P3d4, 0x48, ~0x20, 0x20); *//* LCD Display ON */
- }
- XGI_XG27BLSignalVDD(0x20, 0x20, pVBInfo); /* LVDS signal on */
- XGI_DisplayOn(pXGIHWDE, pVBInfo);
- }
- }
- break;
-
- case 0x00000100: /* standby */
- if (pXGIHWDE->jChipType >= XG21)
- XGI_DisplayOff(pXGIHWDE, pVBInfo);
- XGINew_SetReg1(pVBInfo->P3c4, 0x1f, (unsigned char) (temp | 0x40));
- break;
-
- case 0x00000200: /* suspend */
- if (pXGIHWDE->jChipType == XG21) {
- XGI_DisplayOff(pXGIHWDE, pVBInfo);
- XGI_XG21BLSignalVDD(0x20, 0x00, pVBInfo); /* LVDS signal off */
- }
- if (pXGIHWDE->jChipType == XG27) {
- XGI_DisplayOff(pXGIHWDE, pVBInfo);
- XGI_XG27BLSignalVDD(0x20, 0x00, pVBInfo); /* LVDS signal off */
- }
- XGINew_SetReg1(pVBInfo->P3c4, 0x1f, (unsigned char) (temp | 0x80));
- break;
-
- case 0x00000400: /* off */
- if ((pXGIHWDE->ujVBChipID == VB_CHIP_301) || (pXGIHWDE->ujVBChipID == VB_CHIP_302)) {
- XGINew_SetReg1(pVBInfo->P3c4, 0x1f, (unsigned char) (temp | 0xc0));
- XGI_DisableBridge(pXGIHWDE, pVBInfo);
- } else {
- if (pXGIHWDE->jChipType == XG21) {
- XGI_DisplayOff(pXGIHWDE, pVBInfo);
-
- XGI_XG21BLSignalVDD(0x20, 0x00, pVBInfo); /* LVDS signal off */
-
- temp = XGINew_GetReg1(pVBInfo->P3d4, 0x38);
- if (temp & 0xE0) {
- XGINew_SetRegAND(pVBInfo->P3c4, 0x09, ~0x80); /* DVO Off */
- XGINew_SetRegAND(pVBInfo->P3d4, 0x4A, ~0x20); /* Enable write GPIOF */
- /* XGINew_SetRegAND(pVBInfo->P3d4, 0x48, ~0x20); *//* LCD Display OFF */
- }
- }
- if (pXGIHWDE->jChipType == XG27) {
- XGI_DisplayOff(pXGIHWDE, pVBInfo);
-
- XGI_XG27BLSignalVDD(0x20, 0x00, pVBInfo); /* LVDS signal off */
-
- temp = XGINew_GetReg1(pVBInfo->P3d4, 0x38);
- if (temp & 0xE0)
- XGINew_SetRegAND(pVBInfo->P3c4, 0x09, ~0x80); /* DVO Off */
- }
- XGINew_SetRegANDOR(pVBInfo->P3c4, 0x1F, ~0xC0, 0xC0);
- XGINew_SetRegOR(pVBInfo->P3c4, 0x01, 0x20); /* CRT Off */
-
- if ((pXGIHWDE->jChipType == XG21) && (pVBInfo->IF_DEF_LVDS == 1)) {
- XGI_XG21SetPanelDelay(4, pVBInfo);
- XGI_XG21BLSignalVDD(0x01, 0x00, pVBInfo); /* LVDS VDD off */
- XGI_XG21SetPanelDelay(5, pVBInfo);
- }
- if ((pXGIHWDE->jChipType == XG27) && (pVBInfo->IF_DEF_LVDS == 1)) {
- XGI_XG21SetPanelDelay(4, pVBInfo);
- XGI_XG27BLSignalVDD(0x01, 0x00, pVBInfo); /* LVDS VDD off */
- XGI_XG21SetPanelDelay(5, pVBInfo);
- }
- }
- break;
-
- default:
- break;
- }
- XGI_LockCRT2(pXGIHWDE, pVBInfo);
-}
-
void XGI_GetSenseStatus(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo)
{
unsigned short tempax = 0, tempbx, tempcx, temp, P2reg0 = 0, SenseModeNo = 0,
@@ -607,234 +401,3 @@ unsigned char XGINew_SenseHiTV(struct xgi_hw_device_info *HwDeviceExtension, str
return 0;
}
}
-
-/* ----------------------------------------------------------------------------
- * Description: Get Panel support
- * O/P :
- * BL: Panel ID=81h for no scaler LVDS
- * BH: Panel enhanced Mode Count
- * CX: Panel H. resolution
- * DX: PAnel V. resolution
- * ----------------------------------------------------------------------------
- */
-static void XGI_XG21Fun14Sub70(struct vb_device_info *pVBInfo, PX86_REGS pBiosArguments)
-{
- unsigned short ModeIdIndex;
- unsigned short ModeNo;
-
- unsigned short EModeCount;
- unsigned short lvdstableindex;
-
- lvdstableindex = XGI_GetLVDSOEMTableIndex(pVBInfo);
- pBiosArguments->h.bl = 0x81;
- pBiosArguments->x.cx = pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDSHDE;
- pBiosArguments->x.dx = pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDSVDE;
- EModeCount = 0;
-
- pBiosArguments->x.ax = 0x0014;
- for (ModeIdIndex = 0;; ModeIdIndex++) {
- ModeNo = pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeID;
- if (pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeID == 0xFF) {
- pBiosArguments->h.bh = (unsigned char) EModeCount;
- return;
- }
- if (!XGI_XG21CheckLVDSMode(ModeNo, ModeIdIndex, pVBInfo))
- continue;
-
- EModeCount++;
- }
-}
-
-/* ----------------------------------------------------------------------------
- *
- * Description: Get Panel mode ID for enhanced mode
- * I/P : BH: EModeIndex ( which < Panel enhanced Mode Count )
- * O/P :
- * BL: Mode ID
- * CX: H. resolution of the assigned by the index
- * DX: V. resolution of the assigned by the index
- *
- * ----------------------------------------------------------------------------
- */
-
-static void XGI_XG21Fun14Sub71(struct vb_device_info *pVBInfo, PX86_REGS pBiosArguments)
-{
-
- unsigned short EModeCount;
- unsigned short ModeIdIndex, resindex;
- unsigned short ModeNo;
- unsigned short EModeIndex = pBiosArguments->h.bh;
-
- EModeCount = 0;
- for (ModeIdIndex = 0;; ModeIdIndex++) {
- ModeNo = pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeID;
- if (pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeID == 0xFF) {
- pBiosArguments->x.ax = 0x0114;
- return;
- }
- if (!XGI_XG21CheckLVDSMode(ModeNo, ModeIdIndex, pVBInfo))
- continue;
-
- if (EModeCount == EModeIndex) {
- resindex = XGI_GetResInfo(ModeNo, ModeIdIndex, pVBInfo);
- pBiosArguments->h.bl = (unsigned char) ModeNo;
- pBiosArguments->x.cx = pVBInfo->ModeResInfo[resindex].HTotal; /* xres->ax */
- pBiosArguments->x.dx = pVBInfo->ModeResInfo[resindex].VTotal; /* yres->bx */
- pBiosArguments->x.ax = 0x0014;
- }
- EModeCount++;
-
- }
-
-}
-
-/* ----------------------------------------------------------------------------
- *
- * Description: Validate Panel modes ID support
- * I/P :
- * BL: ModeID
- * O/P :
- * CX: H. resolution of the assigned by the index
- * DX: V. resolution of the assigned by the index
- *
- * ----------------------------------------------------------------------------
- */
-static void XGI_XG21Fun14Sub72(struct vb_device_info *pVBInfo, PX86_REGS pBiosArguments)
-{
- unsigned short ModeIdIndex, resindex;
- unsigned short ModeNo;
-
- ModeNo = pBiosArguments->h.bl;
- XGI_SearchModeID(ModeNo, &ModeIdIndex, pVBInfo);
- if (!XGI_XG21CheckLVDSMode(ModeNo, ModeIdIndex, pVBInfo)) {
- pBiosArguments->x.cx = 0;
- pBiosArguments->x.dx = 0;
- pBiosArguments->x.ax = 0x0114;
- return;
- }
- resindex = XGI_GetResInfo(ModeNo, ModeIdIndex, pVBInfo);
- if (ModeNo <= 0x13) {
- pBiosArguments->x.cx = pVBInfo->StResInfo[resindex].HTotal;
- pBiosArguments->x.dx = pVBInfo->StResInfo[resindex].VTotal;
- } else {
- pBiosArguments->x.cx = pVBInfo->ModeResInfo[resindex].HTotal; /* xres->ax */
- pBiosArguments->x.dx = pVBInfo->ModeResInfo[resindex].VTotal; /* yres->bx */
- }
-
- pBiosArguments->x.ax = 0x0014;
-
-}
-
-/* ----------------------------------------------------------------------------
- *
- * Description: Get Customized Panel misc. information support
- * I/P : Select
- * to get panel horizontal timing
- * to get panel vertical timing
- * to get channel clock parameter
- * to get panel misc information
- *
- * O/P :
- * BL: for input Select = 0 ;
- * BX: *Value1 = Horizontal total
- * CX: *Value2 = Horizontal front porch
- * DX: *Value2 = Horizontal sync width
- * BL: for input Select = 1 ;
- * BX: *Value1 = Vertical total
- * CX: *Value2 = Vertical front porch
- * DX: *Value2 = Vertical sync width
- * BL: for input Select = 2 ;
- * BX: Value1 = The first CLK parameter
- * CX: Value2 = The second CLK parameter
- * BL: for input Select = 4 ;
- * BX[15]: *Value1 D[15] VESA V. Polarity
- * BX[14]: *Value1 D[14] VESA H. Polarity
- * BX[7]: *Value1 D[7] Panel V. Polarity
- * BX[6]: *Value1 D[6] Panel H. Polarity
- * ----------------------------------------------------------------------------
- */
-static void XGI_XG21Fun14Sub73(struct vb_device_info *pVBInfo, PX86_REGS pBiosArguments)
-{
- unsigned char Select;
-
- unsigned short lvdstableindex;
-
- lvdstableindex = XGI_GetLVDSOEMTableIndex(pVBInfo);
- Select = pBiosArguments->h.bl;
-
- switch (Select) {
- case 0:
- pBiosArguments->x.bx = pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDSHT;
- pBiosArguments->x.cx = pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDSHFP;
- pBiosArguments->x.dx = pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDSHSYNC;
- break;
- case 1:
- pBiosArguments->x.bx = pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDSVT;
- pBiosArguments->x.cx = pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDSVFP;
- pBiosArguments->x.dx = pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDSVSYNC;
- break;
- case 2:
- pBiosArguments->x.bx = pVBInfo->XG21_LVDSCapList[lvdstableindex].VCLKData1;
- pBiosArguments->x.cx = pVBInfo->XG21_LVDSCapList[lvdstableindex].VCLKData2;
- break;
- case 4:
- pBiosArguments->x.bx = pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDS_Capability;
- break;
- }
-
- pBiosArguments->x.ax = 0x0014;
-}
-
-void XGI_XG21Fun14(struct xgi_hw_device_info *pXGIHWDE, PX86_REGS pBiosArguments)
-{
- struct vb_device_info VBINF;
- struct vb_device_info *pVBInfo = &VBINF;
-
- pVBInfo->IF_DEF_LVDS = 0;
- pVBInfo->IF_DEF_CH7005 = 0;
- pVBInfo->IF_DEF_HiVision = 1;
- pVBInfo->IF_DEF_LCDA = 1;
- pVBInfo->IF_DEF_CH7017 = 0;
- pVBInfo->IF_DEF_YPbPr = 1;
- pVBInfo->IF_DEF_CRT2Monitor = 0;
- pVBInfo->IF_DEF_VideoCapture = 0;
- pVBInfo->IF_DEF_ScaleLCD = 0;
- pVBInfo->IF_DEF_OEMUtil = 0;
- pVBInfo->IF_DEF_PWD = 0;
-
- InitTo330Pointer(pXGIHWDE->jChipType, pVBInfo);
- ReadVBIOSTablData(pXGIHWDE->jChipType, pVBInfo);
-
- pVBInfo->P3c4 = pVBInfo->BaseAddr + 0x14;
- pVBInfo->P3d4 = pVBInfo->BaseAddr + 0x24;
- pVBInfo->P3c0 = pVBInfo->BaseAddr + 0x10;
- pVBInfo->P3ce = pVBInfo->BaseAddr + 0x1e;
- pVBInfo->P3c2 = pVBInfo->BaseAddr + 0x12;
- pVBInfo->P3ca = pVBInfo->BaseAddr + 0x1a;
- pVBInfo->P3c6 = pVBInfo->BaseAddr + 0x16;
- pVBInfo->P3c7 = pVBInfo->BaseAddr + 0x17;
- pVBInfo->P3c8 = pVBInfo->BaseAddr + 0x18;
- pVBInfo->P3c9 = pVBInfo->BaseAddr + 0x19;
- pVBInfo->P3da = pVBInfo->BaseAddr + 0x2A;
- pVBInfo->Part0Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_00;
- pVBInfo->Part1Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_04;
- pVBInfo->Part2Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_10;
- pVBInfo->Part3Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_12;
- pVBInfo->Part4Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_14;
- pVBInfo->Part5Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_14 + 2;
-
- switch (pBiosArguments->x.ax) {
- case 0x1470:
- XGI_XG21Fun14Sub70(pVBInfo, pBiosArguments);
- break;
- case 0x1471:
- XGI_XG21Fun14Sub71(pVBInfo, pBiosArguments);
- break;
- case 0x1472:
- XGI_XG21Fun14Sub72(pVBInfo, pBiosArguments);
- break;
- case 0x1473:
- XGI_XG21Fun14Sub73(pVBInfo, pBiosArguments);
- break;
- }
-}
diff --git a/drivers/staging/xgifb/vb_ext.h b/drivers/staging/xgifb/vb_ext.h
index 5cc4d12..6824525 100644
--- a/drivers/staging/xgifb/vb_ext.h
+++ b/drivers/staging/xgifb/vb_ext.h
@@ -21,9 +21,6 @@ typedef union _X86_REGS {
struct BYTEREGS h;
} X86_REGS, *PX86_REGS;

-extern void XGI_XG21Fun14(struct xgi_hw_device_info *pXGIHWDE, PX86_REGS pBiosArguments);
-extern void XGISetDPMS(struct xgi_hw_device_info *pXGIHWDE,
- unsigned long VESA_POWER_STATE);
extern void XGI_GetSenseStatus(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo);
extern void XGINew_SetModeScratch(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) ;
extern void ReadVBIOSTablData(unsigned char ChipType,
--
1.5.6.5

2011-03-08 20:18:53

by Aaro Koskinen

[permalink] [raw]
Subject: [PATCH 03/15] staging: xgifb: delete offscreen memory management

The offscreen memory area currently conflicts with the video memory
exported to the framebuffer layer. The driver does not utilize offscreen
memory, so the functionality can be deleted.

The patch also eliminates the one last memory leak when the driver
is unloaded.

Signed-off-by: Aaro Koskinen <[email protected]>
---
drivers/staging/xgifb/XGI_main.h | 47 -----
drivers/staging/xgifb/XGI_main_26.c | 319 -----------------------------------
drivers/staging/xgifb/XGIfb.h | 1 -
3 files changed, 0 insertions(+), 367 deletions(-)

diff --git a/drivers/staging/xgifb/XGI_main.h b/drivers/staging/xgifb/XGI_main.h
index 2c55faa..b27623a 100644
--- a/drivers/staging/xgifb/XGI_main.h
+++ b/drivers/staging/xgifb/XGI_main.h
@@ -65,9 +65,6 @@ MODULE_DEVICE_TABLE(pci, xgifb_pci_table);

#define MAX_ROM_SCAN 0x10000

-#define OH_ALLOC_SIZE 4000
-#define SENTINEL 0x7fffffff
-
#define SEQ_ADR 0x14
#define SEQ_DATA 0x15
#define DAC_ADR 0x18
@@ -315,7 +312,6 @@ static int XGIfb_userom = 0;
/* global flags */
static int XGIfb_registered;
static int XGIfb_tvmode = 0;
-static int XGIfb_mem = 0;
static int XGIfb_pdc = 0;
static int enable_dstn = 0;
static int XGIfb_ypan = -1;
@@ -538,31 +534,6 @@ static const struct _chswtable {
{ 0, 0, "" , "" }
};

-typedef struct _XGI_OH {
- struct _XGI_OH *poh_next;
- struct _XGI_OH *poh_prev;
- unsigned long offset;
- unsigned long size;
-} XGI_OH;
-
-typedef struct _XGI_OHALLOC {
- struct _XGI_OHALLOC *poha_next;
- XGI_OH aoh[1];
-} XGI_OHALLOC;
-
-typedef struct _XGI_HEAP {
- XGI_OH oh_free;
- XGI_OH oh_used;
- XGI_OH *poh_freelist;
- XGI_OHALLOC *poha_chain;
- unsigned long max_freesize;
-} XGI_HEAP;
-
-static unsigned long XGIfb_heap_start;
-static unsigned long XGIfb_heap_end;
-static unsigned long XGIfb_heap_size;
-static XGI_HEAP XGIfb_heap;
-
// Eden Chen
static const struct _XGI_TV_filter {
u8 filter[9][4];
@@ -766,15 +737,6 @@ static int XGIfb_do_set_var(struct fb_var_screeninfo *var, int isactive,
static void XGIfb_pre_setmode(void);
static void XGIfb_post_setmode(void);

-struct XGI_memreq {
- unsigned long offset;
- unsigned long size;
-};
-
-/* XGI-specific Export functions */
-void XGI_malloc(struct XGI_memreq *req);
-void XGI_free(unsigned long base);
-
/* Internal hardware access routines */
void XGIfb_set_reg4(u16 port, unsigned long data);
u32 XGIfb_get_reg3(u16 port);
@@ -788,15 +750,6 @@ static void XGIfb_get_VB_type(void);
static int XGIfb_has_VB(void);


-/* Internal heap routines */
-static int XGIfb_heap_init(void);
-static XGI_OH *XGIfb_poh_new_node(void);
-static XGI_OH *XGIfb_poh_allocate(unsigned long size);
-static void XGIfb_delete_node(XGI_OH *poh);
-static void XGIfb_insert_node(XGI_OH *pohList, XGI_OH *poh);
-static XGI_OH *XGIfb_poh_free(unsigned long base);
-static void XGIfb_free_node(XGI_OH *poh);
-
/* Internal routines to access PCI configuration space */
unsigned char XGIfb_query_VGA_config_space(struct xgi_hw_device_info *pXGIhw_ext,
unsigned long offset,
diff --git a/drivers/staging/xgifb/XGI_main_26.c b/drivers/staging/xgifb/XGI_main_26.c
index 08551e9..aeccdee 100644
--- a/drivers/staging/xgifb/XGI_main_26.c
+++ b/drivers/staging/xgifb/XGI_main_26.c
@@ -1495,16 +1495,6 @@ static int XGIfb_get_fix(struct fb_fix_screeninfo *fix, int con,

fix->smem_len = xgi_video_info.video_size;

- /* if((!XGIfb_mem) || (XGIfb_mem > (xgi_video_info.video_size/1024))) {
- if (xgi_video_info.video_size > 0x1000000) {
- fix->smem_len = 0xD00000;
- } else if (xgi_video_info.video_size > 0x800000)
- fix->smem_len = 0x800000;
- else
- fix->smem_len = 0x400000;
- } else
- fix->smem_len = XGIfb_mem * 1024;
- */
fix->type = video_type;
fix->type_aux = 0;
if (xgi_video_info.video_bpp == 8)
@@ -1883,297 +1873,6 @@ void XGI_Sense30x(void)
outXGIIDXREG(XGIPART4, 0x0d, backupP4_0d);
}

-/* ------------------------ Heap routines -------------------------- */
-
-static int XGIfb_heap_init(void)
-{
- XGI_OH *poh;
-
- /* TW: The heap start is either set manually using the "mem" parameter, or
- * defaults as follows:
- * -) If more than 16MB videoRAM available, let our heap start at 12MB.
- * -) If more than 8MB videoRAM available, let our heap start at 8MB.
- * -) If 4MB or less is available, let it start at 4MB.
- * This is for avoiding a clash with X driver which uses the beginning
- * of the videoRAM. To limit size of X framebuffer, use Option MaxXFBMem
- * in XF86Config-4.
- * The heap start can also be specified by parameter "mem" when starting the XGIfb
- * driver. XGIfb mem=1024 lets heap starts at 1MB, etc.
- */
- if ((!XGIfb_mem) || (XGIfb_mem > (xgi_video_info.video_size / 1024))) {
- if (xgi_video_info.video_size > 0x1000000)
- xgi_video_info.heapstart = 0xD00000;
- else if (xgi_video_info.video_size > 0x800000)
- xgi_video_info.heapstart = 0x800000;
- else
- xgi_video_info.heapstart = 0x400000;
- } else {
- xgi_video_info.heapstart = XGIfb_mem * 1024;
- }
- XGIfb_heap_start = (unsigned long) (xgi_video_info.video_vbase
- + xgi_video_info.heapstart);
- printk(KERN_INFO "XGIfb: Memory heap starting at %dK\n",
- (int)(xgi_video_info.heapstart / 1024));
-
- XGIfb_heap_end = (unsigned long) xgi_video_info.video_vbase
- + xgi_video_info.video_size;
- XGIfb_heap_size = XGIfb_heap_end - XGIfb_heap_start;
-
- XGIfb_heap.poha_chain = NULL;
- XGIfb_heap.poh_freelist = NULL;
-
- poh = XGIfb_poh_new_node();
-
- if (poh == NULL)
- return 1;
-
- poh->poh_next = &XGIfb_heap.oh_free;
- poh->poh_prev = &XGIfb_heap.oh_free;
- poh->size = XGIfb_heap_end - XGIfb_heap_start + 1;
- poh->offset = XGIfb_heap_start - (unsigned long) xgi_video_info.video_vbase;
-
- DPRINTK("XGIfb: Heap start:0x%p, end:0x%p, len=%dk\n",
- (char *) XGIfb_heap_start, (char *) XGIfb_heap_end,
- (unsigned int) poh->size / 1024);
-
- DPRINTK("XGIfb: First Node offset:0x%x, size:%dk\n",
- (unsigned int) poh->offset, (unsigned int) poh->size / 1024);
-
- XGIfb_heap.oh_free.poh_next = poh;
- XGIfb_heap.oh_free.poh_prev = poh;
- XGIfb_heap.oh_free.size = 0;
- XGIfb_heap.max_freesize = poh->size;
-
- XGIfb_heap.oh_used.poh_next = &XGIfb_heap.oh_used;
- XGIfb_heap.oh_used.poh_prev = &XGIfb_heap.oh_used;
- XGIfb_heap.oh_used.size = SENTINEL;
-
- return 0;
-}
-
-static XGI_OH *XGIfb_poh_new_node(void)
-{
- int i;
- unsigned long cOhs;
- XGI_OHALLOC *poha;
- XGI_OH *poh;
-
- if (XGIfb_heap.poh_freelist == NULL) {
- poha = kmalloc(OH_ALLOC_SIZE, GFP_KERNEL);
- if (!poha)
- return NULL;
-
- poha->poha_next = XGIfb_heap.poha_chain;
- XGIfb_heap.poha_chain = poha;
-
- cOhs = (OH_ALLOC_SIZE - sizeof(XGI_OHALLOC)) / sizeof(XGI_OH)
- + 1;
-
- poh = &poha->aoh[0];
- for (i = cOhs - 1; i != 0; i--) {
- poh->poh_next = poh + 1;
- poh = poh + 1;
- }
-
- poh->poh_next = NULL;
- XGIfb_heap.poh_freelist = &poha->aoh[0];
- }
-
- poh = XGIfb_heap.poh_freelist;
- XGIfb_heap.poh_freelist = poh->poh_next;
-
- return poh;
-}
-
-static XGI_OH *XGIfb_poh_allocate(unsigned long size)
-{
- XGI_OH *pohThis;
- XGI_OH *pohRoot;
- int bAllocated = 0;
-
- if (size > XGIfb_heap.max_freesize) {
- DPRINTK("XGIfb: Can't allocate %dk size on offscreen\n",
- (unsigned int) size / 1024);
- return NULL;
- }
-
- pohThis = XGIfb_heap.oh_free.poh_next;
-
- while (pohThis != &XGIfb_heap.oh_free) {
- if (size <= pohThis->size) {
- bAllocated = 1;
- break;
- }
- pohThis = pohThis->poh_next;
- }
-
- if (!bAllocated) {
- DPRINTK("XGIfb: Can't allocate %dk size on offscreen\n",
- (unsigned int) size / 1024);
- return NULL;
- }
-
- if (size == pohThis->size) {
- pohRoot = pohThis;
- XGIfb_delete_node(pohThis);
- } else {
- pohRoot = XGIfb_poh_new_node();
-
- if (pohRoot == NULL)
- return NULL;
-
- pohRoot->offset = pohThis->offset;
- pohRoot->size = size;
-
- pohThis->offset += size;
- pohThis->size -= size;
- }
-
- XGIfb_heap.max_freesize -= size;
-
- pohThis = &XGIfb_heap.oh_used;
- XGIfb_insert_node(pohThis, pohRoot);
-
- return pohRoot;
-}
-
-static void XGIfb_delete_node(XGI_OH *poh)
-{
- XGI_OH *poh_prev;
- XGI_OH *poh_next;
-
- poh_prev = poh->poh_prev;
- poh_next = poh->poh_next;
-
- poh_prev->poh_next = poh_next;
- poh_next->poh_prev = poh_prev;
-
-}
-
-static void XGIfb_insert_node(XGI_OH *pohList, XGI_OH *poh)
-{
- XGI_OH *pohTemp;
-
- pohTemp = pohList->poh_next;
-
- pohList->poh_next = poh;
- pohTemp->poh_prev = poh;
-
- poh->poh_prev = pohList;
- poh->poh_next = pohTemp;
-}
-
-static XGI_OH *XGIfb_poh_free(unsigned long base)
-{
- XGI_OH *pohThis;
- XGI_OH *poh_freed;
- XGI_OH *poh_prev;
- XGI_OH *poh_next;
- unsigned long ulUpper;
- unsigned long ulLower;
- int foundNode = 0;
-
- poh_freed = XGIfb_heap.oh_used.poh_next;
-
- while (poh_freed != &XGIfb_heap.oh_used) {
- if (poh_freed->offset == base) {
- foundNode = 1;
- break;
- }
-
- poh_freed = poh_freed->poh_next;
- }
-
- if (!foundNode)
- return NULL;
-
- XGIfb_heap.max_freesize += poh_freed->size;
-
- poh_prev = poh_next = NULL;
- ulUpper = poh_freed->offset + poh_freed->size;
- ulLower = poh_freed->offset;
-
- pohThis = XGIfb_heap.oh_free.poh_next;
-
- while (pohThis != &XGIfb_heap.oh_free) {
- if (pohThis->offset == ulUpper)
- poh_next = pohThis;
- else if ((pohThis->offset + pohThis->size) == ulLower)
- poh_prev = pohThis;
-
- pohThis = pohThis->poh_next;
- }
-
- XGIfb_delete_node(poh_freed);
-
- if (poh_prev && poh_next) {
- poh_prev->size += (poh_freed->size + poh_next->size);
- XGIfb_delete_node(poh_next);
- XGIfb_free_node(poh_freed);
- XGIfb_free_node(poh_next);
- return poh_prev;
- }
-
- if (poh_prev) {
- poh_prev->size += poh_freed->size;
- XGIfb_free_node(poh_freed);
- return poh_prev;
- }
-
- if (poh_next) {
- poh_next->size += poh_freed->size;
- poh_next->offset = poh_freed->offset;
- XGIfb_free_node(poh_freed);
- return poh_next;
- }
-
- XGIfb_insert_node(&XGIfb_heap.oh_free, poh_freed);
-
- return poh_freed;
-}
-
-static void XGIfb_free_node(XGI_OH *poh)
-{
- if (poh == NULL)
- return;
-
- poh->poh_next = XGIfb_heap.poh_freelist;
- XGIfb_heap.poh_freelist = poh;
-
-}
-
-void XGI_malloc(struct XGI_memreq *req)
-{
- XGI_OH *poh;
-
- poh = XGIfb_poh_allocate(req->size);
-
- if (poh == NULL) {
- req->offset = 0;
- req->size = 0;
- DPRINTK("XGIfb: Video RAM allocation failed\n");
- } else {
- DPRINTK("XGIfb: Video RAM allocation succeeded: 0x%p\n",
- (char *) (poh->offset + (unsigned long) xgi_video_info.video_vbase));
-
- req->offset = poh->offset;
- req->size = poh->size;
- }
-
-}
-
-void XGI_free(unsigned long base)
-{
- XGI_OH *poh;
-
- poh = XGIfb_poh_free(base);
-
- if (poh == NULL) {
- DPRINTK("XGIfb: XGIfb_poh_free() failed at base 0x%x\n",
- (unsigned int) base);
- }
-}
-
/* --------------------- SetMode routines ------------------------- */

static void XGIfb_pre_setmode(void)
@@ -2434,8 +2133,6 @@ XGIINITSTATIC int __init XGIfb_setup(char *options)
XGIfb_search_tvstd(this_opt + 7);
} else if (!strncmp(this_opt, "tvstandard:", 11)) {
XGIfb_search_tvstd(this_opt + 7);
- } else if (!strncmp(this_opt, "mem:", 4)) {
- XGIfb_mem = simple_strtoul(this_opt + 4, NULL, 0);
} else if (!strncmp(this_opt, "dstn", 4)) {
enable_dstn = 1;
/* TW: DSTN overrules forcecrt2type */
@@ -2686,9 +2383,6 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
else
printk("Fail\n");

- if (XGIfb_heap_init())
- printk(KERN_WARNING "XGIfb: Failed to initialize offscreen memory heap\n");
-
xgi_video_info.mtrr = (unsigned int) 0;

if ((xgifb_mode_idx < 0) || ((XGIbios_mode[xgifb_mode_idx].mode_no) != 0xFF)) {
@@ -3074,15 +2768,6 @@ module_param(resetcard, int, 0);
module_param(videoram, int, 0);
#endif

-MODULE_PARM_DESC(mem,
- "\nDetermines the beginning of the video memory heap in KB. This heap is used\n"
- "for video RAM management for eg. DRM/DRI. On 300 series, the default depends\n"
- "on the amount of video RAM available. If 8MB of video RAM or less is available,\n"
- "the heap starts at 4096KB, if between 8 and 16MB are available at 8192KB,\n"
- "otherwise at 12288KB. On 315 and Xabre series, the heap size is 32KB by default.\n"
- "The value is to be specified without 'KB' and must match the MaxXFBMem setting\n"
- "for XFree86 4.x/X.org 6.7 and later.\n");
-
MODULE_PARM_DESC(noypan,
"\nIf set to anything other than 0, y-panning will be disabled and scrolling\n"
"will be performed by redrawing the screen. (default: 0)\n");
@@ -3191,7 +2876,3 @@ module_init(xgifb_init_module);
module_exit(xgifb_remove_module);

#endif /* /MODULE */
-
-EXPORT_SYMBOL(XGI_malloc);
-EXPORT_SYMBOL(XGI_free);
-
diff --git a/drivers/staging/xgifb/XGIfb.h b/drivers/staging/xgifb/XGIfb.h
index d6c3139..7813bbe 100644
--- a/drivers/staging/xgifb/XGIfb.h
+++ b/drivers/staging/xgifb/XGIfb.h
@@ -92,7 +92,6 @@ struct video_info{
char * mmio_vbase;
unsigned long vga_base;
unsigned long mtrr;
- unsigned long heapstart;

int video_bpp;
int video_cmap_len;
--
1.5.6.5

2011-03-08 20:16:16

by Aaro Koskinen

[permalink] [raw]
Subject: [PATCH 01/15] staging: xgifb: delete HW cursor memory allocation

HW cursor area is not used in any way.

Signed-off-by: Aaro Koskinen <[email protected]>
---
drivers/staging/xgifb/XGI_main.h | 8 --------
drivers/staging/xgifb/XGI_main_26.c | 18 ------------------
2 files changed, 0 insertions(+), 26 deletions(-)

diff --git a/drivers/staging/xgifb/XGI_main.h b/drivers/staging/xgifb/XGI_main.h
index 37f77ee..88d15c8 100644
--- a/drivers/staging/xgifb/XGI_main.h
+++ b/drivers/staging/xgifb/XGI_main.h
@@ -66,7 +66,6 @@ MODULE_DEVICE_TABLE(pci, xgifb_pci_table);

#define MAX_ROM_SCAN 0x10000

-#define HW_CURSOR_CAP 0x80
#define TURBO_QUEUE_CAP 0x40
#define AGP_CMD_QUEUE_CAP 0x20
#define VM_CMD_QUEUE_CAP 0x10
@@ -80,10 +79,6 @@ MODULE_DEVICE_TABLE(pci, xgifb_pci_table);
#define COMMAND_QUEUE_THRESHOLD 0x1F


-/* TW */
-#define HW_CURSOR_AREA_SIZE_315 0x4000 /* 16K */
-#define HW_CURSOR_AREA_SIZE_300 0x1000 /* 4K */
-
#define OH_ALLOC_SIZE 4000
#define SENTINEL 0x7fffffff

@@ -350,7 +345,6 @@ static int enable_dstn = 0;
static int XGIfb_ypan = -1;


-static int XGIfb_hwcursor_size = 0;
static int XGIfb_CRT2_write_enable = 0;

static int XGIfb_crt2type = -1; /* TW: CRT2 type (for overriding autodetection) */
@@ -613,8 +607,6 @@ typedef struct _XGI_HEAP {
unsigned long max_freesize;
} XGI_HEAP;

-static unsigned long XGIfb_hwcursor_vbase;
-
static unsigned long XGIfb_heap_start;
static unsigned long XGIfb_heap_end;
static unsigned long XGIfb_heap_size;
diff --git a/drivers/staging/xgifb/XGI_main_26.c b/drivers/staging/xgifb/XGI_main_26.c
index faf7106..3998dd4 100644
--- a/drivers/staging/xgifb/XGI_main_26.c
+++ b/drivers/staging/xgifb/XGI_main_26.c
@@ -2122,19 +2122,6 @@ static int XGIfb_heap_init(void)
break;
}

- /* TW: Now reserve memory for the HWCursor. It is always located at the very
- top of the videoRAM, right below the TB memory area (if used). */
- if (XGIfb_heap_size >= XGIfb_hwcursor_size) {
- XGIfb_heap_end -= XGIfb_hwcursor_size;
- XGIfb_heap_size -= XGIfb_hwcursor_size;
- XGIfb_hwcursor_vbase = XGIfb_heap_end;
-
- XGIfb_caps |= HW_CURSOR_CAP;
-
- DPRINTK("XGIfb: Hardware Cursor start at 0x%lx, size is %dK\n",
- XGIfb_heap_end, XGIfb_hwcursor_size/1024);
- }
-
XGIfb_heap.poha_chain = NULL;
XGIfb_heap.poh_freelist = NULL;

@@ -2772,27 +2759,22 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
xgi_video_info.chip = XG21;
else
xgi_video_info.chip = XG20;
- XGIfb_hwcursor_size = HW_CURSOR_AREA_SIZE_315 * 2;
XGIfb_CRT2_write_enable = IND_XGI_CRT2_WRITE_ENABLE_315;
break;
case PCI_DEVICE_ID_XG_40:
xgi_video_info.chip = XG40;
- XGIfb_hwcursor_size = HW_CURSOR_AREA_SIZE_315 * 2;
XGIfb_CRT2_write_enable = IND_XGI_CRT2_WRITE_ENABLE_315;
break;
case PCI_DEVICE_ID_XG_41:
xgi_video_info.chip = XG41;
- XGIfb_hwcursor_size = HW_CURSOR_AREA_SIZE_315 * 2;
XGIfb_CRT2_write_enable = IND_XGI_CRT2_WRITE_ENABLE_315;
break;
case PCI_DEVICE_ID_XG_42:
xgi_video_info.chip = XG42;
- XGIfb_hwcursor_size = HW_CURSOR_AREA_SIZE_315 * 2;
XGIfb_CRT2_write_enable = IND_XGI_CRT2_WRITE_ENABLE_315;
break;
case PCI_DEVICE_ID_XG_27:
xgi_video_info.chip = XG27;
- XGIfb_hwcursor_size = HW_CURSOR_AREA_SIZE_315 * 2;
XGIfb_CRT2_write_enable = IND_XGI_CRT2_WRITE_ENABLE_315;
break;
default:
--
1.5.6.5

2011-03-08 20:19:27

by Aaro Koskinen

[permalink] [raw]
Subject: [PATCH 09/15] staging: xgifb: vb_setmode: include the .h file

Include the file's .h file and delete the duplicate declarations from
the .c file.

Signed-off-by: Aaro Koskinen <[email protected]>
---
drivers/staging/xgifb/vb_setmode.c | 43 +-----------------------------------
1 files changed, 1 insertions(+), 42 deletions(-)

diff --git a/drivers/staging/xgifb/vb_setmode.c b/drivers/staging/xgifb/vb_setmode.c
index 0f37c80..5423524 100644
--- a/drivers/staging/xgifb/vb_setmode.c
+++ b/drivers/staging/xgifb/vb_setmode.c
@@ -11,7 +11,7 @@
#include "vb_struct.h"
#include "vb_util.h"
#include "vb_table.h"
-
+#include "vb_setmode.h"


#define IndexMask 0xff
@@ -21,23 +21,10 @@



-unsigned char XGI_SetCRT2Group301(unsigned short ModeNo,
- struct xgi_hw_device_info *HwDeviceExtension,
- struct vb_device_info *pVBInfo);
-
static unsigned char XGI_AjustCRT2Rate(unsigned short ModeNo,
unsigned short ModeIdIndex,
unsigned short RefreshRateTableIndex,
unsigned short *i, struct vb_device_info *pVBInfo);
-unsigned char XGI_SearchModeID(unsigned short ModeNo,
- unsigned short *ModeIdIndex,
- struct vb_device_info *pVBInfo);
-unsigned char XGI_GetLCDInfo(unsigned short ModeNo,
- unsigned short ModeIdIndex,
- struct vb_device_info *pVBInfo);
-unsigned char XGISetModeNew(struct xgi_hw_device_info *HwDeviceExtension,
- unsigned short ModeNo);
-unsigned char XGI_BridgeIsOn(struct vb_device_info *pVBInfo);
static unsigned char XGI_GetModePtr(unsigned short ModeNo,
unsigned short ModeIdIndex,
struct vb_device_info *pVBInfo);
@@ -46,13 +33,6 @@ static unsigned short XGI_GetOffset(unsigned short ModeNo,
unsigned short RefreshRateTableIndex,
struct xgi_hw_device_info *HwDeviceExtension,
struct vb_device_info *pVBInfo);
-unsigned short XGI_GetRatePtrCRT2(struct xgi_hw_device_info *pXGIHWDE,
- unsigned short ModeNo,
- unsigned short ModeIdIndex,
- struct vb_device_info *pVBInfo);
-unsigned short XGI_GetResInfo(unsigned short ModeNo,
- unsigned short ModeIdIndex,
- struct vb_device_info *pVBInfo);
static unsigned short XGI_GetColorDepth(unsigned short ModeNo,
unsigned short ModeIdIndex,
struct vb_device_info *pVBInfo);
@@ -79,15 +59,12 @@ static void *XGI_GetTVPtr(unsigned short BX, unsigned short ModeNo, unsigned sho
static void XGI_AutoThreshold(struct vb_device_info *pVBInfo);
static void XGI_SetTap4Regs(struct vb_device_info *pVBInfo);

-void XGI_DisplayOn(struct xgi_hw_device_info *, struct vb_device_info *pVBInfo);
-void XGI_DisplayOff(struct xgi_hw_device_info *, struct vb_device_info *pVBInfo);
static void XGI_SetCRT1Group(struct xgi_hw_device_info *HwDeviceExtension, unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo);
static void XGI_SetXG21CRTC(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo);
static void XGI_SetXG21LCD(struct vb_device_info *pVBInfo, unsigned short RefreshRateTableIndex, unsigned short ModeNo);
static void XGI_SetXG27CRTC(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo);
static void XGI_SetXG27LCD(struct vb_device_info *pVBInfo, unsigned short RefreshRateTableIndex, unsigned short ModeNo);
static void XGI_UpdateXG21CRTC(unsigned short ModeNo, struct vb_device_info *pVBInfo, unsigned short RefreshRateTableIndex);
-void XGI_SenseCRT1(struct vb_device_info *pVBInfo);
static void XGI_SetSeqRegs(unsigned short ModeNo, unsigned short StandTableIndex, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo);
static void XGI_SetMiscRegs(unsigned short StandTableIndex, struct vb_device_info *pVBInfo);
static void XGI_SetCRTCRegs(struct xgi_hw_device_info *HwDeviceExtension, unsigned short StandTableIndex, struct vb_device_info *pVBInfo);
@@ -112,22 +89,14 @@ static void XGI_SetLCDAGroup(unsigned short ModeNo, unsigned short ModeIdIndex,
static void XGI_GetLVDSResInfo(unsigned short ModeNo, unsigned short ModeIdIndex,
struct vb_device_info *pVBInfo);
static void XGI_GetLVDSData(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo);
-unsigned short XGI_GetLVDSOEMTableIndex(struct vb_device_info *pVBInfo);
static void XGI_ModCRT1Regs(unsigned short ModeNo, unsigned short ModeIdIndex,
unsigned short RefreshRateTableIndex,
struct xgi_hw_device_info *HwDeviceExtension,
struct vb_device_info *pVBInfo);
static void XGI_SetLVDSRegs(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo);
static void XGI_UpdateModeInfo(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo);
-void XGI_GetVGAType(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo);
-void XGI_GetVBType(struct vb_device_info *pVBInfo);
-void XGI_GetVBInfo(unsigned short ModeNo, unsigned short ModeIdIndex, struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo);
-void XGI_GetTVInfo(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo);
static void XGI_SetCRT2ECLK(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo);
-void InitTo330Pointer(unsigned char, struct vb_device_info *pVBInfo);
static void XGI_GetLCDSync(unsigned short *HSyncWidth, unsigned short *VSyncWidth, struct vb_device_info *pVBInfo);
-void XGI_DisableBridge(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo);
-void XGI_EnableBridge(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo);
static void XGI_SetCRT2VCLK(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo);
static void XGI_OEM310Setting(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo);
static void XGI_SetDelayComp(struct vb_device_info *pVBInfo);
@@ -141,13 +110,9 @@ static void XGI_SetPhaseIncr(struct vb_device_info *pVBInfo);
static void XGI_SetYFilter(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo);
static void XGI_GetTVPtrIndex2(unsigned short *tempbx, unsigned char* tempcl,
unsigned char *tempch, struct vb_device_info *pVBInfo);
-void XGI_SetCRT2ModeRegs(unsigned short ModeNo, struct xgi_hw_device_info *, struct vb_device_info *pVBInfo);
static void XGI_CloseCRTC(struct xgi_hw_device_info *, struct vb_device_info *pVBInfo);
static void XGI_GetRAMDAC2DATA(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo);
-void XGI_UnLockCRT2(struct xgi_hw_device_info *, struct vb_device_info *pVBInfo);
-void XGI_LockCRT2(struct xgi_hw_device_info *, struct vb_device_info *pVBInfo);
static void XGINew_EnableCRT2(struct vb_device_info *pVBInfo);
-void XGI_LongWait(struct vb_device_info *pVBInfo);
static void XGI_SetCRT1Offset(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo);
static void XGI_GetLCDVCLKPtr(unsigned char *di_0, unsigned char *di_1,
struct vb_device_info *pVBInfo);
@@ -160,14 +125,8 @@ static void XGI_GetVCLKLen(unsigned char tempal, unsigned char *di_0,
static unsigned short XGI_GetLCDCapPtr(struct vb_device_info *pVBInfo);
static unsigned short XGI_GetLCDCapPtr1(struct vb_device_info *pVBInfo);
static struct XGI301C_Tap4TimingStruct *XGI_GetTap4Ptr(unsigned short tempcx, struct vb_device_info *pVBInfo);
-void XGI_SetXG21FPBits(struct vb_device_info *pVBInfo);
-void XGI_SetXG27FPBits(struct vb_device_info *pVBInfo);
static unsigned char XGI_XG21GetPSCValue(struct vb_device_info *pVBInfo);
static unsigned char XGI_XG27GetPSCValue(struct vb_device_info *pVBInfo);
-void XGI_XG21BLSignalVDD(unsigned short tempbh, unsigned short tempbl, struct vb_device_info *pVBInfo);
-void XGI_XG27BLSignalVDD(unsigned short tempbh, unsigned short tempbl, struct vb_device_info *pVBInfo);
-void XGI_XG21SetPanelDelay(unsigned short tempbl, struct vb_device_info *pVBInfo);
-unsigned char XGI_XG21CheckLVDSMode(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo);
static void XGI_SetXG21LVDSPara(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo);
static void XGI_SetXG27LVDSPara(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo);
static unsigned char XGI_SetDefaultVCLK(struct vb_device_info *pVBInfo);
--
1.5.6.5

2011-03-08 20:19:46

by Aaro Koskinen

[permalink] [raw]
Subject: [PATCH 06/15] staging: xgifb: delete bIntegratedMMEnabled

bIntegratedMMEnabled is always true, so the field and checks can be
eliminated.

Signed-off-by: Aaro Koskinen <[email protected]>
---
drivers/staging/xgifb/XGI_main_26.c | 14 --------------
drivers/staging/xgifb/vb_init.c | 3 ---
drivers/staging/xgifb/vgatypes.h | 2 --
3 files changed, 0 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/xgifb/XGI_main_26.c b/drivers/staging/xgifb/XGI_main_26.c
index fa30a26..ce569af 100644
--- a/drivers/staging/xgifb/XGI_main_26.c
+++ b/drivers/staging/xgifb/XGI_main_26.c
@@ -2273,20 +2273,6 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
printk("XGIfb:chipid = %x\n", xgi_video_info.chip);
XGIhw_ext.jChipType = xgi_video_info.chip;

- switch (xgi_video_info.chip) {
- case XG40:
- case XG41:
- case XG42:
- case XG45:
- case XG20:
- case XG21:
- case XG27:
- XGIhw_ext.bIntegratedMMEnabled = 1;
- break;
- default:
- break;
- }
-
if ((xgi_video_info.chip == XG21) || (XGIfb_userom)) {
XGIhw_ext.pjVirtualRomBase = xgifb_copy_rom(pdev);
if (XGIhw_ext.pjVirtualRomBase)
diff --git a/drivers/staging/xgifb/vb_init.c b/drivers/staging/xgifb/vb_init.c
index e33259a..a16827e 100644
--- a/drivers/staging/xgifb/vb_init.c
+++ b/drivers/staging/xgifb/vb_init.c
@@ -152,9 +152,6 @@ unsigned char XGIInitNew(struct xgi_hw_device_info *HwDeviceExtension)
pVBInfo->ISXPDOS = 0;
printk("3");

- if (!HwDeviceExtension->bIntegratedMMEnabled)
- return 0; /* alan */
-
printk("4");

/* VBIOSVersion[4] = 0x0; */
diff --git a/drivers/staging/xgifb/vgatypes.h b/drivers/staging/xgifb/vgatypes.h
index c4624cc..4b87951 100644
--- a/drivers/staging/xgifb/vgatypes.h
+++ b/drivers/staging/xgifb/vgatypes.h
@@ -80,8 +80,6 @@ struct xgi_hw_device_info

unsigned long ulCRT2LCDType; /* defined in the data structure type */

- unsigned char bIntegratedMMEnabled;/* supporting integration MM enable */
-
unsigned char(*pQueryVGAConfigSpace)(struct xgi_hw_device_info *,
unsigned long, unsigned long,
unsigned long *);
--
1.5.6.5

2011-03-08 22:36:38

by Dan Carpenter

[permalink] [raw]
Subject: Re: [PATCH 06/15] staging: xgifb: delete bIntegratedMMEnabled

On Tue, Mar 08, 2011 at 10:16:11PM +0200, Aaro Koskinen wrote:
> bIntegratedMMEnabled is always true, so the field and checks can be
> eliminated.
>

What about for the chips that came before the XG40? Are we dropping
support for them?

regards,
dan carpenter

2011-03-09 08:22:52

by Aaro Koskinen

[permalink] [raw]
Subject: Re: [PATCH 06/15] staging: xgifb: delete bIntegratedMMEnabled

Hi,

On Wed, 9 Mar 2011, Dan Carpenter wrote:
> On Tue, Mar 08, 2011 at 10:16:11PM +0200, Aaro Koskinen wrote:
>> bIntegratedMMEnabled is always true, so the field and checks can be
>> eliminated.
>>
> What about for the chips that came before the XG40? Are we dropping
> support for them?

They were never supported. See the earlier switch (xgi_video_info.chip_id)
statement in the probe routine - it will return -ENODEV for other chips
than XG40..XG27.

A.

2011-03-09 11:09:20

by Dan Carpenter

[permalink] [raw]
Subject: Re: [PATCH 06/15] staging: xgifb: delete bIntegratedMMEnabled

On Wed, Mar 09, 2011 at 10:23:01AM +0200, Aaro Koskinen wrote:
> Hi,
>
> On Wed, 9 Mar 2011, Dan Carpenter wrote:
> >On Tue, Mar 08, 2011 at 10:16:11PM +0200, Aaro Koskinen wrote:
> >>bIntegratedMMEnabled is always true, so the field and checks can be
> >>eliminated.
> >>
> >What about for the chips that came before the XG40? Are we dropping
> >support for them?
>
> They were never supported. See the earlier switch (xgi_video_info.chip_id)
> statement in the probe routine - it will return -ENODEV for other chips
> than XG40..XG27.
>

Ah... That's true. This patch is fine by me then.

Reviewed-by: Dan Carpenter <[email protected]>

regards,
dan carpenter