Commit 6154e7f4 authored by Aaro Koskinen's avatar Aaro Koskinen Committed by Greg Kroah-Hartman

staging: xgifb: eliminate global TimingV/TimingH data

Use private data instead of global variables for timing data. Also,
get rid of the single element arrays.
Signed-off-by: default avatarAaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6008f877
...@@ -54,8 +54,6 @@ void InitTo330Pointer(unsigned char ChipType, struct vb_device_info *pVBInfo) ...@@ -54,8 +54,6 @@ void InitTo330Pointer(unsigned char ChipType, struct vb_device_info *pVBInfo)
pVBInfo->SR21 = 0xa3; pVBInfo->SR21 = 0xa3;
pVBInfo->SR22 = 0xfb; pVBInfo->SR22 = 0xfb;
pVBInfo->TimingH = XGI_TimingH;
pVBInfo->TimingV = XGI_TimingV;
pVBInfo->UpdateCRT1 = XGI_UpdateCRT1Table; pVBInfo->UpdateCRT1 = XGI_UpdateCRT1Table;
/* 310 customization related */ /* 310 customization related */
...@@ -328,22 +326,22 @@ static void XGI_SetCRT1Timing_H(struct vb_device_info *pVBInfo, ...@@ -328,22 +326,22 @@ static void XGI_SetCRT1Timing_H(struct vb_device_info *pVBInfo,
data &= 0x7F; data &= 0x7F;
xgifb_reg_set(pVBInfo->P3d4, 0x11, data); xgifb_reg_set(pVBInfo->P3d4, 0x11, data);
data = pVBInfo->TimingH[0].data[0]; data = pVBInfo->TimingH.data[0];
xgifb_reg_set(pVBInfo->P3d4, 0, data); xgifb_reg_set(pVBInfo->P3d4, 0, data);
for (i = 0x01; i <= 0x04; i++) { for (i = 0x01; i <= 0x04; i++) {
data = pVBInfo->TimingH[0].data[i]; data = pVBInfo->TimingH.data[i];
xgifb_reg_set(pVBInfo->P3d4, (unsigned short) (i + 1), data); xgifb_reg_set(pVBInfo->P3d4, (unsigned short) (i + 1), data);
} }
for (i = 0x05; i <= 0x06; i++) { for (i = 0x05; i <= 0x06; i++) {
data = pVBInfo->TimingH[0].data[i]; data = pVBInfo->TimingH.data[i];
xgifb_reg_set(pVBInfo->P3c4, (unsigned short) (i + 6), data); xgifb_reg_set(pVBInfo->P3c4, (unsigned short) (i + 6), data);
} }
j = (unsigned char) xgifb_reg_get(pVBInfo->P3c4, 0x0e); j = (unsigned char) xgifb_reg_get(pVBInfo->P3c4, 0x0e);
j &= 0x1F; j &= 0x1F;
data = pVBInfo->TimingH[0].data[7]; data = pVBInfo->TimingH.data[7];
data &= 0xE0; data &= 0xE0;
data |= j; data |= j;
xgifb_reg_set(pVBInfo->P3c4, 0x0e, data); xgifb_reg_set(pVBInfo->P3c4, 0x0e, data);
...@@ -385,28 +383,28 @@ static void XGI_SetCRT1Timing_V(unsigned short ModeIdIndex, ...@@ -385,28 +383,28 @@ static void XGI_SetCRT1Timing_V(unsigned short ModeIdIndex,
unsigned short i, j; unsigned short i, j;
for (i = 0x00; i <= 0x01; i++) { for (i = 0x00; i <= 0x01; i++) {
data = pVBInfo->TimingV[0].data[i]; data = pVBInfo->TimingV.data[i];
xgifb_reg_set(pVBInfo->P3d4, (unsigned short) (i + 6), data); xgifb_reg_set(pVBInfo->P3d4, (unsigned short) (i + 6), data);
} }
for (i = 0x02; i <= 0x03; i++) { for (i = 0x02; i <= 0x03; i++) {
data = pVBInfo->TimingV[0].data[i]; data = pVBInfo->TimingV.data[i];
xgifb_reg_set(pVBInfo->P3d4, (unsigned short) (i + 0x0e), data); xgifb_reg_set(pVBInfo->P3d4, (unsigned short) (i + 0x0e), data);
} }
for (i = 0x04; i <= 0x05; i++) { for (i = 0x04; i <= 0x05; i++) {
data = pVBInfo->TimingV[0].data[i]; data = pVBInfo->TimingV.data[i];
xgifb_reg_set(pVBInfo->P3d4, (unsigned short) (i + 0x11), data); xgifb_reg_set(pVBInfo->P3d4, (unsigned short) (i + 0x11), data);
} }
j = (unsigned char) xgifb_reg_get(pVBInfo->P3c4, 0x0a); j = (unsigned char) xgifb_reg_get(pVBInfo->P3c4, 0x0a);
j &= 0xC0; j &= 0xC0;
data = pVBInfo->TimingV[0].data[6]; data = pVBInfo->TimingV.data[6];
data &= 0x3F; data &= 0x3F;
data |= j; data |= j;
xgifb_reg_set(pVBInfo->P3c4, 0x0a, data); xgifb_reg_set(pVBInfo->P3c4, 0x0a, data);
data = pVBInfo->TimingV[0].data[6]; data = pVBInfo->TimingV.data[6];
data &= 0x80; data &= 0x80;
data = data >> 2; data = data >> 2;
...@@ -438,11 +436,11 @@ static void XGI_SetCRT1CRTC(unsigned short ModeNo, unsigned short ModeIdIndex, ...@@ -438,11 +436,11 @@ static void XGI_SetCRT1CRTC(unsigned short ModeNo, unsigned short ModeIdIndex,
xgifb_reg_set(pVBInfo->P3d4, 0x11, data); /* Unlock CRTC */ xgifb_reg_set(pVBInfo->P3d4, 0x11, data); /* Unlock CRTC */
for (i = 0; i < 8; i++) for (i = 0; i < 8; i++)
pVBInfo->TimingH[0].data[i] pVBInfo->TimingH.data[i]
= pVBInfo->XGINEWUB_CRT1Table[index].CR[i]; = pVBInfo->XGINEWUB_CRT1Table[index].CR[i];
for (i = 0; i < 7; i++) for (i = 0; i < 7; i++)
pVBInfo->TimingV[0].data[i] pVBInfo->TimingV.data[i]
= pVBInfo->XGINEWUB_CRT1Table[index].CR[i + 8]; = pVBInfo->XGINEWUB_CRT1Table[index].CR[i + 8];
XGI_SetCRT1Timing_H(pVBInfo, HwDeviceExtension); XGI_SetCRT1Timing_H(pVBInfo, HwDeviceExtension);
...@@ -1430,7 +1428,7 @@ static void XGI_ModCRT1Regs(unsigned short ModeNo, unsigned short ModeIdIndex, ...@@ -1430,7 +1428,7 @@ static void XGI_ModCRT1Regs(unsigned short ModeNo, unsigned short ModeIdIndex,
RefreshRateTableIndex, pVBInfo); RefreshRateTableIndex, pVBInfo);
for (i = 0; i < 8; i++) for (i = 0; i < 8; i++)
pVBInfo->TimingH[0].data[i] = LCDPtr[0].Reg[i]; pVBInfo->TimingH.data[i] = LCDPtr[0].Reg[i];
} }
XGI_SetCRT1Timing_H(pVBInfo, HwDeviceExtension); XGI_SetCRT1Timing_H(pVBInfo, HwDeviceExtension);
...@@ -1440,7 +1438,7 @@ static void XGI_ModCRT1Regs(unsigned short ModeNo, unsigned short ModeIdIndex, ...@@ -1440,7 +1438,7 @@ static void XGI_ModCRT1Regs(unsigned short ModeNo, unsigned short ModeIdIndex,
ModeIdIndex, RefreshRateTableIndex, ModeIdIndex, RefreshRateTableIndex,
pVBInfo); pVBInfo);
for (i = 0; i < 7; i++) for (i = 0; i < 7; i++)
pVBInfo->TimingV[0].data[i] = LCDPtr1[0].Reg[i]; pVBInfo->TimingV.data[i] = LCDPtr1[0].Reg[i];
} }
XGI_SetCRT1Timing_V(ModeIdIndex, ModeNo, pVBInfo); XGI_SetCRT1Timing_V(ModeIdIndex, ModeNo, pVBInfo);
......
...@@ -180,8 +180,8 @@ struct vb_device_info { ...@@ -180,8 +180,8 @@ struct vb_device_info {
struct XGI330_LCDCapStruct const *LCDCapList; struct XGI330_LCDCapStruct const *LCDCapList;
struct XGI_TimingHStruct *TimingH; struct XGI_TimingHStruct TimingH;
struct XGI_TimingVStruct *TimingV; struct XGI_TimingVStruct TimingV;
struct SiS_StandTable_S *StandTable; struct SiS_StandTable_S *StandTable;
struct XGI_ExtStruct *EModeIDTable; struct XGI_ExtStruct *EModeIDTable;
......
...@@ -216,10 +216,6 @@ static struct SiS_StandTable_S XGI330_StandTable = { ...@@ -216,10 +216,6 @@ static struct SiS_StandTable_S XGI330_StandTable = {
0xff} 0xff}
}; };
static struct XGI_TimingHStruct XGI_TimingH[1];
static struct XGI_TimingVStruct XGI_TimingV[1];
static struct XGI_XG21CRT1Struct XGI_UpdateCRT1Table[] = { static struct XGI_XG21CRT1Struct XGI_UpdateCRT1Table[] = {
{0x01, 0x27, 0x91, 0x8f, 0xc0}, /* 00 */ {0x01, 0x27, 0x91, 0x8f, 0xc0}, /* 00 */
{0x03, 0x4f, 0x83, 0x8f, 0xc0}, /* 01 */ {0x03, 0x4f, 0x83, 0x8f, 0xc0}, /* 01 */
......
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