Commit 6008f877 authored by Aaro Koskinen's avatar Aaro Koskinen Committed by Greg Kroah-Hartman

staging: xgifb: refactor XGI_GetLVDSData()

Refactor XGI_GetLVDSData() to avoid nesting and redundant ifs.
Signed-off-by: default avatarAaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent bdb381ec
...@@ -1380,27 +1380,27 @@ static void XGI_GetLVDSData(unsigned short ModeNo, unsigned short ModeIdIndex, ...@@ -1380,27 +1380,27 @@ static void XGI_GetLVDSData(unsigned short ModeNo, unsigned short ModeIdIndex,
unsigned short RefreshRateTableIndex, unsigned short RefreshRateTableIndex,
struct vb_device_info *pVBInfo) struct vb_device_info *pVBInfo)
{ {
struct SiS_LVDSData const *LCDPtr = NULL; struct SiS_LVDSData const *LCDPtr;
if (!(pVBInfo->VBInfo & (SetCRT2ToLCD | XGI_SetCRT2ToLCDA)))
return;
if (pVBInfo->VBInfo & (SetCRT2ToLCD | XGI_SetCRT2ToLCDA)) {
LCDPtr = XGI_GetLcdPtr(XGI_EPLLCDDataPtr, ModeNo, ModeIdIndex, LCDPtr = XGI_GetLcdPtr(XGI_EPLLCDDataPtr, ModeNo, ModeIdIndex,
RefreshRateTableIndex, pVBInfo); RefreshRateTableIndex, pVBInfo);
pVBInfo->VGAHT = LCDPtr->VGAHT; pVBInfo->VGAHT = LCDPtr->VGAHT;
pVBInfo->VGAVT = LCDPtr->VGAVT; pVBInfo->VGAVT = LCDPtr->VGAVT;
pVBInfo->HT = LCDPtr->LCDHT; pVBInfo->HT = LCDPtr->LCDHT;
pVBInfo->VT = LCDPtr->LCDVT; pVBInfo->VT = LCDPtr->LCDVT;
}
if (pVBInfo->VBInfo & (SetCRT2ToLCD | XGI_SetCRT2ToLCDA)) { if (pVBInfo->LCDInfo & (SetLCDtoNonExpanding | EnableScalingLCD))
if (!(pVBInfo->LCDInfo & (SetLCDtoNonExpanding return;
| EnableScalingLCD))) {
if ((pVBInfo->LCDResInfo == Panel_1024x768) || if ((pVBInfo->LCDResInfo == Panel_1024x768) ||
(pVBInfo->LCDResInfo == Panel_1024x768x75)) { (pVBInfo->LCDResInfo == Panel_1024x768x75)) {
pVBInfo->HDE = 1024; pVBInfo->HDE = 1024;
pVBInfo->VDE = 768; pVBInfo->VDE = 768;
} else if ((pVBInfo->LCDResInfo == Panel_1280x1024) || } else if ((pVBInfo->LCDResInfo == Panel_1280x1024) ||
(pVBInfo->LCDResInfo == (pVBInfo->LCDResInfo == Panel_1280x1024x75)) {
Panel_1280x1024x75)) {
pVBInfo->HDE = 1280; pVBInfo->HDE = 1280;
pVBInfo->VDE = 1024; pVBInfo->VDE = 1024;
} else if (pVBInfo->LCDResInfo == Panel_1400x1050) { } else if (pVBInfo->LCDResInfo == Panel_1400x1050) {
...@@ -1410,8 +1410,6 @@ static void XGI_GetLVDSData(unsigned short ModeNo, unsigned short ModeIdIndex, ...@@ -1410,8 +1410,6 @@ static void XGI_GetLVDSData(unsigned short ModeNo, unsigned short ModeIdIndex,
pVBInfo->HDE = 1600; pVBInfo->HDE = 1600;
pVBInfo->VDE = 1200; pVBInfo->VDE = 1200;
} }
}
}
} }
static void XGI_ModCRT1Regs(unsigned short ModeNo, unsigned short ModeIdIndex, static void XGI_ModCRT1Regs(unsigned short ModeNo, unsigned short ModeIdIndex,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment