Commit 3e779fc9 authored by Aaro Koskinen's avatar Aaro Koskinen Committed by Greg Kroah-Hartman

staging: xgifb: XGI_GetLcdPtr: add separate table for VB_SIS301LV/VB_SIS302LV

Add a separate data table for VB_SIS301LV/VB_SIS302LV to avoid branching
and to make further cleanups easier.
Signed-off-by: default avatarAaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f1426fd7
...@@ -1350,7 +1350,11 @@ static void *XGI_GetLcdPtr(unsigned short BX, unsigned short ModeNo, ...@@ -1350,7 +1350,11 @@ static void *XGI_GetLcdPtr(unsigned short BX, unsigned short ModeNo,
tempdi = XGI_LCDDataTable; tempdi = XGI_LCDDataTable;
break; break;
case 5: case 5:
tempdi = XGI_LCDDesDataTable; if ((pVBInfo->VBType & VB_SIS301LV) ||
(pVBInfo->VBType & VB_SIS302LV))
tempdi = xgifb_lcddldes;
else
tempdi = XGI_LCDDesDataTable;
break; break;
default: default:
break; break;
...@@ -1614,6 +1618,30 @@ static void *XGI_GetLcdPtr(unsigned short BX, unsigned short ModeNo, ...@@ -1614,6 +1618,30 @@ static void *XGI_GetLcdPtr(unsigned short BX, unsigned short ModeNo,
default: default:
break; break;
} }
} else if (table == 5 && ((pVBInfo->VBType & VB_SIS301LV) ||
(pVBInfo->VBType & VB_SIS302LV))) {
switch (tempdi[i].DATAPTR) {
case 0: return &XGI_ExtLCDDes1024x768Data[tempal];
case 1: return &XGI_StLCDDes1024x768Data[tempal];
case 2: return &XGI_CetLCDDes1024x768Data[tempal];
case 3: return &XGI_ExtLCDDLDes1280x1024Data[tempal];
case 4: return &XGI_StLCDDLDes1280x1024Data[tempal];
case 5: return &XGI_CetLCDDLDes1280x1024Data[tempal];
case 6:
case 7: return &xgifb_lcddldes_1400x1050[tempal];
case 8: return &XGI_CetLCDDes1400x1050Data[tempal];
case 9: return &XGI_CetLCDDes1400x1050Data2[tempal];
case 10: return &XGI_ExtLCDDLDes1600x1200Data[tempal];
case 11: return &XGI_StLCDDLDes1600x1200Data[tempal];
case 12: return &XGI_NoScalingDesData[tempal];
case 13:
case 14: return &xgifb_lcddes_1024x768x75[tempal];
case 15: return &XGI_CetLCDDes1024x768x75Data[tempal];
case 16:
case 17: return &xgifb_lcddldes_1280x1024x75[tempal];
case 18: return &XGI_CetLCDDLDes1280x1024x75Data[tempal];
case 19: return &XGI_NoScalingDesDatax75[tempal];
}
} else if (table == 5) { } else if (table == 5) {
switch (tempdi[i].DATAPTR) { switch (tempdi[i].DATAPTR) {
case 0: case 0:
...@@ -1626,33 +1654,17 @@ static void *XGI_GetLcdPtr(unsigned short BX, unsigned short ModeNo, ...@@ -1626,33 +1654,17 @@ static void *XGI_GetLcdPtr(unsigned short BX, unsigned short ModeNo,
return &XGI_CetLCDDes1024x768Data[tempal]; return &XGI_CetLCDDes1024x768Data[tempal];
break; break;
case 3: case 3:
if ((pVBInfo->VBType & VB_SIS301LV) || return &XGI_ExtLCDDes1280x1024Data[tempal];
(pVBInfo->VBType & VB_SIS302LV))
return &XGI_ExtLCDDLDes1280x1024Data[tempal];
else
return &XGI_ExtLCDDes1280x1024Data[tempal];
break; break;
case 4: case 4:
if ((pVBInfo->VBType & VB_SIS301LV) || return &XGI_StLCDDes1280x1024Data[tempal];
(pVBInfo->VBType & VB_SIS302LV))
return &XGI_StLCDDLDes1280x1024Data[tempal];
else
return &XGI_StLCDDes1280x1024Data[tempal];
break; break;
case 5: case 5:
if ((pVBInfo->VBType & VB_SIS301LV) || return &XGI_CetLCDDes1280x1024Data[tempal];
(pVBInfo->VBType & VB_SIS302LV))
return &XGI_CetLCDDLDes1280x1024Data[tempal];
else
return &XGI_CetLCDDes1280x1024Data[tempal];
break; break;
case 6: case 6:
case 7: case 7:
if ((pVBInfo->VBType & VB_SIS301LV) || return &xgifb_lcddes_1400x1050[tempal];
(pVBInfo->VBType & VB_SIS302LV))
return &xgifb_lcddldes_1400x1050[tempal];
else
return &xgifb_lcddes_1400x1050[tempal];
break; break;
case 8: case 8:
return &XGI_CetLCDDes1400x1050Data[tempal]; return &XGI_CetLCDDes1400x1050Data[tempal];
...@@ -1661,18 +1673,10 @@ static void *XGI_GetLcdPtr(unsigned short BX, unsigned short ModeNo, ...@@ -1661,18 +1673,10 @@ static void *XGI_GetLcdPtr(unsigned short BX, unsigned short ModeNo,
return &XGI_CetLCDDes1400x1050Data2[tempal]; return &XGI_CetLCDDes1400x1050Data2[tempal];
break; break;
case 10: case 10:
if ((pVBInfo->VBType & VB_SIS301LV) || return &XGI_ExtLCDDes1600x1200Data[tempal];
(pVBInfo->VBType & VB_SIS302LV))
return &XGI_ExtLCDDLDes1600x1200Data[tempal];
else
return &XGI_ExtLCDDes1600x1200Data[tempal];
break; break;
case 11: case 11:
if ((pVBInfo->VBType & VB_SIS301LV) || return &XGI_StLCDDes1600x1200Data[tempal];
(pVBInfo->VBType & VB_SIS302LV))
return &XGI_StLCDDLDes1600x1200Data[tempal];
else
return &XGI_StLCDDes1600x1200Data[tempal];
break; break;
case 12: case 12:
return &XGI_NoScalingDesData[tempal]; return &XGI_NoScalingDesData[tempal];
...@@ -1686,18 +1690,10 @@ static void *XGI_GetLcdPtr(unsigned short BX, unsigned short ModeNo, ...@@ -1686,18 +1690,10 @@ static void *XGI_GetLcdPtr(unsigned short BX, unsigned short ModeNo,
break; break;
case 16: case 16:
case 17: case 17:
if ((pVBInfo->VBType & VB_SIS301LV) || return &xgifb_lcddes_1280x1024x75[tempal];
(pVBInfo->VBType & VB_SIS302LV))
return &xgifb_lcddldes_1280x1024x75[tempal];
else
return &xgifb_lcddes_1280x1024x75[tempal];
break; break;
case 18: case 18:
if ((pVBInfo->VBType & VB_SIS301LV) || return &XGI_CetLCDDes1280x1024x75Data[tempal];
(pVBInfo->VBType & VB_SIS302LV))
return &XGI_CetLCDDLDes1280x1024x75Data[tempal];
else
return &XGI_CetLCDDes1280x1024x75Data[tempal];
break; break;
case 19: case 19:
return &XGI_NoScalingDesDatax75[tempal]; return &XGI_NoScalingDesDatax75[tempal];
......
...@@ -1804,6 +1804,30 @@ static struct XGI330_LCDDataTablStruct XGI_LCDDesDataTable[] = { ...@@ -1804,6 +1804,30 @@ static struct XGI330_LCDDataTablStruct XGI_LCDDesDataTable[] = {
{0xFF, 0x0000, 0x0000, 0} {0xFF, 0x0000, 0x0000, 0}
}; };
static struct XGI330_LCDDataTablStruct xgifb_lcddldes[] = {
{Panel_1024x768, 0x0019, 0x0001, 0}, /* XGI_ExtLCDDes1024x768Data */
{Panel_1024x768, 0x0019, 0x0000, 1}, /* XGI_StLCDDes1024x768Data */
{Panel_1024x768, 0x0018, 0x0010, 2}, /* XGI_CetLCDDes1024x768Data */
{Panel_1280x1024, 0x0019, 0x0001, 3}, /* XGI_ExtLCDDLDes1280x1024Data */
{Panel_1280x1024, 0x0019, 0x0000, 4}, /* XGI_StLCDDLDes1280x1024Data */
{Panel_1280x1024, 0x0018, 0x0010, 5}, /* XGI_CetLCDDLDes1280x1024Data */
{Panel_1400x1050, 0x0019, 0x0001, 6}, /* xgifb_lcddldes_1400x1050 */
{Panel_1400x1050, 0x0019, 0x0000, 7}, /* xgifb_lcddldes_1400x1050 */
{Panel_1400x1050, 0x0418, 0x0010, 8}, /* XGI_CetLCDDes1400x1050Data */
{Panel_1400x1050, 0x0418, 0x0410, 9}, /* XGI_CetLCDDes1400x1050Data2 */
{Panel_1600x1200, 0x0019, 0x0001, 10}, /* XGI_ExtLCDDLDes1600x1200Data */
{Panel_1600x1200, 0x0019, 0x0000, 11}, /* XGI_StLCDDes1600x1200Data */
{PanelRef60Hz, 0x0008, 0x0008, 12}, /* XGI_NoScalingDesData */
{Panel_1024x768x75, 0x0019, 0x0001, 13}, /* xgifb_lcddes_1024x768x75 */
{Panel_1024x768x75, 0x0019, 0x0000, 14}, /* xgifb_lcddes_1024x768x75 */
{Panel_1024x768x75, 0x0018, 0x0010, 15}, /* XGI_CetLCDDes1024x768x75Data */
{Panel_1280x1024x75, 0x0019, 0x0001, 16}, /* xgifb_lcddldes_1280x1024x75 */
{Panel_1280x1024x75, 0x0019, 0x0000, 17}, /* xgifb_lcddldes_1280x1024x75 */
{Panel_1280x1024x75, 0x0018, 0x0010, 18}, /* XGI_CetLCDDes1280x1024x75Data */
{PanelRef75Hz, 0x0008, 0x0008, 19}, /* XGI_NoScalingDesDatax75 */
{0xFF, 0x0000, 0x0000, 0}
};
static struct XGI330_LCDDataTablStruct xgifb_epllcd_crt1[] = { static struct XGI330_LCDDataTablStruct xgifb_epllcd_crt1[] = {
{Panel_1024x768, 0x0018, 0x0000, 0}, /* XGI_LVDSCRT11024x768_1 */ {Panel_1024x768, 0x0018, 0x0000, 0}, /* XGI_LVDSCRT11024x768_1 */
{Panel_1024x768, 0x0018, 0x0010, 1}, /* XGI_LVDSCRT11024x768_2 */ {Panel_1024x768, 0x0018, 0x0010, 1}, /* XGI_LVDSCRT11024x768_2 */
......
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