Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 354356
b: refs/heads/master
c: a5e080b
h: refs/heads/master
v: v3
  • Loading branch information
Peter Huewe authored and Greg Kroah-Hartman committed Feb 4, 2013
1 parent d1a600e commit ea313bb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bae31702cdc0db3d45d05aa6e073641c85918c50
refs/heads/master: a5e080b83e28f2b67c198cb3be96f4b190522109
20 changes: 9 additions & 11 deletions trunk/drivers/staging/xgifb/XGI_main_26.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ static int XGIfb_mode_rate_to_ddata(struct vb_device_info *XGI_Pr,
unsigned short VRE, VBE, VRS, VDE;
unsigned short HRE, HBE, HRS, HDE;
unsigned char sr_data, cr_data, cr_data2;
int B, C, D, E, F, temp, j;
int B, C, D, F, temp, j;
InitTo330Pointer(HwDeviceExtension->jChipType, XGI_Pr);
if (!XGI_SearchModeID(ModeNo, &ModeIdIndex, XGI_Pr))
return 0;
Expand All @@ -104,14 +104,13 @@ static int XGIfb_mode_rate_to_ddata(struct vb_device_info *XGI_Pr,

sr_data = XGI_CRT1Table[index].CR[5];

HDE = (XGI330_RefIndex[RefreshRateTableIndex].XRes >> 3) - 1;
E = HDE + 1;
HDE = (XGI330_RefIndex[RefreshRateTableIndex].XRes >> 3);

cr_data = XGI_CRT1Table[index].CR[3];

/* Horizontal retrace (=sync) start */
HRS = (cr_data & 0xff) | ((unsigned short) (sr_data & 0xC0) << 2);
F = HRS - E - 3;
F = HRS - HDE - 3;

sr_data = XGI_CRT1Table[index].CR[6];

Expand All @@ -126,10 +125,10 @@ static int XGIfb_mode_rate_to_ddata(struct vb_device_info *XGI_Pr,
/* Horizontal retrace (=sync) end */
HRE = (cr_data2 & 0x1f) | ((sr_data & 0x04) << 3);

temp = HBE - ((E - 1) & 255);
temp = HBE - ((HDE - 1) & 255);
B = (temp > 0) ? temp : (temp + 256);

temp = HRE - ((E + F + 3) & 63);
temp = HRE - ((HDE + F + 3) & 63);
C = (temp > 0) ? temp : (temp + 64);

D = B - F - C;
Expand All @@ -142,29 +141,28 @@ static int XGIfb_mode_rate_to_ddata(struct vb_device_info *XGI_Pr,

cr_data2 = XGI_CRT1Table[index].CR[9];

VDE = XGI330_RefIndex[RefreshRateTableIndex].YRes - 1;
E = VDE + 1;
VDE = XGI330_RefIndex[RefreshRateTableIndex].YRes;

cr_data = XGI_CRT1Table[index].CR[10];

/* Vertical retrace (=sync) start */
VRS = (cr_data & 0xff) | ((unsigned short) (cr_data2 & 0x04) << 6)
| ((unsigned short) (cr_data2 & 0x80) << 2)
| ((unsigned short) (sr_data & 0x08) << 7);
F = VRS + 1 - E;
F = VRS + 1 - VDE;

cr_data = XGI_CRT1Table[index].CR[13];

/* Vertical blank end */
VBE = (cr_data & 0xff) | ((unsigned short) (sr_data & 0x10) << 4);
temp = VBE - ((E - 1) & 511);
temp = VBE - ((VDE - 1) & 511);
B = (temp > 0) ? temp : (temp + 512);

cr_data = XGI_CRT1Table[index].CR[11];

/* Vertical retrace (=sync) end */
VRE = (cr_data & 0x0f) | ((sr_data & 0x20) >> 1);
temp = VRE - ((E + F - 1) & 31);
temp = VRE - ((VDE + F - 1) & 31);
C = (temp > 0) ? temp : (temp + 32);

D = B - F - C;
Expand Down

0 comments on commit ea313bb

Please sign in to comment.