2010-03-15 11:09:33     LCD Flickering Issue

Document created by Aaronwu Employee on Aug 21, 2013
Version 1Show Document
  • View in full screen mode

2010-03-15 11:09:33     LCD Flickering Issue

Appalayagari Sreedhar (INDIA)

Message: 87206   

 

Hi

 

We are using Blackfin BF527 Based custom board which uses different drivers like LCD, Ethernet, USB, Audio Codec etc. We are currently using uclinux distribution linux version Linux-2.6.28.10-ADI-2009R1.

 

We are facing LCD Flickering issue whenever we had other driver modules accessing in the background more particularly when using USB driver. We had discussed this issue in a different thread namely   blackfin.uclinux.org/gf/project/uclinux-dist/forum/?_forum_action=ForumMessageBrowse&thread_id=39662&action=ForumBrowse&forum_id=39 about solving this issue from the USB HC driver instead of checking the LCD. But we got suggestion from the usb vendor to change  "blocks of data per data transfer" to a smaller value so that time will be provided for LCD interrupts which is not achievable immediately.

 

Currently we have configured our LCD PPI-DMA  in LINE buffer mode. Here the LCD priority is higher than other drivers in the whole system. Even after doing it  we observe that LCD interrupts are missing whenever other modules are accessing.

 

On going through forum & different threads we come across 2 approaches which .

 

1. Using Frame Buffer instead of Line Buffer in DMA mode configuration with/without interrupt enabled.

 

     a)   Is this approach possible to implement without any interrupt access?

 

    b)    Is there any example code available in the distribution? What all the factors to be addressed for moving the  PPI-DMA code from LINE Buffer mode to FRAME buffer mode?

 

   c)    What are all limitations (if any) of using the PPI-DMA in Frame Buffer mode which needs to be addressed.

 

2. Using Descritptor based DMA mode(either small/large) with/without interrupts

 

   a)  Is this approach implemented/ available in the current uClinux distribution? If available please share us the link.

 

   b)  Whether this approach is suitable to handle with LINE Buffer mode itself?

 

   c)  Whether this Descriptor based DMA mode can be configured & worked without interrupts being enabled. Any limitation or factors to be addressed.

 

Could any one suggest which approach is better to take up & which one is more probable of solving the LCD Flickering issue effectively. If any other approch can be followed other than the above please do suggest us.

 

Thanks in advance.

 

Regards,

 

Sreedhar.

QuoteReplyEditDelete

 

 

2010-03-15 11:19:13     LCD Flickering Issue

Michael Hennerich (GERMANY)

Message: 87207    In general - I've no idea why your framebuffer uses DMA interrupts at all.

All Blackfin Linux framebuffer drivers don't use DMA Interrupts.

 

They either work in DMA Aufobuffer Mode or in circular linked descriptor mode, where NO interrupts are generated.

 

If you need examples take a look at ALL Blackfin framebuffer drivers in linux/drivers/video.

(There are plenty of them for your reference)

QuoteReplyEditDelete

 

 

2010-03-16 05:06:44     Re: LCD Flickering Issue

Appalayagari Sreedhar (INDIA)

Message: 87247   

 

Thanks for your input.

 

As suggested, we wrote a framebuffer driver for our LCD in auto-buffer mode, taking bfin-t350mcqb-lcd.c as a reference. With that driver, we were able to test standalone LCD application that works fine. But while running LCD test application in background and try to access our USB in parallel, we are encountering some problems.

 

1. Could not type characters from keyboard as they are not properly reflected in console.

 

2. Sometimes,

 

"BusyBox v1.13.4 (2010-03-16 09:18:37 IST) built-in shell (msh)

 

Enter 'help' for a list of built-in commands.

 

root:/>"

 

is displayed in console. then if "ps" is given, both processes were absent in the list.

 

3. Sometimes, lcd display is getting off. if "ps" is given, LCD test application is absent in the list.

 

4. Sometimes, both are working fine without any problem.

 

Kindly suggest your inputs for resolving the above issues.

 

 

 

Also, can we use the same descriptor based DMA modes for line buffers also. Pls comment.

QuoteReplyEditDelete

 

 

2010-03-16 05:21:30     Re: LCD Flickering Issue

Michael Hennerich (GERMANY)

Message: 87249    I have no idea what you are talking about - I've never seen such things happening.

And I'm sure our release kernel doesn't do such things.

 

Fix your code

 

> Also, can we use the same descriptor based DMA modes for line buffers

> also. Pls comment.

 

You can do whatever you want - there is a example in bf537-lq035.c that rotates the display by using DMA line buffers

 

if (landscape) {

 

for (i = 0; i < U_LINES; ++i) {

/* blanking lines point to first line of fb_buffer */

dma_desc_table[2*i] = (unsigned long)&dma_desc_table[2*i+2];

dma_desc_table[2*i+1] = (unsigned long)fb_buffer;

}

 

for (i = U_LINES; i < U_LINES + LCD_Y_RES; ++i) {

/* visible lines */

dma_desc_table[2*i] = (unsigned long)&dma_desc_table[2*i+2];

dma_desc_table[2*i+1] = (unsigned long)fb_buffer + (LCD_Y_RES+U_LINES-1-i)*2;

}

 

/* last descriptor points to first */

dma_desc_table[2*(LCD_Y_RES+U_LINES-1)] = (unsigned long)&dma_desc_table[0];

 

set_dma_x_count(CH_PPI, LCD_X_RES);

set_dma_x_modify(CH_PPI, LCD_Y_RES*(LCD_BBP/8));

set_dma_y_count(CH_PPI, 0);

set_dma_y_modify(CH_PPI, 0);

set_dma_next_desc_addr(CH_PPI, (void *)dma_desc_table[0]);

set_dma_config(CH_PPI, DMAFLOW_LARGE | NDSIZE_4 | WDSIZE_16);

 

} else {

 

set_dma_config(CH_PPI, set_bfin_dma_config(DIR_READ,

DMA_FLOW_AUTO,

INTR_DISABLE,

DIMENSION_2D,

DATA_SIZE_16,

DMA_NOSYNC_KEEP_DMA_BUF));

set_dma_x_count(CH_PPI, LCD_X_RES);

set_dma_x_modify(CH_PPI, LCD_BBP / 8);

set_dma_y_count(CH_PPI, LCD_Y_RES+U_LINES);

set_dma_y_modify(CH_PPI, LCD_BBP / 8);

set_dma_start_addr(CH_PPI, (unsigned long) fb_buffer);

}

QuoteReplyEditDelete

 

 

2010-03-17 00:56:02     Re: LCD Flickering Issue

Appalayagari Sreedhar (INDIA)

Message: 87299   

 

Thanks for the information Michael.

 

But I have a doubt in linux-2.6.x/video/bfin-t350mcqb-fb.c file.  In bfin_t350mcqb_probe() function. We are allocating framebuffer using dma_alloc_coherent(). Here, why the size of the buffer is mentioned as "fix.smem_len" where smem_len =  (LCD_X_RES * LCD_Y_RES  * LCD_BPP/8)  where blanking lines are not included.  Should this not be (LCD_X_RES * (LCD_Y_RES + U_LINE) * LCD_BPP/8) ?

 

info->fb_buffer =

           dma_alloc_coherent(NULL, fbinfo->fix.smem_len, &info->dma_handle,

                               GFP_KERNEL);

 

Kindly suggest.

QuoteReplyEditDelete

 

 

2010-03-17 00:57:30     Re: LCD Flickering Issue

Appalayagari Sreedhar (INDIA)

Message: 87300   

 

Thanks for the information Michael.

 

But I have a doubt in linux-2.6.x/video/bfin-t350mcqb-fb.c file.  In bfin_t350mcqb_probe() function. We are allocating framebuffer using dma_alloc_coherent(). Here, why the size of the buffer is mentioned as "fix.smem_len" where smem_len =  (LCD_X_RES * LCD_Y_RES  * LCD_BPP/8)  where blanking lines are not included.  Should the frame buffer size not be (LCD_X_RES * (LCD_Y_RES + U_LINE) * LCD_BPP/8) ?

 

info->fb_buffer =

           dma_alloc_coherent(NULL, fbinfo->fix.smem_len, &info->dma_handle,

                               GFP_KERNEL);

 

Kindly suggest.

 

---

QuoteReplyEditDelete

 

 

2010-03-17 04:36:24     Re: LCD Flickering Issue

Michael Hennerich (GERMANY)

Message: 87319    Indeed - your right - it allocates 1 line less memory.

I'm going to fix that immediately.

QuoteReplyEditDelete

 

 

2010-03-17 06:23:52     Re: LCD Flickering Issue

Appalayagari Sreedhar (INDIA)

Message: 87322   

 

Hi Micheal,

 

Thanks, we faced issues because of not allocating memory for blanking interval.

 

wonder how it works in Bf527 ezkit without any problem? can you clear me this doubt.

 

Thank you.

QuoteReplyEditDelete

 

 

2010-03-17 06:33:20     Re: LCD Flickering Issue

Michael Hennerich (GERMANY)

Message: 87323    In case the memory behind the fbmem isn't allocated - it doesn't cause issues.

QuoteReplyEditDelete

 

 

2010-03-19 10:10:20     Re: LCD Flickering Issue

Appalayagari Sreedhar (INDIA)

Message: 87482   

 

Dear Micheal,

 

Thank you very much.

 

-Sreedhar

QuoteReplyEditDelete

 

 

2010-03-22 02:51:37     Re: LCD Flickering Issue

Appalayagari Sreedhar (INDIA)

Message: 87539   

 

Hi Micheal,

 

We are seeing the performance issues when we implement the frame buffer auto buffer model.

 

the lcd browsing is taking lot of time compared to the previous implementation with interrupts.

 

could you please help how this can be resolved?

 

Thank you, Sreedhar

QuoteReplyEditDelete

 

 

2010-03-22 04:09:49     Re: LCD Flickering Issue

Michael Hennerich (GERMANY)

Message: 87556    Can you explain your implementation using interrupts in detail?

QuoteReplyEditDelete

 

 

2010-03-22 04:58:02     Re: LCD Flickering Issue

Appalayagari Sreedhar (INDIA)

Message: 87557   

 

Hi Micheal,

 

I have implemented the interrupts model like this.

 

configured the HSYNC hw timer to generate the interrupt. in the interrupt i copy the coresponding hsync line (based on vsync value ) from frame buffer to line buffer dma.

 

here i wont use the frame buffer driver. the frame bufer is allocated in sdram and the line buffer is allocated in the li data region.

 

thank you, please let me know if you need more details.

 

-Sreedhar

QuoteReplyEditDelete

 

 

2010-03-22 05:31:56     Re: LCD Flickering Issue

Michael Hennerich (GERMANY)

Message: 87559    It sounds odd to me that this scheme works better for you.

The main difference is that the PPI DMA origins from L1 instead of L3.

 

You could try to move the frame buffer into a different SDRAM bank.

Try to place the frame buffer in front of the kernel.

Increase kernel start address, use WT-Cache and place fbmem at 0x1000.

Attachments

    Outcomes