Staging: xgifb: fixed many style issue in vb_ext.c

This is a patch to the vb_ext.c file that fixes many style
issues found by the checkpatch.pl tool.
- extra spaces
- invalid code indent
- extra braces
- invalid comment style

Signed-off-by: Prashant P. Shah <pshah.mumbai@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Prashant P. Shah
2010-09-01 21:37:35 +05:30
committed by Greg Kroah-Hartman
parent 3dc3494ba2
commit 914a402dc5

View File

@@ -14,36 +14,31 @@ extern unsigned char XGI330_OutputSelect;
extern unsigned short XGI330_RGBSenseData2; extern unsigned short XGI330_RGBSenseData2;
extern unsigned short XGI330_YCSenseData2; extern unsigned short XGI330_YCSenseData2;
extern unsigned short XGI330_VideoSenseData2; extern unsigned short XGI330_VideoSenseData2;
void XGI_GetSenseStatus(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo); void XGI_GetSenseStatus(struct xgi_hw_device_info *HwDeviceExtension,
struct vb_device_info *pVBInfo);
unsigned char XGINew_GetPanelID(struct vb_device_info *pVBInfo); unsigned char XGINew_GetPanelID(struct vb_device_info *pVBInfo);
unsigned short XGINew_SenseLCD(struct xgi_hw_device_info *, unsigned short XGINew_SenseLCD(struct xgi_hw_device_info *,
struct vb_device_info *pVBInfo); struct vb_device_info *pVBInfo);
unsigned char XGINew_GetLCDDDCInfo(struct xgi_hw_device_info *HwDeviceExtension, unsigned char XGINew_GetLCDDDCInfo(
struct xgi_hw_device_info *HwDeviceExtension,
struct vb_device_info *pVBInfo); struct vb_device_info *pVBInfo);
void XGISetDPMS(struct xgi_hw_device_info *pXGIHWDE, void XGISetDPMS(struct xgi_hw_device_info *pXGIHWDE,
unsigned long VESA_POWER_STATE); unsigned long VESA_POWER_STATE);
unsigned char XGINew_BridgeIsEnable(struct xgi_hw_device_info *, struct vb_device_info *pVBInfo); unsigned char XGINew_BridgeIsEnable(struct xgi_hw_device_info *,
struct vb_device_info *pVBInfo);
unsigned char XGINew_Sense(unsigned short tempbx, unsigned short tempcx, unsigned char XGINew_Sense(unsigned short tempbx, unsigned short tempcx,
struct vb_device_info *pVBInfo); struct vb_device_info *pVBInfo);
unsigned char XGINew_SenseHiTV(struct xgi_hw_device_info *HwDeviceExtension, unsigned char XGINew_SenseHiTV(struct xgi_hw_device_info *HwDeviceExtension,
struct vb_device_info *pVBInfo); struct vb_device_info *pVBInfo);
/************************************************************** /**************************************************************
Dynamic Sense *********************** Dynamic Sense ************************
*************************************************************/ *************************************************************/
void XGI_WaitDisplay(void); void XGI_WaitDisplay(void);
unsigned char XGI_Is301C(struct vb_device_info *); unsigned char XGI_Is301C(struct vb_device_info *);
unsigned char XGI_Is301LV(struct vb_device_info *); unsigned char XGI_Is301LV(struct vb_device_info *);
/* --------------------------------------------------------------------- */
/* Function : XGINew_Is301B */
/* Input : */
/* Output : */
/* Description : */
/* --------------------------------------------------------------------- */
static unsigned char XGINew_Is301B(struct vb_device_info *pVBInfo) static unsigned char XGINew_Is301B(struct vb_device_info *pVBInfo)
{ {
unsigned short flag; unsigned short flag;
@@ -51,60 +46,34 @@ static unsigned char XGINew_Is301B(struct vb_device_info *pVBInfo)
flag = XGINew_GetReg1(pVBInfo->Part4Port, 0x01); flag = XGINew_GetReg1(pVBInfo->Part4Port, 0x01);
if (flag > 0x0B0) if (flag > 0x0B0)
return( 0 ) ; /* 301b */ return 0; /* 301b */
else else
return( 1 ) ; return 1;
} }
/* --------------------------------------------------------------------- */
/* Function : XGI_Is301C */
/* Input : */
/* Output : */
/* Description : */
/* --------------------------------------------------------------------- */
unsigned char XGI_Is301C(struct vb_device_info *pVBInfo) unsigned char XGI_Is301C(struct vb_device_info *pVBInfo)
{ {
if ((XGINew_GetReg1(pVBInfo->Part4Port, 0x01) & 0xF0) == 0xC0) if ((XGINew_GetReg1(pVBInfo->Part4Port, 0x01) & 0xF0) == 0xC0)
return( 1 ) ; return 1;
if ( XGINew_GetReg1( pVBInfo->Part4Port , 0x01 ) >= 0xD0 ) if (XGINew_GetReg1(pVBInfo->Part4Port, 0x01) >= 0xD0) {
{
if (XGINew_GetReg1(pVBInfo->Part4Port, 0x39) == 0xE0) if (XGINew_GetReg1(pVBInfo->Part4Port, 0x39) == 0xE0)
return( 1 ) ; return 1;
} }
return( 0 ) ; return 0;
} }
/* --------------------------------------------------------------------- */
/* Function : XGI_Is301LV */
/* Input : */
/* Output : */
/* Description : */
/* --------------------------------------------------------------------- */
unsigned char XGI_Is301LV(struct vb_device_info *pVBInfo) unsigned char XGI_Is301LV(struct vb_device_info *pVBInfo)
{ {
if ( XGINew_GetReg1( pVBInfo->Part4Port , 0x01 ) >= 0xD0 ) if (XGINew_GetReg1(pVBInfo->Part4Port, 0x01) >= 0xD0) {
{
if (XGINew_GetReg1(pVBInfo->Part4Port, 0x39) == 0xFF) if (XGINew_GetReg1(pVBInfo->Part4Port, 0x39) == 0xFF)
{ return 1;
return( 1 ) ;
} }
} return 0;
return( 0 ) ;
} }
unsigned char XGINew_Sense(unsigned short tempbx, unsigned short tempcx, struct vb_device_info *pVBInfo)
/* --------------------------------------------------------------------- */
/* Function : XGINew_Sense */
/* Input : */
/* Output : */
/* Description : */
/* --------------------------------------------------------------------- */
unsigned char XGINew_Sense(unsigned short tempbx,
unsigned short tempcx,
struct vb_device_info *pVBInfo)
{ {
unsigned short temp, i, tempch; unsigned short temp, i, tempch;
@@ -123,20 +92,12 @@ unsigned char XGINew_Sense(unsigned short tempbx,
temp &= tempch; temp &= tempch;
if (temp > 0) if (temp > 0)
return( 1 ) ; return 1;
else else
return( 0 ) ; return 0;
} }
void XGISetDPMS(struct xgi_hw_device_info *pXGIHWDE, unsigned long VESA_POWER_STATE)
/* --------------------------------------------------------------------- */
/* Function : XGISetDPMS */
/* Input : */
/* Output : */
/* Description : */
/* --------------------------------------------------------------------- */
void XGISetDPMS(struct xgi_hw_device_info *pXGIHWDE,
unsigned long VESA_POWER_STATE)
{ {
unsigned short ModeNo, ModeIdIndex; unsigned short ModeNo, ModeIdIndex;
unsigned char temp; unsigned char temp;
@@ -145,7 +106,6 @@ void XGISetDPMS(struct xgi_hw_device_info *pXGIHWDE,
pVBInfo->BaseAddr = (unsigned long) pXGIHWDE->pjIOAddress; pVBInfo->BaseAddr = (unsigned long) pXGIHWDE->pjIOAddress;
pVBInfo->ROMAddr = pXGIHWDE->pjVirtualRomBase; pVBInfo->ROMAddr = pXGIHWDE->pjVirtualRomBase;
pVBInfo->IF_DEF_LVDS = 0; pVBInfo->IF_DEF_LVDS = 0;
pVBInfo->IF_DEF_CH7005 = 0; pVBInfo->IF_DEF_CH7005 = 0;
pVBInfo->IF_DEF_HiVision = 1; pVBInfo->IF_DEF_HiVision = 1;
@@ -179,29 +139,23 @@ void XGISetDPMS(struct xgi_hw_device_info *pXGIHWDE,
pVBInfo->Part4Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_14; pVBInfo->Part4Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_14;
pVBInfo->Part5Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_14 + 2; pVBInfo->Part5Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_14 + 2;
if ( pXGIHWDE->jChipType == XG27 ) if (pXGIHWDE->jChipType == XG27) {
{ if ((XGINew_GetReg1(pVBInfo->P3d4, 0x38) & 0xE0) == 0xC0) {
if ( ( XGINew_GetReg1( pVBInfo->P3d4 , 0x38 ) & 0xE0 ) == 0xC0 )
{
if (XGINew_GetReg1(pVBInfo->P3d4, 0x30) & 0x20) if (XGINew_GetReg1(pVBInfo->P3d4, 0x30) & 0x20)
{
pVBInfo->IF_DEF_LVDS = 1; pVBInfo->IF_DEF_LVDS = 1;
} }
} }
}
if (pVBInfo->IF_DEF_CH7007 == 0) if (pVBInfo->IF_DEF_CH7007 == 0)
{
XGINew_SetModeScratch(pXGIHWDE, pVBInfo); XGINew_SetModeScratch(pXGIHWDE, pVBInfo);
}
XGINew_SetReg1(pVBInfo->P3c4, 0x05, 0x86); /* 1.Openkey */ XGINew_SetReg1(pVBInfo->P3c4, 0x05, 0x86); /* 1.Openkey */
XGI_UnLockCRT2(pXGIHWDE, pVBInfo); XGI_UnLockCRT2(pXGIHWDE, pVBInfo);
ModeNo = XGINew_GetReg1(pVBInfo->P3d4, 0x34); ModeNo = XGINew_GetReg1(pVBInfo->P3d4, 0x34);
XGI_SearchModeID(ModeNo, &ModeIdIndex, pVBInfo); XGI_SearchModeID(ModeNo, &ModeIdIndex, pVBInfo);
XGI_GetVGAType(pXGIHWDE, pVBInfo); XGI_GetVGAType(pXGIHWDE, pVBInfo);
if ( ( pXGIHWDE->ujVBChipID == VB_CHIP_301 ) || ( pXGIHWDE->ujVBChipID == VB_CHIP_302 ) || ( pVBInfo->IF_DEF_CH7007 == 1 )) if ((pXGIHWDE->ujVBChipID == VB_CHIP_301) || (pXGIHWDE->ujVBChipID == VB_CHIP_302) || (pVBInfo->IF_DEF_CH7007 == 1)) {
{
XGI_GetVBType(pVBInfo); XGI_GetVBType(pVBInfo);
XGI_GetVBInfo(ModeNo, ModeIdIndex, pXGIHWDE, pVBInfo); XGI_GetVBInfo(ModeNo, ModeIdIndex, pXGIHWDE, pVBInfo);
XGI_GetTVInfo(ModeNo, ModeIdIndex, pVBInfo); XGI_GetTVInfo(ModeNo, ModeIdIndex, pVBInfo);
@@ -215,28 +169,20 @@ void XGISetDPMS(struct xgi_hw_device_info *pXGIHWDE,
temp = (unsigned char) XGINew_GetReg1(pVBInfo->P3c4, 0x1f); temp = (unsigned char) XGINew_GetReg1(pVBInfo->P3c4, 0x1f);
temp &= 0x3f; temp &= 0x3f;
switch ( VESA_POWER_STATE ) switch (VESA_POWER_STATE) {
{
case 0x00000000: /* on */ case 0x00000000: /* on */
if ( ( pXGIHWDE->ujVBChipID == VB_CHIP_301 ) || ( pXGIHWDE->ujVBChipID == VB_CHIP_302 ) ) if ((pXGIHWDE->ujVBChipID == VB_CHIP_301) || (pXGIHWDE->ujVBChipID == VB_CHIP_302)) {
{
XGINew_SetReg1(pVBInfo->P3c4, 0x1f, (unsigned char) (temp | 0x00)); XGINew_SetReg1(pVBInfo->P3c4, 0x1f, (unsigned char) (temp | 0x00));
XGI_EnableBridge(pXGIHWDE, pVBInfo); XGI_EnableBridge(pXGIHWDE, pVBInfo);
} } else {
else if (pXGIHWDE->jChipType == XG21) {
{ if (pVBInfo->IF_DEF_LVDS == 1) {
if ( pXGIHWDE->jChipType == XG21 )
{
if ( pVBInfo->IF_DEF_LVDS == 1 )
{
XGI_XG21BLSignalVDD(0x01, 0x01, pVBInfo); /* LVDS VDD on */ XGI_XG21BLSignalVDD(0x01, 0x01, pVBInfo); /* LVDS VDD on */
XGI_XG21SetPanelDelay(2, pVBInfo); XGI_XG21SetPanelDelay(2, pVBInfo);
} }
} }
if ( pXGIHWDE->jChipType == XG27 ) if (pXGIHWDE->jChipType == XG27) {
{ if (pVBInfo->IF_DEF_LVDS == 1) {
if ( pVBInfo->IF_DEF_LVDS == 1 )
{
XGI_XG27BLSignalVDD(0x01, 0x01, pVBInfo); /* LVDS VDD on */ XGI_XG27BLSignalVDD(0x01, 0x01, pVBInfo); /* LVDS VDD on */
XGI_XG21SetPanelDelay(2, pVBInfo); XGI_XG21SetPanelDelay(2, pVBInfo);
} }
@@ -244,11 +190,9 @@ void XGISetDPMS(struct xgi_hw_device_info *pXGIHWDE,
XGINew_SetRegANDOR(pVBInfo->P3c4, 0x1F, ~0xC0, 0x00); XGINew_SetRegANDOR(pVBInfo->P3c4, 0x1F, ~0xC0, 0x00);
XGINew_SetRegAND(pVBInfo->P3c4, 0x01, ~0x20); /* CRT on */ XGINew_SetRegAND(pVBInfo->P3c4, 0x01, ~0x20); /* CRT on */
if ( pXGIHWDE->jChipType == XG21 ) if (pXGIHWDE->jChipType == XG21) {
{
temp = XGINew_GetReg1(pVBInfo->P3d4, 0x38); temp = XGINew_GetReg1(pVBInfo->P3d4, 0x38);
if ( temp & 0xE0 ) if (temp & 0xE0) {
{
XGINew_SetRegANDOR(pVBInfo->P3c4, 0x09, ~0x80, 0x80); /* DVO ON */ XGINew_SetRegANDOR(pVBInfo->P3c4, 0x09, ~0x80, 0x80); /* DVO ON */
XGI_SetXG21FPBits(pVBInfo); XGI_SetXG21FPBits(pVBInfo);
XGINew_SetRegAND(pVBInfo->P3d4, 0x4A, ~0x20); /* Enable write GPIOF */ XGINew_SetRegAND(pVBInfo->P3d4, 0x4A, ~0x20); /* Enable write GPIOF */
@@ -257,11 +201,9 @@ void XGISetDPMS(struct xgi_hw_device_info *pXGIHWDE,
XGI_XG21BLSignalVDD(0x20, 0x20, pVBInfo); /* LVDS signal on */ XGI_XG21BLSignalVDD(0x20, 0x20, pVBInfo); /* LVDS signal on */
XGI_DisplayOn(pXGIHWDE, pVBInfo); XGI_DisplayOn(pXGIHWDE, pVBInfo);
} }
if ( pXGIHWDE->jChipType == XG27 ) if (pXGIHWDE->jChipType == XG27) {
{
temp = XGINew_GetReg1(pVBInfo->P3d4, 0x38); temp = XGINew_GetReg1(pVBInfo->P3d4, 0x38);
if ( temp & 0xE0 ) if (temp & 0xE0) {
{
XGINew_SetRegANDOR(pVBInfo->P3c4, 0x09, ~0x80, 0x80); /* DVO ON */ XGINew_SetRegANDOR(pVBInfo->P3c4, 0x09, ~0x80, 0x80); /* DVO ON */
XGI_SetXG27FPBits(pVBInfo); XGI_SetXG27FPBits(pVBInfo);
XGINew_SetRegAND(pVBInfo->P3d4, 0x4A, ~0x20); /* Enable write GPIOF */ XGINew_SetRegAND(pVBInfo->P3d4, 0x4A, ~0x20); /* Enable write GPIOF */
@@ -272,72 +214,60 @@ void XGISetDPMS(struct xgi_hw_device_info *pXGIHWDE,
} }
} }
break; break;
case 0x00000100: /* standby */ case 0x00000100: /* standby */
if (pXGIHWDE->jChipType >= XG21) if (pXGIHWDE->jChipType >= XG21)
{
XGI_DisplayOff(pXGIHWDE, pVBInfo); XGI_DisplayOff(pXGIHWDE, pVBInfo);
}
XGINew_SetReg1(pVBInfo->P3c4, 0x1f, (unsigned char) (temp | 0x40)); XGINew_SetReg1(pVBInfo->P3c4, 0x1f, (unsigned char) (temp | 0x40));
break; break;
case 0x00000200: /* suspend */ case 0x00000200: /* suspend */
if ( pXGIHWDE->jChipType == XG21 ) if (pXGIHWDE->jChipType == XG21) {
{
XGI_DisplayOff(pXGIHWDE, pVBInfo); XGI_DisplayOff(pXGIHWDE, pVBInfo);
XGI_XG21BLSignalVDD(0x20, 0x00, pVBInfo); /* LVDS signal off */ XGI_XG21BLSignalVDD(0x20, 0x00, pVBInfo); /* LVDS signal off */
} }
if ( pXGIHWDE->jChipType == XG27 ) if (pXGIHWDE->jChipType == XG27) {
{
XGI_DisplayOff(pXGIHWDE, pVBInfo); XGI_DisplayOff(pXGIHWDE, pVBInfo);
XGI_XG27BLSignalVDD(0x20, 0x00, pVBInfo); /* LVDS signal off */ XGI_XG27BLSignalVDD(0x20, 0x00, pVBInfo); /* LVDS signal off */
} }
XGINew_SetReg1(pVBInfo->P3c4, 0x1f, (unsigned char) (temp | 0x80)); XGINew_SetReg1(pVBInfo->P3c4, 0x1f, (unsigned char) (temp | 0x80));
break; break;
case 0x00000400: /* off */ case 0x00000400: /* off */
if ( (pXGIHWDE->ujVBChipID == VB_CHIP_301 ) || ( pXGIHWDE->ujVBChipID == VB_CHIP_302 ) ) if ((pXGIHWDE->ujVBChipID == VB_CHIP_301) || (pXGIHWDE->ujVBChipID == VB_CHIP_302)) {
{
XGINew_SetReg1(pVBInfo->P3c4, 0x1f, (unsigned char) (temp | 0xc0)); XGINew_SetReg1(pVBInfo->P3c4, 0x1f, (unsigned char) (temp | 0xc0));
XGI_DisableBridge(pXGIHWDE, pVBInfo); XGI_DisableBridge(pXGIHWDE, pVBInfo);
} } else {
else if (pXGIHWDE->jChipType == XG21) {
{
if ( pXGIHWDE->jChipType == XG21 )
{
XGI_DisplayOff(pXGIHWDE, pVBInfo); XGI_DisplayOff(pXGIHWDE, pVBInfo);
XGI_XG21BLSignalVDD(0x20, 0x00, pVBInfo); /* LVDS signal off */ XGI_XG21BLSignalVDD(0x20, 0x00, pVBInfo); /* LVDS signal off */
temp = XGINew_GetReg1(pVBInfo->P3d4, 0x38); temp = XGINew_GetReg1(pVBInfo->P3d4, 0x38);
if ( temp & 0xE0 ) if (temp & 0xE0) {
{
XGINew_SetRegAND(pVBInfo->P3c4, 0x09, ~0x80); /* DVO Off */ XGINew_SetRegAND(pVBInfo->P3c4, 0x09, ~0x80); /* DVO Off */
XGINew_SetRegAND(pVBInfo->P3d4, 0x4A, ~0x20); /* Enable write GPIOF */ XGINew_SetRegAND(pVBInfo->P3d4, 0x4A, ~0x20); /* Enable write GPIOF */
/* XGINew_SetRegAND(pVBInfo->P3d4, 0x48, ~0x20); *//* LCD Display OFF */ /* XGINew_SetRegAND(pVBInfo->P3d4, 0x48, ~0x20); *//* LCD Display OFF */
} }
} }
if ( pXGIHWDE->jChipType == XG27 ) if (pXGIHWDE->jChipType == XG27) {
{
XGI_DisplayOff(pXGIHWDE, pVBInfo); XGI_DisplayOff(pXGIHWDE, pVBInfo);
XGI_XG27BLSignalVDD(0x20, 0x00, pVBInfo); /* LVDS signal off */ XGI_XG27BLSignalVDD(0x20, 0x00, pVBInfo); /* LVDS signal off */
temp = XGINew_GetReg1(pVBInfo->P3d4, 0x38); temp = XGINew_GetReg1(pVBInfo->P3d4, 0x38);
if (temp & 0xE0) if (temp & 0xE0)
{
XGINew_SetRegAND(pVBInfo->P3c4, 0x09, ~0x80); /* DVO Off */ XGINew_SetRegAND(pVBInfo->P3c4, 0x09, ~0x80); /* DVO Off */
} }
}
XGINew_SetRegANDOR(pVBInfo->P3c4, 0x1F, ~0xC0, 0xC0); XGINew_SetRegANDOR(pVBInfo->P3c4, 0x1F, ~0xC0, 0xC0);
XGINew_SetRegOR(pVBInfo->P3c4, 0x01, 0x20); /* CRT Off */ XGINew_SetRegOR(pVBInfo->P3c4, 0x01, 0x20); /* CRT Off */
if ( ( pXGIHWDE->jChipType == XG21 ) && ( pVBInfo->IF_DEF_LVDS == 1 ) ) if ((pXGIHWDE->jChipType == XG21) && (pVBInfo->IF_DEF_LVDS == 1)) {
{
XGI_XG21SetPanelDelay(4, pVBInfo); XGI_XG21SetPanelDelay(4, pVBInfo);
XGI_XG21BLSignalVDD(0x01, 0x00, pVBInfo); /* LVDS VDD off */ XGI_XG21BLSignalVDD(0x01, 0x00, pVBInfo); /* LVDS VDD off */
XGI_XG21SetPanelDelay(5, pVBInfo); XGI_XG21SetPanelDelay(5, pVBInfo);
} }
if ( ( pXGIHWDE->jChipType == XG27 ) && ( pVBInfo->IF_DEF_LVDS == 1 ) ) if ((pXGIHWDE->jChipType == XG27) && (pVBInfo->IF_DEF_LVDS == 1)) {
{
XGI_XG21SetPanelDelay(4, pVBInfo); XGI_XG21SetPanelDelay(4, pVBInfo);
XGI_XG27BLSignalVDD(0x01, 0x00, pVBInfo); /* LVDS VDD off */ XGI_XG27BLSignalVDD(0x01, 0x00, pVBInfo); /* LVDS VDD off */
XGI_XG21SetPanelDelay(5, pVBInfo); XGI_XG21SetPanelDelay(5, pVBInfo);
@@ -351,66 +281,43 @@ void XGISetDPMS(struct xgi_hw_device_info *pXGIHWDE,
XGI_LockCRT2(pXGIHWDE, pVBInfo); XGI_LockCRT2(pXGIHWDE, pVBInfo);
} }
/* --------------------------------------------------------------------- */
/* Function : XGI_GetSenseStatus */
/* Input : */
/* Output : */
/* Description : */
/* --------------------------------------------------------------------- */
void XGI_GetSenseStatus(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) void XGI_GetSenseStatus(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo)
{ {
unsigned short tempax = 0 , tempbx , tempcx , temp , unsigned short tempax = 0, tempbx, tempcx, temp, P2reg0 = 0, SenseModeNo = 0,
P2reg0 = 0 , SenseModeNo = 0 , OutputSelect = *pVBInfo->pOutputSelect , OutputSelect = *pVBInfo->pOutputSelect, ModeIdIndex, i;
ModeIdIndex , i ;
pVBInfo->BaseAddr = (unsigned long) HwDeviceExtension->pjIOAddress; pVBInfo->BaseAddr = (unsigned long) HwDeviceExtension->pjIOAddress;
if ( pVBInfo->IF_DEF_LVDS == 1 ) if (pVBInfo->IF_DEF_LVDS == 1) {
{
tempax = XGINew_GetReg1(pVBInfo->P3c4, 0x1A); /* ynlai 02/27/2002 */ tempax = XGINew_GetReg1(pVBInfo->P3c4, 0x1A); /* ynlai 02/27/2002 */
tempbx = XGINew_GetReg1(pVBInfo->P3c4, 0x1B); tempbx = XGINew_GetReg1(pVBInfo->P3c4, 0x1B);
tempax = ((tempax & 0xFE) >> 1) | (tempbx << 8); tempax = ((tempax & 0xFE) >> 1) | (tempbx << 8);
if ( tempax == 0x00 ) if (tempax == 0x00) { /* Get Panel id from DDC */
{ /* Get Panel id from DDC */
temp = XGINew_GetLCDDDCInfo(HwDeviceExtension, pVBInfo); temp = XGINew_GetLCDDDCInfo(HwDeviceExtension, pVBInfo);
if ( temp == 1 ) if (temp == 1) { /* LCD connect */
{ /* LCD connect */
XGINew_SetRegANDOR(pVBInfo->P3d4, 0x39, 0xFF, 0x01); /* set CR39 bit0="1" */ XGINew_SetRegANDOR(pVBInfo->P3d4, 0x39, 0xFF, 0x01); /* set CR39 bit0="1" */
XGINew_SetRegANDOR(pVBInfo->P3d4, 0x37, 0xEF, 0x00); /* clean CR37 bit4="0" */ XGINew_SetRegANDOR(pVBInfo->P3d4, 0x37, 0xEF, 0x00); /* clean CR37 bit4="0" */
temp = LCDSense; temp = LCDSense;
} } else { /* LCD don't connect */
else
{ /* LCD don't connect */
temp = 0; temp = 0;
} }
} } else {
else
{
XGINew_GetPanelID(pVBInfo); XGINew_GetPanelID(pVBInfo);
temp = LCDSense; temp = LCDSense;
} }
tempbx = ~(LCDSense | AVIDEOSense | SVIDEOSense); tempbx = ~(LCDSense | AVIDEOSense | SVIDEOSense);
XGINew_SetRegANDOR(pVBInfo->P3d4, 0x32, tempbx, temp); XGINew_SetRegANDOR(pVBInfo->P3d4, 0x32, tempbx, temp);
} } else { /* for 301 */
else if (pVBInfo->VBInfo & SetCRT2ToHiVisionTV) { /* for HiVision */
{ /* for 301 */
if ( pVBInfo->VBInfo & SetCRT2ToHiVisionTV )
{ /* for HiVision */
tempax = XGINew_GetReg1(pVBInfo->P3c4, 0x38); tempax = XGINew_GetReg1(pVBInfo->P3c4, 0x38);
temp = tempax & 0x01; temp = tempax & 0x01;
tempax = XGINew_GetReg1(pVBInfo->P3c4, 0x3A); tempax = XGINew_GetReg1(pVBInfo->P3c4, 0x3A);
temp = temp | (tempax & 0x02); temp = temp | (tempax & 0x02);
XGINew_SetRegANDOR(pVBInfo->P3d4, 0x32, 0xA0, temp); XGINew_SetRegANDOR(pVBInfo->P3d4, 0x32, 0xA0, temp);
} } else {
else if (XGI_BridgeIsOn(pVBInfo)) {
{
if ( XGI_BridgeIsOn( pVBInfo ) )
{
P2reg0 = XGINew_GetReg1(pVBInfo->Part2Port, 0x00); P2reg0 = XGINew_GetReg1(pVBInfo->Part2Port, 0x00);
if ( !XGINew_BridgeIsEnable( HwDeviceExtension, pVBInfo ) ) if (!XGINew_BridgeIsEnable(HwDeviceExtension, pVBInfo)) {
{
SenseModeNo = 0x2e; SenseModeNo = 0x2e;
/* XGINew_SetReg1(pVBInfo->P3d4, 0x30, 0x41); */ /* XGINew_SetReg1(pVBInfo->P3d4, 0x30, 0x41); */
/* XGISetModeNew(HwDeviceExtension, 0x2e); // ynlai InitMode */ /* XGISetModeNew(HwDeviceExtension, 0x2e); // ynlai InitMode */
@@ -429,109 +336,74 @@ void XGI_GetSenseStatus(struct xgi_hw_device_info *HwDeviceExtension, struct vb_
/* XGI_DisableBridge( HwDeviceExtension, pVBInfo ) ; */ /* XGI_DisableBridge( HwDeviceExtension, pVBInfo ) ; */
XGINew_SetRegANDOR(pVBInfo->P3c4, 0x01, 0xDF, 0x20); /* Display Off 0212 */ XGINew_SetRegANDOR(pVBInfo->P3c4, 0x01, 0xDF, 0x20); /* Display Off 0212 */
for (i = 0; i < 20; i++) for (i = 0; i < 20; i++)
{
XGI_LongWait(pVBInfo); XGI_LongWait(pVBInfo);
} }
}
XGINew_SetReg1(pVBInfo->Part2Port, 0x00, 0x1c); XGINew_SetReg1(pVBInfo->Part2Port, 0x00, 0x1c);
tempax = 0; tempax = 0;
tempbx = *pVBInfo->pRGBSenseData; tempbx = *pVBInfo->pRGBSenseData;
if (!(XGINew_Is301B(pVBInfo))) if (!(XGINew_Is301B(pVBInfo)))
{
tempbx = *pVBInfo->pRGBSenseData2; tempbx = *pVBInfo->pRGBSenseData2;
}
tempcx = 0x0E08; tempcx = 0x0E08;
if (XGINew_Sense(tempbx, tempcx, pVBInfo)) {
if (XGINew_Sense(tempbx, tempcx, pVBInfo)) if (XGINew_Sense(tempbx, tempcx, pVBInfo))
{
if ( XGINew_Sense(tempbx , tempcx, pVBInfo ) )
{
tempax |= Monitor2Sense; tempax |= Monitor2Sense;
} }
}
if (pVBInfo->VBType & VB_XGI301C) if (pVBInfo->VBType & VB_XGI301C)
{
XGINew_SetRegOR(pVBInfo->Part4Port, 0x0d, 0x04); XGINew_SetRegOR(pVBInfo->Part4Port, 0x0d, 0x04);
}
if ( XGINew_SenseHiTV( HwDeviceExtension , pVBInfo) ) /* add by kuku for Multi-adapter sense HiTV */ if (XGINew_SenseHiTV(HwDeviceExtension, pVBInfo)) { /* add by kuku for Multi-adapter sense HiTV */
{
tempax |= HiTVSense; tempax |= HiTVSense;
if ((pVBInfo->VBType & VB_XGI301C)) if ((pVBInfo->VBType & VB_XGI301C))
{
tempax ^= (HiTVSense | YPbPrSense); tempax ^= (HiTVSense | YPbPrSense);
} }
}
if ( !( tempax & ( HiTVSense | YPbPrSense ) ) ) /* start */ if (!(tempax & (HiTVSense | YPbPrSense))) { /* start */
{
tempbx = *pVBInfo->pYCSenseData; tempbx = *pVBInfo->pYCSenseData;
if (!(XGINew_Is301B(pVBInfo))) if (!(XGINew_Is301B(pVBInfo)))
{
tempbx = *pVBInfo->pYCSenseData2; tempbx = *pVBInfo->pYCSenseData2;
}
tempcx = 0x0604; tempcx = 0x0604;
if (XGINew_Sense(tempbx, tempcx, pVBInfo)) {
if (XGINew_Sense(tempbx, tempcx, pVBInfo)) if (XGINew_Sense(tempbx, tempcx, pVBInfo))
{
if ( XGINew_Sense(tempbx , tempcx, pVBInfo ) )
{
tempax |= SVIDEOSense; tempax |= SVIDEOSense;
} }
}
if ( OutputSelect & BoardTVType ) if (OutputSelect & BoardTVType) {
{
tempbx = *pVBInfo->pVideoSenseData; tempbx = *pVBInfo->pVideoSenseData;
if (!(XGINew_Is301B(pVBInfo))) if (!(XGINew_Is301B(pVBInfo)))
{
tempbx = *pVBInfo->pVideoSenseData2; tempbx = *pVBInfo->pVideoSenseData2;
}
tempcx = 0x0804; tempcx = 0x0804;
if (XGINew_Sense(tempbx, tempcx, pVBInfo)) {
if (XGINew_Sense(tempbx, tempcx, pVBInfo)) if (XGINew_Sense(tempbx, tempcx, pVBInfo))
{
if ( XGINew_Sense(tempbx , tempcx, pVBInfo ) )
{
tempax |= AVIDEOSense; tempax |= AVIDEOSense;
} }
} } else {
} if (!(tempax & SVIDEOSense)) {
else
{
if ( !( tempax & SVIDEOSense ) )
{
tempbx = *pVBInfo->pVideoSenseData; tempbx = *pVBInfo->pVideoSenseData;
if (!(XGINew_Is301B(pVBInfo))) if (!(XGINew_Is301B(pVBInfo)))
{
tempbx = *pVBInfo->pVideoSenseData2; tempbx = *pVBInfo->pVideoSenseData2;
}
tempcx = 0x0804; tempcx = 0x0804;
if (XGINew_Sense(tempbx, tempcx, pVBInfo)) {
if (XGINew_Sense(tempbx, tempcx, pVBInfo)) if (XGINew_Sense(tempbx, tempcx, pVBInfo))
{
if ( XGINew_Sense(tempbx , tempcx, pVBInfo ) )
{
tempax |= AVIDEOSense; tempax |= AVIDEOSense;
} }
} }
} }
} }
}
} /* end */ } /* end */
if ( !( tempax & Monitor2Sense ) ) if (!(tempax & Monitor2Sense)) {
{
if (XGINew_SenseLCD(HwDeviceExtension, pVBInfo)) if (XGINew_SenseLCD(HwDeviceExtension, pVBInfo))
{
tempax |= LCDSense; tempax |= LCDSense;
} }
}
tempbx = 0; tempbx = 0;
tempcx = 0; tempcx = 0;
XGINew_Sense(tempbx, tempcx, pVBInfo); XGINew_Sense(tempbx, tempcx, pVBInfo);
@@ -539,8 +411,7 @@ void XGI_GetSenseStatus(struct xgi_hw_device_info *HwDeviceExtension, struct vb_
XGINew_SetRegANDOR(pVBInfo->P3d4, 0x32, ~0xDF, tempax); XGINew_SetRegANDOR(pVBInfo->P3d4, 0x32, ~0xDF, tempax);
XGINew_SetReg1(pVBInfo->Part2Port, 0x00, P2reg0); XGINew_SetReg1(pVBInfo->Part2Port, 0x00, P2reg0);
if ( !( P2reg0 & 0x20 ) ) if (!(P2reg0 & 0x20)) {
{
pVBInfo->VBInfo = DisableCRT2Display; pVBInfo->VBInfo = DisableCRT2Display;
/* XGI_SetCRT2Group301(SenseModeNo, HwDeviceExtension, pVBInfo); */ /* XGI_SetCRT2Group301(SenseModeNo, HwDeviceExtension, pVBInfo); */
} }
@@ -550,16 +421,7 @@ void XGI_GetSenseStatus(struct xgi_hw_device_info *HwDeviceExtension, struct vb_
} }
unsigned short XGINew_SenseLCD(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo)
/* --------------------------------------------------------------------- */
/* Function : XGINew_SenseLCD */
/* Input : */
/* Output : */
/* Description : */
/* --------------------------------------------------------------------- */
unsigned short XGINew_SenseLCD(struct xgi_hw_device_info *HwDeviceExtension,
struct vb_device_info *pVBInfo)
{ {
/* unsigned short SoftSetting ; */ /* unsigned short SoftSetting ; */
unsigned short temp; unsigned short temp;
@@ -572,30 +434,19 @@ unsigned short XGINew_SenseLCD(struct xgi_hw_device_info *HwDeviceExtension,
if (!temp) if (!temp)
temp = XGINew_GetLCDDDCInfo(HwDeviceExtension, pVBInfo); temp = XGINew_GetLCDDDCInfo(HwDeviceExtension, pVBInfo);
return( temp ) ; return temp;
} }
/* --------------------------------------------------------------------- */
/* Function : XGINew_GetLCDDDCInfo */
/* Input : */
/* Output : */
/* Description : */
/* --------------------------------------------------------------------- */
unsigned char XGINew_GetLCDDDCInfo(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) unsigned char XGINew_GetLCDDDCInfo(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo)
{ {
unsigned short temp; unsigned short temp;
/* add lcd sense */ /* add lcd sense */
if ( HwDeviceExtension->ulCRT2LCDType == LCD_UNKNOWN ) if (HwDeviceExtension->ulCRT2LCDType == LCD_UNKNOWN) {
{ return 0;
return( 0 ) ; } else {
}
else
{
temp = (unsigned short) HwDeviceExtension->ulCRT2LCDType; temp = (unsigned short) HwDeviceExtension->ulCRT2LCDType;
switch( HwDeviceExtension->ulCRT2LCDType ) switch (HwDeviceExtension->ulCRT2LCDType) {
{
case LCD_INVALID: case LCD_INVALID:
case LCD_800x600: case LCD_800x600:
case LCD_1024x768: case LCD_1024x768:
@@ -624,36 +475,29 @@ unsigned char XGINew_GetLCDDDCInfo(struct xgi_hw_device_info *HwDeviceExtension,
break; break;
} }
XGINew_SetRegANDOR(pVBInfo->P3d4, 0x36, 0xF0, temp); XGINew_SetRegANDOR(pVBInfo->P3d4, 0x36, 0xF0, temp);
return( 1 ) ; return 1;
} }
} }
/* --------------------------------------------------------------------- */
/* Function : */
/* Input : */
/* Output : */
/* Description : */
/* --------------------------------------------------------------------- */
unsigned char XGINew_GetPanelID(struct vb_device_info *pVBInfo) unsigned char XGINew_GetPanelID(struct vb_device_info *pVBInfo)
{ {
unsigned short PanelTypeTable[16] = { unsigned short PanelTypeTable[16] = { SyncNN | PanelRGB18Bit
SyncNN | PanelRGB18Bit | Panel800x600 | _PanelType00, | Panel800x600 | _PanelType00, SyncNN | PanelRGB18Bit
SyncNN | PanelRGB18Bit | Panel1024x768 | _PanelType01, | Panel1024x768 | _PanelType01, SyncNN | PanelRGB18Bit
SyncNN | PanelRGB18Bit | Panel800x600 | _PanelType02, | Panel800x600 | _PanelType02, SyncNN | PanelRGB18Bit
SyncNN | PanelRGB18Bit | Panel640x480 | _PanelType03, | Panel640x480 | _PanelType03, SyncNN | PanelRGB18Bit
SyncNN | PanelRGB18Bit | Panel1024x768 | _PanelType04, | Panel1024x768 | _PanelType04, SyncNN | PanelRGB18Bit
SyncNN | PanelRGB18Bit | Panel1024x768 | _PanelType05, | Panel1024x768 | _PanelType05, SyncNN | PanelRGB18Bit
SyncNN | PanelRGB18Bit | Panel1024x768 | _PanelType06, | Panel1024x768 | _PanelType06, SyncNN | PanelRGB24Bit
SyncNN | PanelRGB24Bit | Panel1024x768 | _PanelType07, | Panel1024x768 | _PanelType07, SyncNN | PanelRGB18Bit
SyncNN | PanelRGB18Bit | Panel800x600 | _PanelType08, | Panel800x600 | _PanelType08, SyncNN | PanelRGB18Bit
SyncNN | PanelRGB18Bit | Panel1024x768 | _PanelType09, | Panel1024x768 | _PanelType09, SyncNN | PanelRGB18Bit
SyncNN | PanelRGB18Bit | Panel800x600 | _PanelType0A, | Panel800x600 | _PanelType0A, SyncNN | PanelRGB18Bit
SyncNN | PanelRGB18Bit | Panel1024x768 | _PanelType0B, | Panel1024x768 | _PanelType0B, SyncNN | PanelRGB18Bit
SyncNN | PanelRGB18Bit | Panel1024x768 | _PanelType0C, | Panel1024x768 | _PanelType0C, SyncNN | PanelRGB24Bit
SyncNN | PanelRGB24Bit | Panel1024x768 | _PanelType0D, | Panel1024x768 | _PanelType0D, SyncNN | PanelRGB18Bit
SyncNN | PanelRGB18Bit | Panel1024x768 | _PanelType0E, | Panel1024x768 | _PanelType0E, SyncNN | PanelRGB18Bit
SyncNN | PanelRGB18Bit | Panel1024x768 | _PanelType0F }; | Panel1024x768 | _PanelType0F };
unsigned short tempax, tempbx, temp; unsigned short tempax, tempbx, temp;
/* unsigned short return_flag; */ /* unsigned short return_flag; */
@@ -661,14 +505,11 @@ unsigned char XGINew_GetPanelID(struct vb_device_info *pVBInfo)
tempbx = tempax & 0x1E; tempbx = tempax & 0x1E;
if (tempax == 0) if (tempax == 0)
return( 0 ) ; return 0;
else else {
{
/* /*
if ( !( tempax & 0x10 ) ) if (!(tempax & 0x10)) {
{ if (pVBInfo->IF_DEF_LVDS == 1) {
if ( pVBInfo->IF_DEF_LVDS == 1 )
{
tempbx = 0; tempbx = 0;
temp = XGINew_GetReg1(pVBInfo->P3c4, 0x38); temp = XGINew_GetReg1(pVBInfo->P3c4, 0x38);
if (temp & 0x40) if (temp & 0x40)
@@ -681,9 +522,7 @@ unsigned char XGINew_GetPanelID(struct vb_device_info *pVBInfo)
temp = XGINew_GetReg1(pVBInfo->P3c4, 0x39); temp = XGINew_GetReg1(pVBInfo->P3c4, 0x39);
if (temp & 0x80) if (temp & 0x80)
tempbx |= 0x04; tempbx |= 0x04;
} } else {
else
{
return(0); return(0);
} }
} }
@@ -696,45 +535,28 @@ unsigned char XGINew_GetPanelID(struct vb_device_info *pVBInfo)
tempbx = PanelTypeTable[tempbx]; tempbx = PanelTypeTable[tempbx];
temp = (tempbx & 0xFF00) >> 8; temp = (tempbx & 0xFF00) >> 8;
XGINew_SetRegANDOR( pVBInfo->P3d4 , 0x37 , ~( LCDSyncBit | LCDRGB18Bit ) , temp ) ; XGINew_SetRegANDOR(pVBInfo->P3d4, 0x37, ~(LCDSyncBit
return( 1 ) ; | LCDRGB18Bit), temp);
return 1;
} }
} }
/* --------------------------------------------------------------------- */
/* Function : XGINew_BridgeIsEnable */
/* Input : */
/* Output : */
/* Description : */
/* --------------------------------------------------------------------- */
unsigned char XGINew_BridgeIsEnable(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) unsigned char XGINew_BridgeIsEnable(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo)
{ {
unsigned short flag; unsigned short flag;
if ( XGI_BridgeIsOn( pVBInfo ) == 0 ) if (XGI_BridgeIsOn(pVBInfo) == 0) {
{
flag = XGINew_GetReg1(pVBInfo->Part1Port, 0x0); flag = XGINew_GetReg1(pVBInfo->Part1Port, 0x0);
if (flag & 0x050) if (flag & 0x050)
{ return 1;
return( 1 ) ;
}
else else
{ return 0;
return( 0 ) ;
}
} }
return( 0 ) ; return 0;
} }
/* ------------------------------------------------------ */
/* Function : XGINew_SenseHiTV */
/* Input : */
/* Output : */
/* Description : */
/* ------------------------------------------------------ */
unsigned char XGINew_SenseHiTV(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) unsigned char XGINew_SenseHiTV(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo)
{ {
unsigned short tempbx, tempcx, temp, i, tempch; unsigned short tempbx, tempcx, temp, i, tempch;
@@ -758,7 +580,7 @@ unsigned char XGINew_SenseHiTV(struct xgi_hw_device_info *HwDeviceExtension, str
temp &= tempch; temp &= tempch;
if (temp != tempch) if (temp != tempch)
return( 0 ) ; return 0;
tempbx = *pVBInfo->pVideoSenseData2; tempbx = *pVBInfo->pVideoSenseData2;
@@ -777,10 +599,9 @@ unsigned char XGINew_SenseHiTV(struct xgi_hw_device_info *HwDeviceExtension, str
temp = temp ^ (0x0E); temp = temp ^ (0x0E);
temp &= tempch; temp &= tempch;
if ( temp != tempch ) if (temp != tempch) {
return( 0 ) ; return 0;
else } else {
{
tempbx = 0x3FF; tempbx = 0x3FF;
tempcx = 0x0804; tempcx = 0x0804;
temp = tempbx & 0xFF; temp = tempbx & 0xFF;
@@ -798,28 +619,23 @@ unsigned char XGINew_SenseHiTV(struct xgi_hw_device_info *HwDeviceExtension, str
temp &= tempch; temp &= tempch;
if (temp != tempch) if (temp != tempch)
return( 1 ) ; return 1;
else else
return( 0 ) ; return 0;
} }
} }
/* ----------------------------------------------------------------------------
* Description: Get Panel support
/* * O/P :
;----------------------------------------------------------------------------- * BL: Panel ID=81h for no scaler LVDS
; Description: Get Panel support * BH: Panel enhanced Mode Count
; O/P : * CX: Panel H. resolution
; BL: Panel ID=81h for no scaler LVDS * DX: PAnel V. resolution
; BH: Panel enhanced Mode Count * ----------------------------------------------------------------------------
; CX: Panel H. resolution
; DX: PAnel V. resolution
;-----------------------------------------------------------------------------
*/ */
static void XGI_XG21Fun14Sub70(struct vb_device_info *pVBInfo, static void XGI_XG21Fun14Sub70(struct vb_device_info *pVBInfo, PX86_REGS pBiosArguments)
PX86_REGS pBiosArguments)
{ {
unsigned short ModeIdIndex; unsigned short ModeIdIndex;
unsigned short ModeNo; unsigned short ModeNo;
@@ -833,35 +649,32 @@ static void XGI_XG21Fun14Sub70(struct vb_device_info *pVBInfo,
EModeCount = 0; EModeCount = 0;
pBiosArguments->x.ax = 0x0014; pBiosArguments->x.ax = 0x0014;
for( ModeIdIndex = 0 ; ; ModeIdIndex ++ ) for (ModeIdIndex = 0;; ModeIdIndex++) {
{
ModeNo = pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeID; ModeNo = pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeID;
if ( pVBInfo->EModeIDTable[ ModeIdIndex ].Ext_ModeID == 0xFF ) if (pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeID == 0xFF) {
{
pBiosArguments->h.bh = (unsigned char) EModeCount; pBiosArguments->h.bh = (unsigned char) EModeCount;
return; return;
} }
if (!XGI_XG21CheckLVDSMode(ModeNo, ModeIdIndex, pVBInfo)) if (!XGI_XG21CheckLVDSMode(ModeNo, ModeIdIndex, pVBInfo))
{
continue; continue;
}
EModeCount++; EModeCount++;
} }
} }
/*(
;----------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
; *
; Description: Get Panel mode ID for enhanced mode * Description: Get Panel mode ID for enhanced mode
; I/P : BH: EModeIndex ( which < Panel enhanced Mode Count ) * I/P : BH: EModeIndex ( which < Panel enhanced Mode Count )
; O/P : * O/P :
; BL: Mode ID * BL: Mode ID
; CX: H. resolution of the assigned by the index * CX: H. resolution of the assigned by the index
; DX: V. 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) static void XGI_XG21Fun14Sub71(struct vb_device_info *pVBInfo, PX86_REGS pBiosArguments)
{ {
unsigned short EModeCount; unsigned short EModeCount;
@@ -870,20 +683,16 @@ static void XGI_XG21Fun14Sub71(struct vb_device_info *pVBInfo,
unsigned short EModeIndex = pBiosArguments->h.bh; unsigned short EModeIndex = pBiosArguments->h.bh;
EModeCount = 0; EModeCount = 0;
for( ModeIdIndex = 0 ; ; ModeIdIndex ++ ) for (ModeIdIndex = 0;; ModeIdIndex++) {
{
ModeNo = pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeID; ModeNo = pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeID;
if ( pVBInfo->EModeIDTable[ ModeIdIndex ].Ext_ModeID == 0xFF ) if (pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeID == 0xFF) {
{
pBiosArguments->x.ax = 0x0114; pBiosArguments->x.ax = 0x0114;
return; return;
} }
if (!XGI_XG21CheckLVDSMode(ModeNo, ModeIdIndex, pVBInfo)) if (!XGI_XG21CheckLVDSMode(ModeNo, ModeIdIndex, pVBInfo))
{
continue; continue;
}
if (EModeCount == EModeIndex) if (EModeCount == EModeIndex) {
{
resindex = XGI_GetResInfo(ModeNo, ModeIdIndex, pVBInfo); resindex = XGI_GetResInfo(ModeNo, ModeIdIndex, pVBInfo);
pBiosArguments->h.bl = (unsigned char) ModeNo; pBiosArguments->h.bl = (unsigned char) ModeNo;
pBiosArguments->x.cx = pVBInfo->ModeResInfo[resindex].HTotal; /* xres->ax */ pBiosArguments->x.cx = pVBInfo->ModeResInfo[resindex].HTotal; /* xres->ax */
@@ -895,42 +704,36 @@ static void XGI_XG21Fun14Sub71(struct vb_device_info *pVBInfo,
} }
} }
/*
;----------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
; *
; Description: Validate Panel modes ID support * Description: Validate Panel modes ID support
; I/P : * I/P :
; BL: ModeID * BL: ModeID
; O/P : * O/P :
; CX: H. resolution of the assigned by the index * CX: H. resolution of the assigned by the index
; DX: V. 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, static void XGI_XG21Fun14Sub72(struct vb_device_info *pVBInfo, PX86_REGS pBiosArguments)
PX86_REGS pBiosArguments)
{ {
unsigned short ModeIdIndex, resindex; unsigned short ModeIdIndex, resindex;
unsigned short ModeNo; unsigned short ModeNo;
ModeNo = pBiosArguments->h.bl; ModeNo = pBiosArguments->h.bl;
XGI_SearchModeID(ModeNo, &ModeIdIndex, pVBInfo); XGI_SearchModeID(ModeNo, &ModeIdIndex, pVBInfo);
if ( !XGI_XG21CheckLVDSMode( ModeNo , ModeIdIndex, pVBInfo) ) if (!XGI_XG21CheckLVDSMode(ModeNo, ModeIdIndex, pVBInfo)) {
{
pBiosArguments->x.cx = 0; pBiosArguments->x.cx = 0;
pBiosArguments->x.dx = 0; pBiosArguments->x.dx = 0;
pBiosArguments->x.ax = 0x0114; pBiosArguments->x.ax = 0x0114;
return; return;
} }
resindex = XGI_GetResInfo(ModeNo, ModeIdIndex, pVBInfo); resindex = XGI_GetResInfo(ModeNo, ModeIdIndex, pVBInfo);
if ( ModeNo <= 0x13 ) if (ModeNo <= 0x13) {
{
pBiosArguments->x.cx = pVBInfo->StResInfo[resindex].HTotal; pBiosArguments->x.cx = pVBInfo->StResInfo[resindex].HTotal;
pBiosArguments->x.dx = pVBInfo->StResInfo[resindex].VTotal; pBiosArguments->x.dx = pVBInfo->StResInfo[resindex].VTotal;
} } else {
else
{
pBiosArguments->x.cx = pVBInfo->ModeResInfo[resindex].HTotal; /* xres->ax */ pBiosArguments->x.cx = pVBInfo->ModeResInfo[resindex].HTotal; /* xres->ax */
pBiosArguments->x.dx = pVBInfo->ModeResInfo[resindex].VTotal; /* yres->bx */ pBiosArguments->x.dx = pVBInfo->ModeResInfo[resindex].VTotal; /* yres->bx */
} }
@@ -939,36 +742,35 @@ static void XGI_XG21Fun14Sub72(struct vb_device_info *pVBInfo,
} }
/* /* ----------------------------------------------------------------------------
;----------------------------------------------------------------------------- *
; Description: Get Customized Panel misc. information support * Description: Get Customized Panel misc. information support
; I/P : Select * I/P : Select
; to get panel horizontal timing * to get panel horizontal timing
; to get panel vertical timing * to get panel vertical timing
; to get channel clock parameter * to get channel clock parameter
; to get panel misc information * to get panel misc information
; *
; O/P : * O/P :
; BL: for input Select = 0 ; * BL: for input Select = 0 ;
; BX: *Value1 = Horizontal total * BX: *Value1 = Horizontal total
; CX: *Value2 = Horizontal front porch * CX: *Value2 = Horizontal front porch
; DX: *Value2 = Horizontal sync width * DX: *Value2 = Horizontal sync width
; BL: for input Select = 1 ; * BL: for input Select = 1 ;
; BX: *Value1 = Vertical total * BX: *Value1 = Vertical total
; CX: *Value2 = Vertical front porch * CX: *Value2 = Vertical front porch
; DX: *Value2 = Vertical sync width * DX: *Value2 = Vertical sync width
; BL: for input Select = 2 ; * BL: for input Select = 2 ;
; BX: Value1 = The first CLK parameter * BX: Value1 = The first CLK parameter
; CX: Value2 = The second CLK parameter * CX: Value2 = The second CLK parameter
; BL: for input Select = 4 ; * BL: for input Select = 4 ;
; BX[15]: *Value1 D[15] VESA V. Polarity * BX[15]: *Value1 D[15] VESA V. Polarity
; BX[14]: *Value1 D[14] VESA H. Polarity * BX[14]: *Value1 D[14] VESA H. Polarity
; BX[7]: *Value1 D[7] Panel V. Polarity * BX[7]: *Value1 D[7] Panel V. Polarity
; BX[6]: *Value1 D[6] Panel H. Polarity * BX[6]: *Value1 D[6] Panel H. Polarity
;----------------------------------------------------------------------------- * ----------------------------------------------------------------------------
*/ */
static void XGI_XG21Fun14Sub73(struct vb_device_info *pVBInfo, static void XGI_XG21Fun14Sub73(struct vb_device_info *pVBInfo, PX86_REGS pBiosArguments)
PX86_REGS pBiosArguments)
{ {
unsigned char Select; unsigned char Select;
@@ -977,8 +779,7 @@ static void XGI_XG21Fun14Sub73(struct vb_device_info *pVBInfo,
lvdstableindex = XGI_GetLVDSOEMTableIndex(pVBInfo); lvdstableindex = XGI_GetLVDSOEMTableIndex(pVBInfo);
Select = pBiosArguments->h.bl; Select = pBiosArguments->h.bl;
switch (Select) switch (Select) {
{
case 0: case 0:
pBiosArguments->x.bx = pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDSHT; pBiosArguments->x.bx = pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDSHT;
pBiosArguments->x.cx = pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDSHFP; pBiosArguments->x.cx = pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDSHFP;
@@ -1001,7 +802,6 @@ static void XGI_XG21Fun14Sub73(struct vb_device_info *pVBInfo,
pBiosArguments->x.ax = 0x0014; pBiosArguments->x.ax = 0x0014;
} }
void XGI_XG21Fun14(struct xgi_hw_device_info *pXGIHWDE, PX86_REGS pBiosArguments) void XGI_XG21Fun14(struct xgi_hw_device_info *pXGIHWDE, PX86_REGS pBiosArguments)
{ {
struct vb_device_info VBINF; struct vb_device_info VBINF;
@@ -1040,8 +840,7 @@ void XGI_XG21Fun14(struct xgi_hw_device_info *pXGIHWDE, PX86_REGS pBiosArguments
pVBInfo->Part4Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_14; pVBInfo->Part4Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_14;
pVBInfo->Part5Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_14 + 2; pVBInfo->Part5Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_14 + 2;
switch(pBiosArguments->x.ax) switch (pBiosArguments->x.ax) {
{
case 0x1470: case 0x1470:
XGI_XG21Fun14Sub70(pVBInfo, pBiosArguments); XGI_XG21Fun14Sub70(pVBInfo, pBiosArguments);
break; break;