Commit 4736783c authored by Aaro Koskinen's avatar Aaro Koskinen Committed by Greg Kroah-Hartman

staging: xgifb: XGI_GetLcdPtr: use real pointers for data tables

Use real pointers for LCD data tables to simplify the code.
Signed-off-by: default avatarAaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 515e9a60
......@@ -1310,7 +1310,7 @@ static void *XGI_GetLcdPtr(unsigned short BX, unsigned short ModeNo,
unsigned short RefreshRateTableIndex,
struct vb_device_info *pVBInfo)
{
unsigned short i, tempdx, tempbx, tempal, modeflag, table;
unsigned short i, tempdx, tempbx, tempal, modeflag;
struct XGI330_LCDDataTablStruct *tempdi = NULL;
......@@ -1365,7 +1365,6 @@ static void *XGI_GetLcdPtr(unsigned short BX, unsigned short ModeNo,
if (tempdi == NULL) /* OEMUtil */
return NULL;
table = tempbx;
i = 0;
while (tempdi[i].PANELID != 0xff) {
......@@ -1392,319 +1391,7 @@ static void *XGI_GetLcdPtr(unsigned short BX, unsigned short ModeNo,
i++;
}
if (table == 0) {
switch (tempdi[i].DATAPTR) {
case 0:
return &XGI_LVDSCRT11024x768_1_H[tempal];
break;
case 1:
return &XGI_LVDSCRT11024x768_2_H[tempal];
break;
case 2:
return &XGI_LVDSCRT11280x1024_1_H[tempal];
break;
case 3:
return &XGI_LVDSCRT11280x1024_2_H[tempal];
break;
case 4:
return &XGI_LVDSCRT11400x1050_1_H[tempal];
break;
case 5:
return &XGI_LVDSCRT11400x1050_2_H[tempal];
break;
case 6:
return &XGI_LVDSCRT11600x1200_1_H[tempal];
break;
case 7:
return &XGI_LVDSCRT11024x768_1_Hx75[tempal];
break;
case 8:
return &XGI_LVDSCRT11024x768_2_Hx75[tempal];
break;
case 9:
return &XGI_LVDSCRT11280x1024_1_Hx75[tempal];
break;
case 10:
return &XGI_LVDSCRT11280x1024_2_Hx75[tempal];
break;
default:
break;
}
} else if (table == 1) {
switch (tempdi[i].DATAPTR) {
case 0:
return &XGI_LVDSCRT11024x768_1_V[tempal];
break;
case 1:
return &XGI_LVDSCRT11024x768_2_V[tempal];
break;
case 2:
return &XGI_LVDSCRT11280x1024_1_V[tempal];
break;
case 3:
return &XGI_LVDSCRT11280x1024_2_V[tempal];
break;
case 4:
return &XGI_LVDSCRT11400x1050_1_V[tempal];
break;
case 5:
return &XGI_LVDSCRT11400x1050_2_V[tempal];
break;
case 6:
return &XGI_LVDSCRT11600x1200_1_V[tempal];
break;
case 7:
return &XGI_LVDSCRT11024x768_1_Vx75[tempal];
break;
case 8:
return &XGI_LVDSCRT11024x768_2_Vx75[tempal];
break;
case 9:
return &XGI_LVDSCRT11280x1024_1_Vx75[tempal];
break;
case 10:
return &XGI_LVDSCRT11280x1024_2_Vx75[tempal];
break;
default:
break;
}
} else if (table == 2) {
switch (tempdi[i].DATAPTR) {
case 0:
return &XGI_LVDS1024x768Data_1[tempal];
break;
case 1:
return &XGI_LVDS1024x768Data_2[tempal];
break;
case 2:
return &XGI_LVDS1280x1024Data_1[tempal];
break;
case 3:
return &XGI_LVDS1280x1024Data_2[tempal];
break;
case 4:
return &XGI_LVDS1400x1050Data_1[tempal];
break;
case 5:
return &XGI_LVDS1400x1050Data_2[tempal];
break;
case 6:
return &XGI_LVDS1600x1200Data_1[tempal];
break;
case 7:
return &XGI_LVDSNoScalingData[tempal];
break;
case 8:
return &XGI_LVDS1024x768Data_1x75[tempal];
break;
case 9:
return &XGI_LVDS1024x768Data_2x75[tempal];
break;
case 10:
return &XGI_LVDS1280x1024Data_1x75[tempal];
break;
case 11:
return &XGI_LVDS1280x1024Data_2x75[tempal];
break;
case 12:
return &XGI_LVDSNoScalingDatax75[tempal];
break;
default:
break;
}
} else if (table == 3) {
switch (tempdi[i].DATAPTR) {
case 0:
return &XGI_LVDS1024x768Des_1[tempal];
break;
case 1:
return &XGI_LVDS1024x768Des_3[tempal];
break;
case 2:
return &XGI_LVDS1024x768Des_2[tempal];
break;
case 3:
return &XGI_LVDS1280x1024Des_1[tempal];
break;
case 4:
return &XGI_LVDS1280x1024Des_2[tempal];
break;
case 5:
return &XGI_LVDS1400x1050Des_1[tempal];
break;
case 6:
return &XGI_LVDS1400x1050Des_2[tempal];
break;
case 7:
return &XGI_LVDS1600x1200Des_1[tempal];
break;
case 8:
return &XGI_LVDSNoScalingDesData[tempal];
break;
case 9:
return &XGI_LVDS1024x768Des_1x75[tempal];
break;
case 10:
return &XGI_LVDS1024x768Des_3x75[tempal];
break;
case 11:
return &XGI_LVDS1024x768Des_2x75[tempal];
break;
case 12:
return &XGI_LVDS1280x1024Des_1x75[tempal];
break;
case 13:
return &XGI_LVDS1280x1024Des_2x75[tempal];
break;
case 14:
return &XGI_LVDSNoScalingDesDatax75[tempal];
break;
default:
break;
}
} else if (table == 4) {
switch (tempdi[i].DATAPTR) {
case 0:
return &XGI_ExtLCD1024x768Data[tempal];
break;
case 1:
return &XGI_StLCD1024x768Data[tempal];
break;
case 2:
return &XGI_CetLCD1024x768Data[tempal];
break;
case 3:
return &XGI_ExtLCD1280x1024Data[tempal];
break;
case 4:
return &XGI_StLCD1280x1024Data[tempal];
break;
case 5:
return &XGI_CetLCD1280x1024Data[tempal];
break;
case 6:
case 7:
return &xgifb_lcd_1400x1050[tempal];
break;
case 8:
return &XGI_CetLCD1400x1050Data[tempal];
break;
case 9:
return &XGI_ExtLCD1600x1200Data[tempal];
break;
case 10:
return &XGI_StLCD1600x1200Data[tempal];
break;
case 11:
return &XGI_NoScalingData[tempal];
break;
case 12:
return &XGI_ExtLCD1024x768x75Data[tempal];
break;
case 13:
return &XGI_ExtLCD1024x768x75Data[tempal];
break;
case 14:
return &XGI_CetLCD1024x768x75Data[tempal];
break;
case 15:
case 16:
return &xgifb_lcd_1280x1024x75[tempal];
break;
case 17:
return &XGI_CetLCD1280x1024x75Data[tempal];
break;
case 18:
return &XGI_NoScalingDatax75[tempal];
break;
default:
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) {
switch (tempdi[i].DATAPTR) {
case 0:
return &XGI_ExtLCDDes1024x768Data[tempal];
break;
case 1:
return &XGI_StLCDDes1024x768Data[tempal];
break;
case 2:
return &XGI_CetLCDDes1024x768Data[tempal];
break;
case 3:
return &XGI_ExtLCDDes1280x1024Data[tempal];
break;
case 4:
return &XGI_StLCDDes1280x1024Data[tempal];
break;
case 5:
return &XGI_CetLCDDes1280x1024Data[tempal];
break;
case 6:
case 7:
return &xgifb_lcddes_1400x1050[tempal];
break;
case 8:
return &XGI_CetLCDDes1400x1050Data[tempal];
break;
case 9:
return &XGI_CetLCDDes1400x1050Data2[tempal];
break;
case 10:
return &XGI_ExtLCDDes1600x1200Data[tempal];
break;
case 11:
return &XGI_StLCDDes1600x1200Data[tempal];
break;
case 12:
return &XGI_NoScalingDesData[tempal];
break;
case 13:
case 14:
return &xgifb_lcddes_1024x768x75[tempal];
break;
case 15:
return &XGI_CetLCDDes1024x768x75Data[tempal];
break;
case 16:
case 17:
return &xgifb_lcddes_1280x1024x75[tempal];
break;
case 18:
return &XGI_CetLCDDes1280x1024x75Data[tempal];
break;
case 19:
return &XGI_NoScalingDesDatax75[tempal];
break;
default:
break;
}
}
return NULL;
return tempdi[i].DATAPTR;
}
static struct SiS_TVData const *XGI_GetTVPtr(unsigned short ModeNo,
......
......@@ -56,7 +56,7 @@ struct XGI330_LCDDataTablStruct {
unsigned char PANELID;
unsigned short MASK;
unsigned short CAP;
unsigned short DATAPTR;
void *DATAPTR;
};
struct XGI330_TVDataTablStruct {
......
This diff is collapsed.
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