Snapdragon-410c: "DSI_Timing_Parameters.xlsm"?


#1

Hello sirs,

As I refer to “lm80-p0436-4_dsi_display_porting_guide.pdf” for changing DSI-timing output on Snapdragon-410c board.
In document, it says that we can calculate PHY parameters by worksheet of “DSI_Timing_Parameters.xlsm”.

But problem is, where could we get this worksheet of file?
Does anyone one who can advise?

Thanks, Dennis


#2

I found it in this archive;


#3

Hi doitright,

Yes, got it, the panel timing parameter.xlsm file.

Thanks a lot, Dennis


#4

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: http://xtiming.sourceforge.net/cgi-bin/xtiming.pl
Paste modeline to video timing calculator: http://www.epanorama.net/faq/vga2rgb/calc.html
Copy results from section 2 and paste to panel configuration.


#5

Actually, an even better way to do this is to fix the cell values to avoid needing the macros at all.

Just set the value of F11 to:


=MOD(8-(MOD(G16+G10+(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)),8)),8)+(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))

And then it will always keep the values correct.


#6

To validate, I was able to reproduce the current 720p settings by inputting an off-the-shelf modeline from “HDTV EDID ModePool”: https://www.mythtv.org/wiki/Modeline_Database

Specifically: ModeLine “1280x720” 74.25 1280 1390 1430 1650 720 725 730 750


#7

doitright, thank you very much for these wonderful answers.

Appreciated, Dennis


#8

Little more info on some of those parameters.
Modeline “name” pclk hwidth hsyncstart hsyncend htotal vdisp vsyncstart vsyncend vtotal flags

hsync_width = h-pulse-width = hsyncend - hsyncstart
hfp = hsyncstart - hwidth
hbp = htotal - hsyncend
vsync_width = v-pulse-width = vsyncend - vsyncstart
vfp = vsyncstart - vdisp
vbp = vtotal - vsyncend

So that, along with a known modeline that is valid for your monitor, feed it into the spreadsheet, and generate the timings.

Proper modeline can be obtained from /var/log/Xorg.0.log on something that actually works.

In theory, that should get you the proper settings.

In practice, however, this did not actually work for me. I did eventually achieve native resolution output, but my timings make absolutely no sense at all.

After putting in the correct timings, I managed to achieve gibberish output. I then adjusted from 3 to 4 lanes DSI (including the appropriate timings for that), which didn’t help. I then switched all the values back to original 720p values, which I remember did work, but caused some odd shifting and stretching, with the intention of making smaller adjustments. I neglected to set back the t-clk-post and t-clk-pre values from the 4-lane configuration, built, and fastboot boot’ed that kernel. Unexpectedly, it produced correct output at the display’s native resolution (1280x800).

The hfp/hbp/hpulse/vfp/vbp/vpulse values calculated for the 1280x800 are actually the same as 1280x720, so those values are actually correct, but the dsi-panel-timings just make no sense at all, and the t-clk values are also different from what they should be for 3-lane DSI. So apparently, 2 wrongs really do make a right.


#9

Hello,
someone could please send me the Excel file? I can’t find it anywhere.

Thank you.

Best,


#10

It used to be a zip file containing the PDF and Excel file but I think Qualcomm rearranged it with the Excel file as an attachment to the PDF. The instructions in the manual are “(click the paperclip icon on the left of the PDF screen to open the file)”. I assume these instructions are valid for Adobe Reader although there are other techniques that can be used to extract attachments.