For reference, that xlsm file works… sortof. The macros are all broken badly in libreoffice.
The algorithms are;
adjust_Tclk_zero(){
Ths_rqst = G16;
Tclk_prepare = G10;
Tclk_zero = F11;
do {
modResult = (Ths_rqst + Tclk_prepare + Tclk_zero) mod 8;
if (modResult = 0) break;
Tclk_zero++;
} while (modResult != 0);
F11 = Tclk_zero;
}
reset_Tclk_zero(){
G10 = F10;
F11 = IF(MOD(IF(E11=255, ROUNDUP((E11-D11)*($F$50/100)+D11, 0), ROUNDUP(D11*($F$50/100)+D11,0)),2)=0, IF(E11=255, ROUNDUP((E11-D11)*($F$50/100)+D11, 0), ROUNDUP(D11*($F$50/100)+D11,0)), IF(E11=255, ROUNDUP((E11-D11)*($F$50/100)+D11, 0), ROUNDUP(D11*($F$50/100)+D11,0))-1);
G11 = IF(MOD(($F$16 + $G$10 + $F$11), 8)=0, $F$11, ""INVALID"");
}
Basically works by first reset, then adjust.
reset:
G10 = F10,
Set some meaningless cell, like I11, to =IF(MOD(IF(E11=255, ROUNDUP((E11-D11)($F$50/100)+D11, 0), ROUNDUP(D11($F$50/100)+D11,0)),2)=0, IF(E11=255, ROUNDUP((E11-D11)($F$50/100)+D11, 0), ROUNDUP(D11($F$50/100)+D11,0)), IF(E11=255, ROUNDUP((E11-D11)($F$50/100)+D11, 0), ROUNDUP(D11($F$50/100)+D11,0))-1)
Copy the calculated value from I11 into F11
The value of G11 is already fine, just leave it.
Adjust:
Now begin incrementing the value stored in F11 until G4 displays “VALID”.
Now you can copy your timing parameters from B29 through B39 into the panel configuration field labeled “qcom,mdss-dsi-panel-timings”.
Also, I believe that I have identified a reasonable mechanism for calculating horizontal/vertical back/front porch/pulse:
Generate modeline: The XFree86 Modeline Generator
Paste modeline to video timing calculator: http://www.epanorama.net/faq/vga2rgb/calc.html
Copy results from section 2 and paste to panel configuration.