Hi All,
Apologies if this is the wrong place to post this, please direct me elsewhere if that is the case.
Throughout this question i shall reference the following specification "i.MX 8M Dual/8M QuadLite/8M Quad Applications Processors Reference Manual"
I'm currently developing a display driver for the imx8m. To display moving images I have implemented double buffering using the context loader (15.4 Context Load (CTX_LD)).
The idea is that whilst the current frame is being displayed, the next frame buffer is being written to. I have set up the context loader to switch the address of the frame buffer each time the context loader is run. The memory register I have set up to use in the context loader is DPR_1_FRAME_1P_BASE_ADDR_CTRL0 (15.7.3.1.38)
The issue I'm facing is that each time it switches frames i can see a visible redraw of the screen. As far as I am aware, this issue isn't anything to do with tearing as I have pre written each buffer and as a proof of concept I am just switching between displaying the two with no writing in between. The visible redraw can't easily be seen with the naked eye, but it results in a slight "jitteryness" when switching frames.
I currently use double buffering to achieve this, which states in the documentation (15.4.2 Functional Description) that double buffered registers "require their next state to be loaded into shadow registers during the active display time". I have attempted to use single buffering which seems more suitable by the definition "require the next state to be loaded during the vertical blanking time". But i get the same affect as with double buffered registers with the screen intermittently flickering to black.
Just to confirm - I am successfully displaying two different screen states one after another with the context loader, but the issue is that when switching to the next display state it will visibly redraw the screen from the top, resulting in a subtle visual glitch. The position of the draw is consistent with each context switch.
It seems to be that my display timing settings must not be set up correctly, but I am having trouble figuring out exactly what is missing from my setup. My understanding of the context loader is that it automates the process of changing the display from one state to another, leveraging the timing signals from the Display Timing Generator (15.3 Display Timing Generator).
For the Display Timing generator (DTG) I have set up the following memory registers as per the example (15.3.2.4 DTG Programming Example
When following the example it does not work as expected, so I have looked at the linux and uboot implementations of this driver and have taken inspiration from the values they use to set these memory registers which are different to what is written in the spec. When using these settings it works in displaying my image correctly formatted on the screen.
I have also played around with values in the following memory register, which is clearly important for this to work:
I have done the same for the subsampler following the example, which works as expected without any deviation from the spec:
I understand that there are many other parts of the setup that I have not included here that could affect things. But I'm reaching out on this forum just to get some clarification or potential guidance on the following points:
If anyone has any advice on this, it would be greatly appreicated. Thanks,
Tom
Hello,
What are you using? Linux? Android? this could be a bug in our current bsp.
regards
Hello, Thanks for the quick response.
I'm trying to write my own bare metal driver so im not using any bsp.
Kind regards,
Tom