KurtE
Senior Member+
Morning all,
Will play a little more with the 'V' stuff this morning. Note: I have not fully implemented the c) option yet to hopefully smooth some things out. Here are some issues I suspect with the two previous quick to do options:
a) update the frame buffer when the camera completes a frame: The code starts to update the tft frame when the update code could be anywhere within the TFT frame. So while doing the updates part of new frame, part of old frame, plus as frame buffer up in DMA memory, cache issues so only when I complete the update do I do an arm_dcache_flush which will force the new data from cache into real memory where DMA is working from. But before then some will make it through some won't ...
b) update when the display finishes a frame: The display continues to run from start of the buffer again, while we start to update the frame buffer. So have some bleed through issues and partial data of multiple frames like a). But in addition, we are working off the last buffer the camera gave us. But it can easily happen that while we are doing the writeRect8BPP, that the camera finished the next frame, and switched back tot he buffer we are working from. So again could get the start of new data...
So now for c) It is to update the screen at end of each half frame. I will have 3 buffers for now. The one I claim to do writeRects from. Such that both come from same buffer, and two that the camera walks back and forth on... And code to tell the camera to swap one buffer for another... This is what I had setup earlier in the DMA GPIO code.
Will play a little more with the 'V' stuff this morning. Note: I have not fully implemented the c) option yet to hopefully smooth some things out. Here are some issues I suspect with the two previous quick to do options:
a) update the frame buffer when the camera completes a frame: The code starts to update the tft frame when the update code could be anywhere within the TFT frame. So while doing the updates part of new frame, part of old frame, plus as frame buffer up in DMA memory, cache issues so only when I complete the update do I do an arm_dcache_flush which will force the new data from cache into real memory where DMA is working from. But before then some will make it through some won't ...
b) update when the display finishes a frame: The display continues to run from start of the buffer again, while we start to update the frame buffer. So have some bleed through issues and partial data of multiple frames like a). But in addition, we are working off the last buffer the camera gave us. But it can easily happen that while we are doing the writeRect8BPP, that the camera finished the next frame, and switched back tot he buffer we are working from. So again could get the start of new data...
So now for c) It is to update the screen at end of each half frame. I will have 3 buffers for now. The one I claim to do writeRects from. Such that both come from same buffer, and two that the camera walks back and forth on... And code to tell the camera to swap one buffer for another... This is what I had setup earlier in the DMA GPIO code.