All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergio Aguirre <saaguirre@ti.com>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: "linux-media@vger.kernel.org" <linux-media@vger.kernel.org>
Subject: Re: [Query][soc_camera] How to handle hosts w/color conversion built in?
Date: Mon, 7 Mar 2011 15:19:15 -0600	[thread overview]
Message-ID: <4D754BD3.7090204@ti.com> (raw)
In-Reply-To: <Pine.LNX.4.64.1103072202070.29543@axis700.grange>

Hi Guennadi,

Thanks for replying.

On 03/07/2011 03:05 PM, Guennadi Liakhovetski wrote:
> On Mon, 7 Mar 2011, Sergio Aguirre wrote:
>
>> Hi Guennadi and all,
>>
>> I've been trying to make my omap4 camera host driver to allow YUYV ->  NV12
>> color conversion, and add that to the supported host-client formats, but I
>> think I have hit the wall with the host design.
>>
>> I noticed that the soc_camera seems to be designed to just pass-through the
>> client supported formats (i.e. if my sensor supports YUYV and JPEG, those will
>> be the supported formats only)
>
> No, this is not the case.

Ok.

>
>> Now, in my host driver, I have a feature to do a color conversion to NV12, but
>> I'm still not sure on how to expand the supported formats to, say: YUYV, JPEG,
>> and NV12 (which would be available only if the client outputs YUYV, of
>> course).
>>
>> I was trying adding a customized get_formats function, but as
>> soc_camera_init_user_formats anyways depends heavly on the sensor's
>> enum_mbus_fmt, it's hard to add supported formats that the sensor doesn't
>> directly support.
>>
>> Has this been done before? Any advice?
>
> Of course, this is supported. See sh_mobile_ceu.c, mx3_camera, pxa_camera,
> omap1_camera. Just search for the format array defined with "static const
> struct soc_mbus_pixelfmt" and see how it is used. Feel free to ask again,
> if you have more questions.

Ahh... OK. I understand now :)

So, you basically first determine the count of sensor formats, by 
looping through enum_mbus_fmt in the sensor, and with every call to 
get_formats with the index range, you can return 2 or more formats.

In my case, when the sensor supports YUYV, I'll return 2 and update the 
xlate array with 2 entries, instead of just one, is that right?

Sorry for the noise, and thanks for the patience :)

I've been focusing more on the actual HW functionality, rather than the 
clean design. But now it's time to clean things up and prepare for 
upstreaming :)

Regards,
Sergio

>
> Thanks
> Guennadi
> ---
> Guennadi Liakhovetski, Ph.D.
> Freelance Open-Source Software Developer
> http://www.open-technology.de/


  reply	other threads:[~2011-03-07 21:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-07 20:41 [Query][soc_camera] How to handle hosts w/color conversion built in? Sergio Aguirre
2011-03-07 21:05 ` Guennadi Liakhovetski
2011-03-07 21:19   ` Sergio Aguirre [this message]
2011-03-07 21:29     ` Guennadi Liakhovetski

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=4D754BD3.7090204@ti.com \
    --to=saaguirre@ti.com \
    --cc=g.liakhovetski@gmx.de \
    --cc=linux-media@vger.kernel.org \
    /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.