This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Display problem in OMAP-L137 - conflict between DMA engine refreshing LCD and ARM writing the framebuffer?

Other Parts Discussed in Thread: OMAP-L137, AM1808

Hello everyone,

I use the ARM to display in omap-l137 and use the SDRAM as the LCD framebuffer.

When i add a code "while( (LCD_STAT_REG | 1) == 0 );" before ARM write the framebuffer, the LCD displays correctly,

and if i don't add this code, the LCD image moves.

i think that code means the ARM is waiting for the DMA free,

so it means that the ARM could opreate the framebuffer only when the DMA free.

But i think the ARM should operate the framebuffer at anytime and should not wait for the DMA free.

Could anyone give a suggestion?

Thanks

Liu

  • who can help me?  i`m  crazy.

  • Hello Lousa

    Are you sure your driver have no bug?

     

    Thanks,

    Yanbin Yue

  • Hi Liu,

    I have seen this on a AM1808 processor. Remember that as you write to the frame buffer you are sharing the same bus that the DMA uses to feed data from the SDRAM to the LCD controller. The LCD controller is on a fixed pixel clock, and if the DMA stalls the LCD controller will move on, which will cause your image to move.

    If this is happening the DMA will set the FUF bit in the LCD_STAT register (See the LCDC user guide).

    When you wait for the DONE bit in the LCD_STAT register you are waiting for the DMA to finish loading data for that frame. When that happens there is a short break before the DMA starts feeding the LCD controller again for the next screen refresh. During the time you can freely access the memory.

    Also if you were to access the frame buffer slowly (relatively speaking) the DMA will have no problem accessing the SDRAM between the ARM's memory accesses.

    The thing that helped for my case was turning up the DMA FIFO threshold and burst size (LCDDMA_CTRL register). Unfortunately the FIFO threshold register might not be available on your processor, so your option might be waiting for the DONE bit.

    Good Luck.

    Eric.