2009-04-29 07:05:23 BF548 PIXC
Sergey Lapin (RUSSIAN FEDERATION)
Message: 73421
Hi, all!
I want to use Pixel Compositor in BF548 processor to d a simple overlay using Linux.
I've used bf54x-lq043fb.c as base, set up PIXC, EPPI gets data by DMA from PIXC output buffer,
image source for PIXC gets data from fb0 bufferm and overlay source is from fb1 buffer,
everything basically works except whole machine as soon as PIXC is enabled is loaded extremely,
every device access (especially NAND) is unacceptably slow. I set up all 3 DMAs of PIXC the same way as
EPPI0, so, no interrupts, DMA_FLOW_AUTO, DMA_NOSYNC_KEEP_DMA_BUFF, 32bit bus width.
Is there some solutiion to reduce load?
All the best,
S.
static int config_pixc(struct bfin_bf54xfb_info *fbi)
{
bfin_write_PIXC_CTL(0);
set_dma_config(CH_PIXC_IMAGE,
set_bfin_dma_config(DIR_READ, DMA_FLOW_AUTO,
INTR_DISABLE, DIMENSION_2D,
DATA_SIZE_32,
DMA_NOSYNC_KEEP_DMA_BUF));
set_dma_x_count(CH_PIXC_IMAGE, (LCD_X_RES * LCD_BPP) / DMA_BUS_SIZE);
set_dma_x_modify(CH_PIXC_IMAGE, DMA_BUS_SIZE / 8);
set_dma_y_count(CH_PIXC_IMAGE, LCD_Y_RES);
set_dma_y_modify(CH_PIXC_IMAGE, DMA_BUS_SIZE / 8);
set_dma_start_addr(CH_PIXC_IMAGE, (unsigned long)fbi->fb_buffer);
#if 0
set_dma_config(CH_PIXC_OVERLAY,
set_bfin_dma_config(DIR_READ, DMA_FLOW_AUTO,
INTR_DISABLE, DIMENSION_2D,
DATA_SIZE_32,
DMA_NOSYNC_KEEP_DMA_BUF));
set_dma_x_count(CH_PIXC_OVERLAY, (LCD_X_RES * LCD_BPP) / DMA_BUS_SIZE);
set_dma_x_modify(CH_PIXC_OVERLAY, DMA_BUS_SIZE / 8);
set_dma_y_count(CH_PIXC_OVERLAY, 30);
set_dma_y_modify(CH_PIXC_OVERLAY, DMA_BUS_SIZE / 8);
set_dma_start_addr(CH_PIXC_OVERLAY, (unsigned long)fbi->fb_ov_buffer);
#endif
set_dma_config(CH_PIXC_OUTPUT,
set_bfin_dma_config(DIR_WRITE, DMA_FLOW_AUTO,
INTR_DISABLE, DIMENSION_2D,
DATA_SIZE_32,
DMA_NOSYNC_KEEP_DMA_BUF));
set_dma_x_count(CH_PIXC_OUTPUT, (LCD_X_RES * LCD_BPP) / DMA_BUS_SIZE);
set_dma_x_modify(CH_PIXC_OUTPUT, DMA_BUS_SIZE / 8);
set_dma_y_count(CH_PIXC_OUTPUT, LCD_Y_RES);
set_dma_y_modify(CH_PIXC_OUTPUT, DMA_BUS_SIZE / 8);
set_dma_start_addr(CH_PIXC_OUTPUT, (unsigned long)fbi->fb_out_buffer);
bfin_write_PIXC_PPL(LCD_X_RES);
bfin_write_PIXC_LPF(LCD_Y_RES);
bfin_write_PIXC_AHSTART(0);
bfin_write_PIXC_AHEND(LCD_X_RES - 1);
bfin_write_PIXC_AVSTART(0);
bfin_write_PIXC_AVEND(30);
bfin_write_PIXC_ATRANSP(4);
bfin_write_PIXC_BHSTART(0);
bfin_write_PIXC_BHEND(0);
bfin_write_PIXC_BVSTART(0);
bfin_write_PIXC_BVEND(0);
bfin_write_PIXC_BTRANSP(0);
bfin_write_PIXC_INTRSTAT(0);
bfin_write_PIXC_RYCON(0);
bfin_write_PIXC_GUCON(0);
bfin_write_PIXC_BVCON(0);
bfin_write_PIXC_CCBIAS(0);
bfin_write_PIXC_TC(0);
#if 0
bfin_write_PIXC_CTL(OVR_A_EN | IMG_FORM | OVR_FORM | OUT_FORM | TC_EN);
#else
bfin_write_PIXC_CTL(IMG_FORM | OVR_FORM | OUT_FORM | TC_EN);
#endif
return 0;
}
QuoteReplyEditDelete
2009-04-29 07:16:33 Re: BF548 PIXC
Robin Getz (UNITED STATES)
Message: 73422
Sergey:
>Is there some solutiion to reduce load?
Don't use the PIXC. - It consumes too much memory bandwidth.
What we have found is that for small overlays - doing everything in software is a better idea.
-Robin
QuoteReplyEditDelete
2009-04-29 07:18:54 BF548 PIXC
Michael Hennerich (GERMANY)
Message: 73423 Can you try without the DEB_URGENT bits set?
-Michael
QuoteReplyEditDelete
2009-04-29 07:26:20 Re: BF548 PIXC
Sergey Lapin (RUSSIAN FEDERATION)
Message: 73424
I think I will need PIXC in case of full-HD video overlaying, is there some advice on PIXC usage in this case as a compromise?
like, is it possible to use it in interrupt mode, so to request DMA transfer only when update occurs, and not more often than 25 times per second. Is this usage scenario possible? FPS for video is not that great importance in my case, but I need it to work smoothly without too much system load. So, DMA transfer 15-20 times per second is ok if PIXC can work in this mode.
could anybody comment on this?
QuoteReplyEditDelete
2009-04-29 07:34:35 Re: BF548 PIXC
Michael Hennerich (GERMANY)
Message: 73425 SRCs and DST of the PIXC are DMAs.
You should be able to set the DI_EN bit in the DMA config of either DMA
channel source or destination or both.
-Michael
QuoteReplyEditDelete
2009-04-29 07:37:17 Re: BF548 PIXC
Robin Getz (UNITED STATES)
Message: 73426
Sergey:
When you say "HD" - are you talking about 1080p? or something less?
-Robin
QuoteReplyEditDelete
2009-04-29 08:37:19 Re: BF548 PIXC
Sergey Lapin (RUSSIAN FEDERATION)
Message: 73427
I hope something less, but I can't be sure.
QuoteReplyEditDelete
2009-04-29 09:04:48 Re: BF548 PIXC
Michael Hennerich (GERMANY)
Message: 73429 1080p - will never work
720p or 720i - MAYBE a still image (PPI only, but without PIXC in the background)
Regarding your system utilization issue when using the PIXC:
Make sure that both source channels read from the same DDR memory bank.
You can only have a certain number of open DDR memory banks.
With PIXC and PPI all targeting different memory banks and the core reads from a different one, and then some other DMA also tries to access another one. You run into such problems that a fifth DMA will cause very costly bank open and close transitions.
-Michael
QuoteReplyEditDelete
2009-04-30 04:39:23 Re: BF548 PIXC
Sergey Lapin (RUSSIAN FEDERATION)
Message: 73479
Hi, all!
I think I can share some resuts.
If PIXC DMAs are used with FLOW_STOP and run within EPPI0 DMA interrupt handler (in one interrupt per buffer mode)
load is reduced dramatically. I think of other optimisations to reduce load even more - is it possible
to detect changes in source buffer and run DMAs only in case of some new data? That could reduce
load extremely to satisfying results. Any ideas?
All the best,
S.
QuoteReplyEditDelete
2009-06-16 08:34:07 Re: BF548 PIXC
Kim Axelgaard Jensen (UNITED STATES)
Message: 75807
Hi Robin,
I have similary problems regarding use of PIXC in the BF548, as Sergey. (In Message Id 73423 )
You recommend not to use the PIXC for small overlay's, but to use software constructed composite instead, based on experience. My Question is: how is a simple overlay defined ? (Small squares around on a screen, or only a little square steady at all time at same coordinate on the screen, or is it little change in color use, or... I need to understand what the experience doing overlay in SW instead is based on).
Best Regards
Kim.
QuoteReplyEditDelete
2009-06-16 10:35:40 Re: BF548 PIXC
Robin Getz (UNITED STATES)
Message: 75823
Kim:
It depends on what graphics library you are using (Qt, SDL, DirectFB, MicroWin, etc) - all those have features in them which does overlay.
-Robin
QuoteReplyEditDelete
2009-06-16 11:56:34 Re: BF548 PIXC
Kim Axelgaard Jensen (UNITED STATES)
Message: 75839 Hi Robin.
Thank's for the fast reply !
A little explanation about my graphic:
I'm using my own developed graphical library. There is RLE encoded icon data
stored in NOR flash, which I load into a big array in the DDR memory before
use. My routine GAL (Graphical Abstraction Layer) then makes a RLE decode of
a icon to be shown and writes it to a shadow memory also placed in DDR. This
shadow memory is the one I composite on (shadow memory data stored in
RGB888). The output is to a PPI port attached to a encoder codec (AD7391)
setup to NTSC,720*486, format 656. I do the composite on 656 video data
comming on another PPI port having a decoder (ADV 7181C) attached, and send
the result to (AD7191) after composite.
Hope this explanation makes sence ?
I think the type of graphic/overlay I have is most similary to Qt and
therefor it might be the best to compare with ?
Best Regards
Kim.
QuoteReplyEditDelete
2009-06-16 14:06:14 Re: BF548 PIXC
Robin Getz (UNITED STATES)
Message: 75847
Kim:
I guess with this format - you might be able to use the PIXC - but you will need to do it in kernel space --
-Robin
QuoteReplyEditDelete
2009-06-17 08:14:48 Re: BF548 PIXC
Kim Axelgaard Jensen (UNITED STATES)
Message: 75884 Robin:
Just to be clear, You mean implement a pixel-compositor driver in kernel
space, or my whole library ?
Best Regards
Kim.
QuoteReplyEditDelete
2009-06-17 09:44:15 Re: BF548 PIXC
Robin Getz (UNITED STATES)
Message: 75893
Kim:
Yeah - the PIXC driver needs to be in kernel space - you will need to extend things for your library (in userspace).
-Robin