How can I get i.mx6 video to use 8-bit color with a color look-up table?

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

How can I get i.mx6 video to use 8-bit color with a color look-up table?

Jump to solution
3,375 Views
maxj
Contributor I

Is there a document somewhere that tells how to program the IPU to use 8-bit color and a look-up table?  Or does anyone have any tips on getting this working?  The only thing I can find is this note in IMX6DQRM.pdf:

 

The Look-Up Table Memory (LUT- Look Up Table) must be loaded at the IDMAC initialization step.

The LUT output format must match the IPU internal format RGBA 8888 where R is placed in

MSB and A is placed in LSB. The A field is used only for graphics data.


Also, I can't find a IPU_PIX_FMT that looks appropriate for 8-bit color from a LUT.

 

 

Using this video mode specification:

 

#

#   DirectFB video modes, should be placed into "/etc"

#

 

mode "1280x1024 60Hz 8bit"

    # D: 99.00 MHz, H: 64.119 KHz, V: 60.09 Hz

    geometry 1280 1024 1280 3072 8

    timings 10101 72 64 37 2 128 4

    hsync high

    vsync high

endmode

 

This is my best guess as to what the values in the struct fb_var_screeninfo should be:

 

/dev/fb0

screen_info:

          xres = 1280

          yres = 1024

  xres_virtual = 1280

  yres_virtual = 1024

       xoffset = 0

       yoffset = 0

bits_per_pixel = 8

     grayscale = 0

           red = {offset=5,length=3,msb_right=0}

         green = {offset=2,length=3,msb_right=0}

          blue = {offset=0,length=2,msb_right=0}

        transp = {offset=0,length=0,msb_right=0}

        nonstd = 0

      activate = 0

        height = 4294967295

         width = 4294967295

   accel_flags = 0

      pixclock = 10101

   left_margin = 72

  right_margin = 64

  upper_margin = 37

  lower_margin = 2

     hsync_len = 128

     vsync_len = 4

          sync = 3

         vmode = 0

        rotate = 0

 

However, when I try to switch to this video mode (from the command line or otherwise), this is what happens:

 

root@iMX6QSABRELite:/opt/mjovanovich$ echo "U:1280x1024p-60" > /sys/class/graphics/fb0/mode

imx-ipuv3 imx-ipuv3.0: warning: wait for bg sync eof timeout

imx-ipuv3 imx-ipuv3.0: IPU Warning - IPU_INT_STAT_5 = 0x08800000

imx-ipuv3 imx-ipuv3.0: IPU Warning - IPU_INT_STAT_10 = 0x00080000

imx-ipuv3 imx-ipuv3.0: mxc ipu: unimplemented pixel format

imx-ipuv3 imx-ipuv3.0: Unsupported burst size 1

imx-ipuv3 imx-ipuv3.0: mxc ipu: unimplemented pixel format

imx-ipuv3 imx-ipuv3.0: mxc ipu: unimplemented pixel format

imx-ipuv3 imx-ipuv3.0: Unsupported burst size 1

imx-ipuv3 imx-ipuv3.0: mxc ipu: unimplemented pixel format

imx-ipuv3 imx-ipuv3.0: mxc ipu: unimplemented pixel format

mxc_sdc_fb mxc_sdc_fb.0: timeout when waiting for flip irq

mxc_sdc_fb mxc_sdc_fb.0: timeout when waiting for flip irq

mxc_sdc_fb mxc_sdc_fb.0: timeout when waiting for flip irq

root@iMX6QSABRELite:/opt/mjovanovich$ ./fbcolormap

root@iMX6QSABRELite:/opt/mjovanovich$

 

After this, no more video signal goes out to the monitor.  Un-blanking doesn't help either, using this command:

 

echo "0" > /sys/class/graphics/fb0/blank

 

If I use 16, 24, or 32 bits per pixel (e.g. in /etc/fb.modes change the "8" at the end of the geometry line to "16"), the video mode works fine.

See attached code for fbcolormap, which executes with no errors, so I'm guessing that if the IPU can be programmed correctly, then the LUT might work.

 

 

 

 

 

 

Original Attachment has been moved to: fbcolormap.cpp.zip

Labels (3)
0 Kudos
1 Solution
1,220 Views
juangutierrez
NXP Employee
NXP Employee

The support needs to be added in _ipu_ch_param_init() in drivers/mxc/ipu3/ipu_param_mem.h, also adding a new pixel format like IPU_PIX_FMT_LUT that sets the pixel format as coded (5) in the cpmem

      ipu_ch_param_set_field(&params, 1, 85, 4, 5); /* pix format */


However, as far as I know there is no plans in short or mid-term to support this feature

View solution in original post

0 Kudos
7 Replies
1,220 Views
juangutierrez
NXP Employee
NXP Employee

Hi

Im trying to look at the code and it seems the RGB332 pixel format is not supported. Actually I tried to set this pixel format as RGB332 after running your fbcolormap and Im getting similar errors

root@linaro-ubuntu-desktop ./fbcolormap

root@linaro-ubuntu-desktop:~# fbset -rgba 3/5,3/2,2/0,0/0

mxc_sdc_fb mxc_sdc_fb.0: cannot get pixel format

mxc_sdc_fb mxc_sdc_fb.0: cannot get pixel format

mxc_sdc_fb mxc_sdc_fb.0: cannot get pixel format

imx-ipuv3 imx-ipuv3.1: mxc ipu: unimplemented pixel format

imx-ipuv3 imx-ipuv3.1: Unsupported burst size 1

mxc_sdc_fb mxc_sdc_fb.0: cannot get pixel format

imx-ipuv3 imx-ipuv3.1: mxc ipu: unimplemented pixel format

mxc_sdc_fb mxc_sdc_fb.0: cannot get pixel format

mxc_sdc_fb mxc_sdc_fb.0: cannot get pixel format

imx-ipuv3 imx-ipuv3.1: mxc ipu: unimplemented pixel format

I got the blank display but I can come back by restoring the original pixel format

root@linaro-ubuntu-desktop:~# fbset -rgba 5/11,6/5,5/0,0/0

I found that there is  IPU_PIX_FMT_GENERIC /*Represents 8-bit Generic data */ pixel format that sounds more suitable for what you are trying to do. I think none of the RGB formats is compatible with the LUT mode, since in this mode the value represents a decoded color in the LUT color palette.

I will continue looking for documentation and will let you know if I find something useful.

0 Kudos
1,220 Views
juangutierrez
NXP Employee
NXP Employee

I just checked and it seems the ipu driver currently is not supporting this feature (LUT)

0 Kudos
1,220 Views
maxj
Contributor I

Thanks for confirming that.  Instead, I suppose I'll have to find a way to do the look-up in ARM/NEON that uses the cache somewhat efficiently.  Do you know if the IPU LUT feature is something that is planned to be supported by the driver?

0 Kudos
1,221 Views
juangutierrez
NXP Employee
NXP Employee

The support needs to be added in _ipu_ch_param_init() in drivers/mxc/ipu3/ipu_param_mem.h, also adding a new pixel format like IPU_PIX_FMT_LUT that sets the pixel format as coded (5) in the cpmem

      ipu_ch_param_set_field(&params, 1, 85, 4, 5); /* pix format */


However, as far as I know there is no plans in short or mid-term to support this feature

0 Kudos
1,220 Views
daiane_angolini
NXP Employee
NXP Employee

Where are you "displaying" it?

0 Kudos
1,220 Views
maxj
Contributor I

I have an LCD display attached with an HDMI cable.  Does this answer your question or is there some specific detail you're looking for?  If possible, I would also like to be able to use the IPU to perform the overlay from memory (not the frame buffer) and place the results in memory (also not the frame buffer) for a separate video stream.

0 Kudos
1,220 Views
daiane_angolini
NXP Employee
NXP Employee

It does. I´m not able to help you with this issue though. I´m trying to bring your question/topic to the top of activities. Maybe someone else knows it.

0 Kudos