HI Nimesh,
The code that transfers the data to the output buffer
is in
linux-2.6.x/drivers/video/bfin_ad7171fb_main.c

Here is the code that updates the frame buffer

void bfin_framebuffer_update(struct ycrcb_t *ycrcb_buffer, struct rgb_t *rgb_buffer)
{
        unsigned char *rgb_base  = (unsigned char *)rgb_buffer;
        unsigned char *ycrcb_base = (unsigned char *)ycrcb_buffer;
        unsigned char *odd_yuv;
        unsigned char *even_yuv;
        unsigned char *rgb_ptr;
        int oddline, evenline,rgbline;

        for (oddline = FIELD1_AV_START, evenline = FIELD2_AV_START, rgbline = 0;
             oddline <= FIELD1_AV_END; oddline ++, evenline ++) {
odd_yuv= (unsigned char *)((ycrcb_base + (oddline * YCBCR_WIDTH))+HB_LENGTH+8);
                rgb_ptr = (unsigned char *)(rgb_base + (rgbline++)*RGB_WIDTH*3);
                fb_memcpy((u32 *)rgb_l1,(u32 *)rgb_ptr,RGB_WIDTH*3/4);
                rgb2yuv(rgb_l1,yuv_l1,RGB_WIDTH);
                fb_memcpy((u32 *)odd_yuv, (u32 *)yuv_l1, RGB_WIDTH/2);

even_yuv = (unsigned char *)((ycrcb_base + (evenline * YCBCR_WIDTH))+HB_LENGTH+8);
                rgb_ptr = (unsigned char *)(rgb_base + (rgbline++)*RGB_WIDTH*3);
                fb_memcpy((u32 *)rgb_l1,(u32 *)rgb_ptr,RGB_WIDTH*3/4);
                rgb2yuv(rgb_l1,yuv_l1,RGB_WIDTH);
                fb_memcpy((u32 *)even_yuv, (u32 *)yuv_l1, RGB_WIDTH/2);
        }
}

The rgb2yuv code is in
linux-2.6.x/drivers/video/rgb2ycbcr.S

Here is its function

* Author:        Aubrey.Li <[EMAIL PROTECTED]>
 *
 * Created:
* Description: In this function the range of R, G and B is 0 to 255 and the
 *               output range of Y, Cb and Cr is also 0 to 250.
 *               Input format: RGBRGB..., Output format: CbYCrYCbYCrY...
 *               The formula implemented is as below:
 *                  Y  = (0.299R  +  0.587G  +  0.114B)*250/255
 *                  Cb = (-0.169R -  0.331G  +  0.500B + 128)*250/255
 *                  Cr = (0.500R  -  0.419G  -  0.081B + 128)*250/255
* 128 is added to Cb and Cr to get the output in the range 0 to
 *                250.
* Prototype: void rgb2yuv(unsigned char rgb[], unsigned char yuv[], int n);

This is some neat assembly code to use the DSP stuff to run the conversion as a fixed point function.

The key to getting your application running is knowing what the
AD7179 needs for a data format and detecting any difference between that device and the default 7171 device

In taking a quick look at then data sheets for both devices I cannot immediately see any magic bit that needs to be set to get you what you want.

 Take a look at the set up of the 7171 system  we see this in
the function  adv7171_detect_client

        }
#ifdef CONFIG_NTSC
        i = adv7171_write_block(client, init_NTSC, sizeof(init_NTSC));
#else /* CONFIG_PAL */
        i = adv7171_write_block(client, init_PAL, sizeof(init_PAL));
#endif
        if (i >= 0) {
                i = adv7171_write(client, 0x07, TR0MODE | TR0RST);
                i = adv7171_write(client, 0x07, TR0MODE);
                i = adv7171_read(client, 0x12);
                printk(KERN_INFO "%s_attach: rev. %d at 0x%02x\n",
                       I2C_NAME(client), i & 1, client->addr << 1);

        }
        if (i < 0) {
                printk(KERN_ERR "%s_attach: init error 0x%x\n",
                       I2C_NAME(client), i);
        }
This is where the 7171 is set up.
Make sure that the 7179 is set up properly.


All this may still not get you here but at least you can see how the
7171 unit is set up.
Contact me directly if you need any more help.

[EMAIL PROTECTED]


Regards
  Phil Wilshire

nimesh kanoth wrote:
Dear sir, We are doing one project in BF561, We are facing some problem in framebuffer device we have an encoder AD7179 . We wriiten the driver part as like AD7171 .. with minor change in DMA and i2c . Can you help us regarding this.. If so I will send the code and details.... we are getting picture on screen but not color is not correct .. instead of one picture we are gettin three more picture. We feel the function rgbtoyuv have some problem or we are not able to make out..
Please help us to sort out this..
Rgds
nimesh

*/Phil Wilshire <[EMAIL PROTECTED]>/* wrote:

    Hi All,

    Please forgive the occasional commercial.

    If you want help with the Blackfin please contact me via the list.

    UK Blackfin uClinux workshop
    ============================

    SDCS is delighted to be able to offer a public uClinux Training Seminar
    in Weybridge, United Kingdom, April 24th-27th, 2007.

    This will be a 4 day class based on the High performance Blackfin
    processor series.

    The fee is 995.00 UK Pounds

    This course delivers very comprehensive training on the use of the
    uClinux development system and is intended for busy system developers
    who want to accelerate their product development cycle.

    Bring along your laptop running a recent Linux Distribution and leave
    with a fully working uClinux development environment and the knowledge
    of how to use it.

    The course will be limited to 10 people so book early.

    Basic details are available here:

    http://www.sysdcs.com/

    and

    http://www.sysdcs.com/SDCSucbf.html

    New material in this class includes

    * An Introduction to the BF537 based Asterisk Appliance
    * More BF561 multicore details
    * Using Nano-X and Video Frame buffers.
    * PPI Interface
    * Svn repository access
    * Introduction to Unit testing (LTP)


    Please email me for more details.
    ( Sorry the online booking is still not working)

    mailto:[EMAIL PROTECTED]


    Best Regards
    Phil Wilshire

    _______________________________________________
    uClinux-dev mailing list
    [EMAIL PROTECTED]
    http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
    This message was resent by [EMAIL PROTECTED]
    To unsubscribe see:
    http://mailman.uclinux.org/mailman/options/uclinux-dev


------------------------------------------------------------------------
Bored stiff? <http://us.rd.yahoo.com/evt=49935/*http://games.yahoo.com> Loosen up... Download and play hundreds of games for free <http://us.rd.yahoo.com/evt=49935/*http://games.yahoo.com> on Yahoo! Games.


------------------------------------------------------------------------

_______________________________________________
uClinux-dev mailing list
[EMAIL PROTECTED]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [EMAIL PROTECTED]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

_______________________________________________
uClinux-dev mailing list
[EMAIL PROTECTED]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [EMAIL PROTECTED]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to