[Letux-kernel] jz4780 read out LCDC setup for HDMI

Paul Boddie paul at boddie.org.uk
Sat Jun 6 11:54:22 CEST 2020

On Saturday 6. June 2020 02.15.29 Maarten ter Huurne wrote:
> On the JZ4770 we found that end-of-frame interrupts would occur when the
> DMA descriptor had been processed instead of when the transfer ends. We
> put a dummy black line in a second DMA descriptor chained after the
> first one and used that to detect the end of the frame.

This kind of chaining arrangement reminds me of my PIC32 VGA signal generation 
experiment where I had to manually generate the black level after each display 
line. :-)

But with regard to the JZ4780, the manual says this about the LCD command 

"When EOFINT = 1, the DMAC sets the end of frame bit (LCDSTATE.EOF) after 
fetching the last word in the frame buffer. In dual-panel mode, LCDSTATE.EOF 
is set only when both channels reach the end of frame and both frame 
descriptors have EOFINT set."

So, this is the documented behaviour, at least (and maybe it is also described 
in this way in any JZ4770 manual). I suppose that if there is a delay between 
this final transfer and delivering the data to the display, it will make some 
kind of difference. Maybe if it causes problems, the OSD end-of-frame 
interrupts can be used instead.

> I don't know if the JZ4780 does the same thing, but in general the SoCs
> in the series have more similarities than differences.

I noted to Paul that there are some differences that are probably related to 
functional changes. The pixel depth in the LCD control register does not seem 
to be modifiable, but this information is probably now configured via "new" 
descriptors (and thus via the LCD_CPOSx registers). Meanwhile, palette support 
for displays is supposedly missing (according to comments in the 3.0.8 driver, 
but there is also no palette bit in the command register) and there may not be 
support for limited pixel depths any more, although I haven't tested this.

It would also be interesting to know what your experiences have been with the 
OSD functionality. It seems that this is always on in the JZ4780, and it also 
seems that the foreground planes must be configured regardless of whether they 
will be used, as noted in my earlier message.

After my message yesterday, I tested a few things...

I tried to use 4-word descriptors instead of the "new" 8-word descriptors just 
to see if the extra words are superfluous and reasonable defaults are used, 
but there was no picture (black screen). This was the case even with two 
descriptors set up.

I found that the RGB control register does not have to be set up, so I wonder 
what this actually does. Maybe I should have looked to see whether it was 
enabled, anyway, despite the manual indicating that it should be zero 

It doesn't seem to be necessary to use 64-word burst transfers: 16-word 
transfers also worked. Maybe this is advisible for performance or stability, 


More information about the Letux-kernel mailing list