Comment 7 for bug 670790

Revision history for this message
Hans-Juergen Mauser (hjmauser) wrote :

Hello Tormod,

while looking at the code again, I start getting some evidence that the "+7" offset addition really is related to panels with a horizontal hardware resolution of 1400 pixels. I ran doxygen over some old versions of the savage driver to dig into the history and possible changes to the worse.
Namely I took version 1.1.26 and 1.1.27. The interesting version is 1.1.26, which has a rather different structure in the expansion code (but the same main bug not to scale the lower right corner of the drawing area).

Here the addition of +7 to the offset is handled completely conditional. At a first glance, it seems to be dependent on two values, the panel width and the selected scaling factors. At a second look, I start getting the opinion that it is only related to the width as it is likely that certain scaling factors are exclusive to this display width.

Whenever the width of the display is checked within a scaling factor condition, the +7 only gets added when the width equals 1400.

Here is the code - in one case even the Y offset is corrected when a 1400 pixel display is present.

01879 switch( XFactor )
01880 {
01881 case 1:
01882 psav->XExpansion = 0x00010001;
01883 psav->displayXoffset =
01884 (((PanelSizeX - ViewPortWidth) / 2) + 0x7) & 0xFFF8;
01885 break;
01886
01887 case 3:
01888 psav->XExpansion = 0x00090008;
01889 psav->displayXoffset =
01890 (((PanelSizeX - ((9 * ViewPortWidth)/8)) / 2) + 0x7) & 0xFFF8;
01891 break;
01892
01893 case 4:
01894 psav->XExpansion = 0x00050004;
01895
01896 if ((psav->cxScreen == 800) && (PanelSizeX !=1400))
01897 {
01898 psav->displayXoffset =
01899 (((PanelSizeX - ((5 * ViewPortWidth)/4)) / 2) ) & 0xFFF8;
01900 }
01901 else
01902 {
01903 psav->displayXoffset =
01904 (((PanelSizeX - ((5 * ViewPortWidth)/4)) / 2) +0x7) & 0xFFF8;
01905 }
01906 break;
01907
01908 case 6:
01909 psav->XExpansion = 0x00030002;
01910 psav->displayXoffset =
01911 (((PanelSizeX - ((3 * ViewPortWidth)/2)) / 2) + 0x7) & 0xFFF8;
01912 break;
01913
01914 case 7:
01915 psav->XExpansion = 0x00020001;
01916 psav->displayXoffset =
01917 (((PanelSizeX - (2 * ViewPortWidth)) / 2) + 0x7) & 0xFFF8;
01918 break;
01919 }
01920
01921 switch( YFactor )
01922 {
01923 case 0:
01924 psav->YExpansion = 0x00010001;
01925 psav->displayYoffset = (PanelSizeY - ViewPortHeight) / 2;
01926 break;
01927 case 1:
01928 psav->YExpansion = 0x00010001;
01929 psav->displayYoffset = (PanelSizeY - ViewPortHeight) / 2;
01930 break;
01931 case 2:
01932 psav->YExpansion = 0x00040003;
01933 psav->displayYoffset = (PanelSizeY - ((4 * ViewPortHeight)/3)) / 2;
01934 break;
01935 case 4:
01936 psav->YExpansion = 0x00050004;
01937 psav->displayYoffset = (PanelSizeY - ((5 * ViewPortHeight)/4)) / 2;
01938 break;
01939 case 5:
01940 psav->YExpansion = 0x00040003;
01941
01942 if((psav->cxScreen == 1024)&&(PanelSizeX ==1400))
01943 {
01944 psav->displayYoffset =
01945 ((PanelSizeY - ((4 * ViewPortHeight)/3)) / 2) - 0x1 ;
01946 }
01947 else
01948 {
01949 psav->displayYoffset = (PanelSizeY - ((4 * ViewPortHeight)/3)) / 2;
01950 }
01951 break;