• Not Answered

OMAP3530 display palette driver

hi

Recently I need to get  gray(luminance) data from camera at OMAP3 Linux platform

after some processing, I need output the frame data to LCD with predefined color palette table.

I know that LCD controller of OMAP3530 has LUT hardware for palette of color conversion.

but had no any idea to configure it at my application code, so can anyone help to show me

some example code to  configure palette table, utilizing the hardware LUT  unit and output to LCD?

 

If you can redirect to the related information or document, I will appreciate it also.

 

thanks

3 Replies

  • I don't think there is any support in the current Linux kernel for color indexed graphics, but it is fairly easy to enable from the application level through direct register configuration.

    First, simply assume you are using the default 16 bit frame buffer and configure the display to the size you wish to display.

    Next, change the DISPC_GFX_ATTRIBUTES register, bit field GFXFORMAT to be 0x03 (8 bit color index)

    Next, declare an array of 256 unsigned integers and populate it with the RGB values you want for each color index entry.

    Set DISPC_GFX_TABLE_BA to the physical address of the previously configured array (Note 1, this needs the physical address and not the virtual address so you will likely need to map it back. Note 2, this needs to be a 32 bit aligned address so depending on how the array is created it may be necessary to create an array of char slightly larger and populate the array such that the start is on a 32 bit boundary)

    Check section 15.4.2.2.2 Color Look-Up Table/Gamma Table of the TRM for more details.

    Set DISPC_CONFIG bit PALETTEGAMMATABLE to '0'

    Set DISPC_CONFIG bit  LOADMODE to 0x3

    Set DISPC_CONTROL bit GOLCD or GODIGITAL depending on if you are displaying on the LCD/DVI or TV output.

    To set registers you can use the source code for mem_util for an example of how to convert from virtual addresses to physical addresses.

    https://gstreamer.ti.com/gf/project/am_sysinfo/scmsvn/?action=browse&path=%2Ftrunk%2Fmem_util%2F&sortby=log

    BR,

    Steve

  • In reply to Steve Clynes:

    Steve,

     

    Thanks for your reply, the information is very usefull.

    but I have another further question about it. that is, how to retrieve back the translated

    pixel RGB data which is lookup-ed by the LUT or palette table. it just drive LCD output hardware

    peripheral? and can I restrict that just a small window region of screen to go through LUT for color

    conversion?

  • In reply to Cruise Huang:

    Unfortunately there is no writeback path to memory, so no you cannot store the constructed RGB image back to memory for reading.

    Regarding limiting the region to a small window this depends on exactly what you want to do.

    The display sub system can display a frame buffer in a window on a larger display, but it is not possible to feed part of this window through the LUT.

    Have a look at the following wiki page which might make it much clearer.

    http://processors.wiki.ti.com/index.php/Display_Subsystem

    BR,

    Steve