LCD display exception analysis-tear effect and teareffect
Overview
In the previous "LCD display exception analysis-boot flash screen", we analyzed the problem of boot screen. In this article, I will tear the LCD (tear effect) analyze the problem in detail and provide common solutions to the problem.
Applicability:
Target: LCD Driver debugger hardware: LCD with GRAM (for example, SPI/MCU/DSI CMD screen) software: All Embedded Operating Systems
Symptom
First, we will post a dynamic diagram to help you intuitively feel the process of tearing:
Analysis
We can see from the above dynamic diagram that a part of the new and old images is displayed in the second frame, which isTearIn EnglishTear effect. The root cause of tear effect is the inconsistent reading and writing speed of GRAM. As a result, the read pointer (R) and write pointer (W) of GRAM overlap within one frame.
This phenomenon actually contains two pieces of information:
W and R pointers overlap. The screen after the pointer overlaps is displayed on the screen.
StaticThe whole frame time is maintained (60 FPS is 16.7 ms), which is enough to be noticed by the human eye.
Experienced developers know that such problems are often caused2x relationshipNot adjusted. What is"2x relationship"? That is, it must be guaranteedW: R> (both W and R here refer to the speed). Otherwise, a tear may occur (W: R = above ).
Ideal
Why?2x? See (W: R = ):
Because W <R, the R pointer runs in front, so the read data is old data, and the screen displays the image of the previous frame at 1st frames, the image in the GRAM is not completely displayed until 2nd frames. If R is a little faster, the R pointer will catch the W pointer at the first frame, and the tear effect phenomenon will occur again. Therefore, W: R = is the critical value of tearing.
Similarly, if W> R is involved2x relationship?
Before answering this question, let's take a look at the two figures below:
Figure 1 (W: R = 3:1)
Figure 2 (W: R = 2:1)
From the figure above, we can see that for W> R, there is indeed a 2x relationship. However, this tear caused by W> R is generallyImpossibleBecause most of the display drivers are waitingWhen the TE signal arrives, the image is flushed. Therefore, as long as the R pointer has not scanned the current frame, the W pointer cannot immediately go to the GRAM to fl the image "B, the image will not be drawn until "A" is completely displayed.
Therefore, to prevent the occurrence of the tear, you only need to ensure that W> 1 2 "Role =" presentation "> 12 1 2 R (the speed here.
Actual Situation
The preceding analysis is based on the following prerequisites:
Both pointer W and R are based onSame time point,Start position of the same GRAMStart scanning
As long as one of the above two points does not meet the requirements2x relationshipThis is not true.
Because for this type of LCD with GRAM, the driver software or LCD Controller hardware will be waiting.When the TE signal arrives, the image will be refreshed. Therefore, we will not describe it in detail at, but will only explain it. In the actual display process of the LCD, there is actually a hidden area (that is, the Porch area), and generally the screen factory willThe TE signal is sent in the VSYNC phase of the internal DriverIC by default, which causes the pointer W to fail to scan from the starting position of the same GRAM as R. The specific process is as follows:
We can see that although W: R =, W> 1 2 "Role =" presentation "> 12 1 2 R condition, but because they do not start scanning from the same starting position of the GRAM, the W and R pointer will still meet, resulting in tearing.
So is there any way to solve this problem? Time to summonTE Output Line!
TE Output Line
LCD DriverIC manufacturers are very considerate. To solve the above problems, engineers have reserved a dedicatedTE Output Line register, which is used to adjustTE signal (also calledFMARK signal) Output position. By default, the value of this register is 0, that is, the VSYNC period during internal refresh of DriverIC. In this case, we only needSet the TE Output Line value to VSYNC + VBP.
TIPS:
For the master end, Vporch is usually composed of VSYNC + VBP + VFP. for LCD DriverIC manufacturers, the VBP they define usually includes VSYNC;
For example:
Conclusion
Nature of tear:
Within one frame of time, W and R overlap the torn image and stay at one frame of time, which is noticed by the human eye.
Solution:
W> 1 2 "Role =" presentation "> 12 1 2 R (rate here) enables TE synchronization signal adjustment TE Output Line