public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Sylwester Nawrocki <snjw23@gmail.com>
To: David Cohen <dacohen@gmail.com>
Cc: Hans Verkuil <hverkuil@xs4all.nl>,
	Mauro Carvalho Chehab <mchehab@redhat.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
	alsa-devel@alsa-project.org,
	Sakari Ailus <sakari.ailus@retiisi.org.uk>,
	Pawel Osciak <pawel@osciak.com>
Subject: Re: [GIT PULL FOR 2.6.39] Media controller and OMAP3 ISP driver
Date: Sat, 05 Mar 2011 15:29:08 +0100	[thread overview]
Message-ID: <4D7248B4.9090003@gmail.com> (raw)
In-Reply-To: <AANLkTi=SS3CBkKUdovU33SQi=s9gNprZszKaMrkRGqGy@mail.gmail.com>

Hi David,

On 03/05/2011 02:04 PM, David Cohen wrote:
> Hi Hans,
> 
> On Sat, Mar 5, 2011 at 1:52 PM, Hans Verkuil<hverkuil@xs4all.nl>  wrote:
>> On Friday, March 04, 2011 21:10:05 Mauro Carvalho Chehab wrote:
>>> Em 03-03-2011 07:25, Laurent Pinchart escreveu:
...
>>>>        v4l: Group media bus pixel codes by types and sort them alphabetically
>>>
>>> The presence of those mediabus names against the traditional fourcc codes
>>> at the API adds some mess to the media controller. Not sure how to solve,
>>> but maybe the best way is to add a table at the V4L2 API associating each
>>> media bus format to the corresponding V4L2 fourcc codes.
>>
>> You can't do that in general. Only for specific hardware platforms. If you
>> could do it, then we would have never bothered creating these mediabus fourccs.
>>
>> How a mediabus fourcc translates to a pixelcode (== memory format) depends
>> entirely on the hardware capabilities (mostly that of the DMA engine).
> 
> May I ask you one question here? (not entirely related to this patch set).
> Why pixelcode != mediabus fourcc?
> e.g. OMAP2 camera driver talks to sensor through subdev interface and
> sets its own output pixelformat depending on sensor's mediabus fourcc.
> So it needs a translation table mbus_pixelcode ->  pixelformat. Why
> can't it be pixelformat ->  pixelformat ?
> 

Let me try to explain, struct v4l2_mbus_framefmt::code (pixelcode)
describes how data is transfered/sampled on the camera parallel or serial bus.
It defines bus width, data alignment and how many data samples form a single
pixel.

struct v4l2_pix_format::pixelformat (fourcc) on the other hand describes how
the image data is stored in memory.
 
As Hans pointed out there is not always a 1:1 correspondence, e.g. 

1. Both V4L2_MBUS_FMT_YUYV8_1x16 and V4L2_MBUS_FMT_YUYV8_2x8 may being 
translating to V4L2_PIX_FMT_YUYV fourcc,

2. Or the DMA engine in the camera host interface might be capable of
converting single V4L2_MBUS_FMT_RGB555 pixelcode to V4L2_PIX_FMT_RGB555
and V4L2_PIX_FMT_RGB565 fourcc's. So the user can choose any of them they
seem most suitable and the hardware takes care of the conversion. 

What translations are available really depends on the hardware, so how
could we define a standard translation table? IMO it should be realized
in each driver on an individual basis.

Regards,
Sylwester

> Regards,
> 
> David
> 
>>
>> A generic V4L2 application will never use mediabus fourcc codes. It's only used
>> by drivers and applications written specifically for that hardware and using
>> /dev/v4l-subdevX devices.
>>
>> Regards,
>>
>>         Hans
>>


  parent reply	other threads:[~2011-03-05 14:29 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-17 15:06 [GIT PULL FOR 2.6.39] Media controller and OMAP3 ISP driver Laurent Pinchart
2011-03-02 20:13 ` Mauro Carvalho Chehab
2011-03-03  9:29   ` Laurent Pinchart
2011-03-03 10:25   ` Laurent Pinchart
2011-03-04 19:25     ` Mauro Carvalho Chehab
2011-03-05 13:02       ` Laurent Pinchart
2011-03-05 18:22         ` Mauro Carvalho Chehab
2011-03-05 20:48           ` Laurent Pinchart
2011-03-07 11:57             ` Mauro Carvalho Chehab
2011-03-07 12:06               ` David Cohen
2011-03-07 13:38               ` Laurent Pinchart
2011-03-07 22:04               ` Laurent Pinchart
2011-03-11 15:40               ` Mauro Carvalho Chehab
2011-03-11 15:48                 ` Laurent Pinchart
2011-03-04 20:10     ` Mauro Carvalho Chehab
2011-03-04 20:14       ` David Cohen
2011-03-05 11:52       ` Hans Verkuil
2011-03-05 13:04         ` David Cohen
2011-03-05 14:02           ` Hans Verkuil
2011-03-05 14:29           ` Sylwester Nawrocki [this message]
2011-03-05 18:14             ` Mauro Carvalho Chehab
2011-03-05 23:23               ` Sylwester Nawrocki
2011-03-06 10:56                 ` Mauro Carvalho Chehab
2011-03-06 11:38                   ` Laurent Pinchart
2011-03-06 13:32                     ` Mauro Carvalho Chehab
2011-03-06 17:21                       ` Laurent Pinchart
2011-03-07 11:50                         ` Mauro Carvalho Chehab
     [not found]                           ` <201103071302.49323.hansverk@cisco.com>
2011-03-07 13:00                             ` Mauro Carvalho Chehab
2011-03-07 13:04                               ` Mauro Carvalho Chehab
2011-03-07 13:46                               ` Laurent Pinchart
2011-03-04 20:49     ` Mauro Carvalho Chehab
2011-03-04 21:31       ` Mauro Carvalho Chehab
2011-03-05 12:03       ` Hans Verkuil
2011-03-04 22:16 ` Mauro Carvalho Chehab
2011-03-04 22:33   ` David Cohen
2011-03-04 22:43     ` Mauro Carvalho Chehab
2011-03-04 22:49       ` David Cohen
2011-03-04 23:49         ` Mauro Carvalho Chehab
2011-03-05  0:40           ` David Cohen
2011-03-06  8:34 ` Sakari Ailus
2011-03-06 10:17   ` Laurent Pinchart
2011-03-07 11:56     ` Mauro Carvalho Chehab
2011-03-07 12:08       ` Sakari Ailus

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=4D7248B4.9090003@gmail.com \
    --to=snjw23@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=dacohen@gmail.com \
    --cc=hverkuil@xs4all.nl \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@redhat.com \
    --cc=pawel@osciak.com \
    --cc=sakari.ailus@retiisi.org.uk \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox