Local alpha and IPU overlay

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Local alpha and IPU overlay

5,082 Views
christophe
Contributor V

Hi,

On the current IPU video stream, I wish to overlay a picture by using local alpha blending technique.

I obtain 3 results:

(local_alpha is enabled)

1- Picture format = BGR24 bits + 8 bits separate alpha ==> Correct blending of the picture.

2- Picture format = BGRA32 bits ==> The picture doesn't appear.

3- Picture format = BGR 32 bits + 8 bits separate alpha ==> The picture is blended but colors are corrupted (i've tried severals BGR or RGB possibilities).

For the cases 2 and 3, if i switch local alpha to 0 and global alpha to 1, then i see the picture (but no more the video stream).

So, i think there's an IPU issue when 32 bits overlay signal and local alpha are used.

Someone can confirm or not ?

Rgds,

Christophe.

Labels (1)
13 Replies

1,328 Views
christophe
Contributor V

Hi Philip,

I confirm again i've no success to make working this, as said higher.

I agree with the theory: it should work.

But if you say you have already seen working, or make it working from your own, i'll spend again time to this problem.

0 Kudos

1,328 Views
christophe
Contributor V

An imx53 QSB board. Yep. With all conditions that you say, it's exactly what i've tried to do.

0 Kudos

1,328 Views
Philip_FSL
Contributor IV

Which iMX processor are you using?  The automatic overlay plane is enabled and works with local alpha is all of the Freescale i.MX BSPs that I'm aware of.  You shouldn't need to do any passing of the data.  You should be able to render directly to the overlay framebuffer using EGL directly.  The only thing that needs to be done is that the overlay needs to be sized appropriately, and the color format set to 32bpp and then it needs to be unblanked.  Then anything written to that framebuffer should be overlayed on top of /dev/fb0 using the local alpha for the blend factor per pixel.

0 Kudos

1,330 Views
sudiptasubudhi
Contributor III

Hi Philip,

In this discussion you mentioned " You should be able to render directly to the overlay framebuffer using EGL directly". Is it EGL_LEVEL parameter of config_attribs to be set for overlay or something else?

Thanks,

Sudipta

0 Kudos

1,330 Views
saurabh206
Senior Contributor III

Hi,

Philip

Do you have reference code, because I am facing same problem with android frame buffer and CSI buffer overlay using IPU.

Thanks,

Saurabh

0 Kudos

1,330 Views
christophe
Contributor V

Hi Philip,

Indeed. The automatic overlay doesn't work. If i pass the entire BGRA 32 buffer to ipu overlay (and NULL on the alpha input), the blending doesnt' work.

So, I really need to pass alpha through the separate buffer to see the blending working.

0 Kudos

1,330 Views
Philip_FSL
Contributor IV

Thanks.  I think I understand what you are doing better now.  Is there a reason why you are not using the automatic overlay plane with local alpha directly rather than using manual overlay with external alpha?  From your description, I understand that you are using the color and alpha components from the same content for the overlay.  If so, and if you are not using the automatic overlay plane for another purpose, it would probably be easier to render directly to the automatic overlay framebuffer and let the blending be done directly with no need for software intervention.

0 Kudos

1,330 Views
christophe
Contributor V

I render to fb3 (BRGA). To use alpha blending in overlay ipu, i copy alpha component from fb3 into a 8 bits buffer bufA.

fb3 is connected to the main overlay input et bufA is connected to alpha overlay input.

The ipu output if fb0. bufA is an internal buffer allocated with ipu mem command.

dev/fb3 (32 bits)----------------------------------------> ipu overlay main input --------------------> dev/fb0

                       ---------> bufA (8 bits) ---------> ipu alpha input

This config doesn't work correctly whit local alpha enabled. To make it work, you need to do:

dev/fb3 (32 bits)---------> bufBGR(24 bits)-----> ipu overlay main input --------------------> dev/fb0

                       ---------> bufA (8 bits) ---------> ipu alpha input

bufBGR and bufA are internal buffers allocated with ipu mem command.

The main problem is that the split of fb3 into bufBGR and bufA takes too much time.

0 Kudos

1,330 Views
Philip_FSL
Contributor IV

Are you using an overlay framebuffer /dev/fb1 that you are copying to from /dev/fb3?  What is the configuration for it?

Maybe I didn't exactly understand the flow.

- You render to /dev/fb3 then copy to /dev/fb2

- /dev/fb0 and /dev/fb1 are blended by the IPU and sent to the display

Is that correct?

0 Kudos

1,330 Views
christophe
Contributor V

My virtual 32 bits framebuffer at egl output:

root@lucid /home$ fbset -fb /dev/fb3
mode "1024x768-0"
        # D: 0.000 MHz, H: 0.000 kHz, V: 0.000 Hz
        geometry 1024 768 1024 768 32
        timings 0 0 0 0 0 0 0
        accel false
        rgba 8/16,8/8,8/0,8/24
endmode

And my real framebuffer at the ipu output:

root@lucid/home$ fbset -fb /dev/fb0


mode "1024x768-60"
        # D: 64.998 MHz, H: 48.362 kHz, V: 60.002 Hz
        geometry 1024 768 1024 2304 16
        timings 15385 220 40 21 7 60 10
        accel false
        rgba 5/11,6/5,5/0,0/0
endmode


0 Kudos

1,330 Views
Philip_FSL
Contributor IV

Hi Christophe,

Could you post the results of fbset -fb /dev/fbX for each framebuffer you are using (both the Virtual and real framebuffers) when using local alpha?

Philip

0 Kudos

1,330 Views
christophe
Contributor V

Hi Philip,

Yes, it's under Linux. I render into a virtual framebufer X (32 bits BRGA) first, and feed the overlay input after. The alpha data are copied from X into a secondth buffer to feed the overlay alpha input.With these conditions AND with local alpha blending enabled, the displayed colors are corrupted (the pictures are all blue, or all red).

Now, with this same config, if i swith from local alpha to global alpha, then the pictures become correct (true colors).

To make the local alpha blending correctly work, i must transform my 32 bits X buffer into a 24 bits buffer: so i end with the following config: a 32 bit BRGA buffer is copied into one BGR 24 bits buffer and one A 8 bits buffer.

So, i think there's an issue with 32 buffers config for overlay and local alpha enabled. I've verified programation done by IPU and registers seem to be fully correct, data packing is correct too. So....  ?

Christophe.

0 Kudos

1,330 Views
Philip_FSL
Contributor IV

Could you provide some information about how your are setting up the various configurations?  Is this under Linux?  Is this a configuration where you are rendering to the framebuffer device directly?  If you use Linux and setup the /dev/fbX (where X is the framebuffer number of the overlay) to a 32bpp configuration using fbset you can then blit a 32bpp image to the framebuffer with local alpha and it should be blended correctly over the background image.