All of lore.kernel.org
 help / color / mirror / Atom feed
From: Suresh Rao <sureshraomr@gmail.com>
To: "linux-media@vger.kernel.org" <linux-media@vger.kernel.org>
Cc: "Tuukka.O Toivonen" <tuukka.o.toivonen@nokia.com>
Subject: Re: ISP Configuration for RAW Bayer sensor
Date: Thu, 19 Mar 2009 19:29:13 +0530	[thread overview]
Message-ID: <d9ec170c0903190659t70ede200w301c0105f7323c7f@mail.gmail.com> (raw)
In-Reply-To: <200903190942.43219.tuukka.o.toivonen@nokia.com>

Hi Tuukka,

Thanks a lot for the patch, I will try this.

I tried similar thing but on the sensor side and it worked, ie., I
skip the very first line from readout and get the desired format for
the ISP.

Thanks,
Suresh

On Thu, Mar 19, 2009 at 1:12 PM, Tuukka.O Toivonen
<tuukka.o.toivonen@nokia.com> wrote:
> On Wednesday 18 March 2009 18:17:56 ext Suresh Rao wrote:
>> I am working with MT9V023 RAW sensor.  The data format from the sensor is
>>
>> B G B G B G B G ...
>> G R G R G R G R ...
>> B G B G B G B G ...
>> G R G R G R G R ........      [ Format 1]
> [...]
>> I want to use the ISP on the OMAP for doing interpolation and format
>> conversion to UYVY.  I am able to capture the images from the sensor,
>> however I notice that the color information is missing.  I dug the
>> sources and found that in the RAW capture mode ISP is getting
>> configured to input format
>>
>> G R G R G R G R ...
>> B G B G B G B G ...
>> G R G R G R G R ...
>> B G B G B G B G ...          [Format 2]
>>
>> Has anyone tried sensors with BGGR ( Format 1) on OMAP?
>>
>> Can anyone give me some pointers or information on how to configure
>> ISP for BGGR (Format 1)
>
> If you can live with losing a few pixels (maybe sensor has a few extra)
> I recommend to configure ISP to crop away the topmost line.
>
> Here's couple of old _example_ patches how to configure the cropping.
> Just gives an idea where to start...
>
> - Tuukka
>
>
> diff --git a/drivers/media/video/isp/ispccdc.c b/drivers/media/video/isp/ispccdc.c
> index 2288bc9..87870f1 100644
> --- a/drivers/media/video/isp/ispccdc.c
> +++ b/drivers/media/video/isp/ispccdc.c
> @@ -1189,13 +1189,13 @@ int ispccdc_config_size(u32 input_w, u32 input_h, u32 output_w, u32 output_h)
>                                                ISPCCDC_HORZ_INFO);
>                } else {
>                        if (ispccdc_obj.ccdc_inpfmt == CCDC_RAW) {
> -                               omap_writel(1 << ISPCCDC_HORZ_INFO_SPH_SHIFT
> -                                               | ((ispccdc_obj.ccdcout_w - 1)
> +                               omap_writel(0 << ISPCCDC_HORZ_INFO_SPH_SHIFT
> +                                               | (ispccdc_obj.ccdcout_w
>                                                << ISPCCDC_HORZ_INFO_NPH_SHIFT),
>                                                ISPCCDC_HORZ_INFO);
>                        } else {
>                                omap_writel(0 << ISPCCDC_HORZ_INFO_SPH_SHIFT
> -                                               | ((ispccdc_obj.ccdcout_w - 1)
> +                                               | (ispccdc_obj.ccdcout_w
>                                                << ISPCCDC_HORZ_INFO_NPH_SHIFT),
>                                                ISPCCDC_HORZ_INFO);
>                        }
> @@ -1227,7 +1227,7 @@ int ispccdc_config_size(u32 input_w, u32 input_h, u32 output_w, u32 output_h)
>                                        ISPCCDC_VP_OUT_VERT_NUM_SHIFT),
>                                        ISPCCDC_VP_OUT);
>                omap_writel(0 << ISPCCDC_HORZ_INFO_SPH_SHIFT |
> -                                       ((ispccdc_obj.ccdcout_w - 1) <<
> +                                       (ispccdc_obj.ccdcout_w <<
>                                        ISPCCDC_HORZ_INFO_NPH_SHIFT),
>                                        ISPCCDC_HORZ_INFO);
>                omap_writel(0 << ISPCCDC_VERT_START_SLV0_SHIFT,
> diff --git a/drivers/media/video/isp/ispccdc.c
> b/drivers/media/video/isp/ispccdc.c
> index f5957b2..6afaabf 100644
> --- a/drivers/media/video/isp/ispccdc.c
> +++ b/drivers/media/video/isp/ispccdc.c
> @@ -478,7 +478,7 @@ EXPORT_SYMBOL(ispccdc_enable_lsc);
>   **/
>  void ispccdc_config_crop(u32 left, u32 top, u32 height, u32 width)
>  {
> -       ispccdc_obj.ccdcin_woffset = left + ((left + 1) % 2);
> +       ispccdc_obj.ccdcin_woffset = left + (left % 2);
>         ispccdc_obj.ccdcin_hoffset = top + (top % 2);
>
>         ispccdc_obj.crop_w = width - (width % 16);
> @@ -1166,7 +1166,7 @@ int ispccdc_config_size(u32 input_w, u32 input_h,
> u32 output_w, u32 output_h)
>                                         ISPCCDC_FMT_VERT);
>                 omap_writel((ispccdc_obj.ccdcout_w <<
>                                         ISPCCDC_VP_OUT_HORZ_NUM_SHIFT) |
> -                                       (ispccdc_obj.ccdcout_h <<
> +                                       (ispccdc_obj.ccdcout_h - 1 <<
>                                         ISPCCDC_VP_OUT_VERT_NUM_SHIFT),
>                                         ISPCCDC_VP_OUT);
>                 omap_writel((((ispccdc_obj.ccdcout_h - 25) &
>
>
>

  reply	other threads:[~2009-03-19 13:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-18 16:17 ISP Configuration for RAW Bayer sensor Suresh Rao
2009-03-19  7:42 ` Tuukka.O Toivonen
2009-03-19 13:59   ` Suresh Rao [this message]
2009-03-20  2:19     ` Aguirre Rodriguez, Sergio Alberto
2009-03-20 17:51       ` Suresh Rao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d9ec170c0903190659t70ede200w301c0105f7323c7f@mail.gmail.com \
    --to=sureshraomr@gmail.com \
    --cc=linux-media@vger.kernel.org \
    --cc=tuukka.o.toivonen@nokia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.